Skip to content

merahulthumma/Arduino-fingerprint-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Arduino Fingerprint Authentication System

Arduino C++ License

A sophisticated biometric authentication system with LCD display feedback for secure access control

πŸŽ₯ Video Demo β€’ Features β€’ Hardware β€’ Installation β€’ Usage


🌟 Overview

This project implements a complete fingerprint-based authentication system using Arduino Uno, featuring real-time LCD feedback and dual-mode operation (enrollment and verification). Perfect for DIY security projects, smart locks, attendance systems, and IoT applications.

πŸŽ₯ Watch the Project in Action!

Arduino Fingerprint System Demo

▢️ Click here to watch the full demonstration and component overview

Why This Project?

  • ✨ User-Friendly: Real-time feedback via 20x4 LCD display
  • πŸ”’ Secure: Biometric authentication with confidence scoring
  • 🎯 Dual Mode: Separate programs for enrollment and verification
  • πŸ’Ύ Persistent Storage: Stores up to 127 fingerprint templates
  • πŸš€ Fast Recognition: Quick matching with high accuracy
  • πŸ”§ Easy to Customize: Clean, well-commented code

✨ Features

🎨 Core Functionality

Feature Description
Fingerprint Enrollment Register new fingerprints with step-by-step LCD guidance
Fingerprint Verification Authenticate users with confidence percentage display
LCD Feedback Real-time status updates on 20x4 I2C LCD screen
Template Storage Store up to 127 unique fingerprint templates
Error Handling Comprehensive error detection and user-friendly messages
Confidence Scoring Match quality percentage for verification

🎭 Two Operating Modes

1️⃣ Enrollment Mode (enroll.ino)

  • Interactive fingerprint registration
  • Requires two scans of the same finger for accuracy
  • Assigns unique ID to each fingerprint (1-127)
  • Step-by-step LCD instructions

2️⃣ Verification Mode (verify.ino)

  • Continuous fingerprint scanning
  • Displays matched ID and confidence percentage
  • "Finger Not Found" notification for unregistered prints
  • Fast search algorithm for quick authentication

πŸ› οΈ Hardware Setup

πŸ’‘ Pro Tip: Watch the detailed component overview video for visual guidance on all components and connections!

πŸ“¦ Components Required

Component Specification Quantity
Arduino Uno ATmega328P based 1
Fingerprint Sensor R307 / AS608 1
LCD Display 20x4 I2C (0x27 address) 1
Jumper Wires Male-to-Male / Male-to-Female 8-10
Breadboard Standard size 1
USB Cable Type A to Type B 1
Power Supply 5V (Arduino USB or external) 1

πŸ”Œ Pin Configuration

Fingerprint Sensor Connections

Sensor Pin β†’ Arduino Pin
------------------------
VCC (Red)  β†’ 5V
GND (Black)β†’ GND
TX (White) β†’ Pin 2 (RX)
RX (Green) β†’ Pin 3 (TX)

LCD Display Connections (I2C)

LCD Pin β†’ Arduino Pin
--------------------
VCC     β†’ 5V
GND     β†’ GND
SDA     β†’ A4
SCL     β†’ A5

πŸ“ Circuit Diagram

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  Arduino    β”‚
                    β”‚    Uno      β”‚
                    β”‚             β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ 5V          β”‚
    β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ GND         β”‚
    β”‚   β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€ Pin 2 (RX)  β”‚
    β”‚   β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€ Pin 3 (TX)  β”‚
    β”‚   β”‚  β”‚  β”‚    β”‚ A4 (SDA)────┼───┐
    β”‚   β”‚  β”‚  β”‚    β”‚ A5 (SCL)────┼─┐ β”‚
    β”‚   β”‚  β”‚  β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
    β”‚   β”‚  β”‚  β”‚                     β”‚ β”‚
    β”‚   β”‚  β”‚  β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚
    β”‚   β”‚  β”‚  β”‚    β”‚  Fingerprint β”‚ β”‚ β”‚
    β”‚   β”‚  β”‚  β”‚    β”‚    Sensor    β”‚ β”‚ β”‚
    β”œβ”€β”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€β”€ VCC           β”‚ β”‚ β”‚
    β”‚   └──┼──┼──── GND           β”‚ β”‚ β”‚
    β”‚      └──┼──── TX            β”‚ β”‚ β”‚
    β”‚         └──── RX            β”‚ β”‚ β”‚
    β”‚             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
    β”‚                               β”‚ β”‚
    β”‚             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚ β”‚
    β”‚             β”‚   LCD 20x4     β”‚β”‚ β”‚
    β”‚             β”‚   (I2C 0x27)   β”‚β”‚ β”‚
    └────────────── VCC            β”‚β”‚ β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ GND            β”‚β”‚ β”‚
        β”‚         β”‚ SDA β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚ β”‚
        β”‚         β”‚ SCL β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
        β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
        β”‚                              β”‚
       GND                            5V

πŸš€ Quick Start

πŸ“₯ Installation Steps

1. Clone the Repository

git clone https://github.com/merahulthumma/Arduino-fingerprint-system.git
cd Arduino-fingerprint-system

2. Install Arduino IDE

Download from Arduino Official Website

3. Install Required Libraries

Open Arduino IDE and install these libraries via Library Manager (Sketch β†’ Include Library β†’ Manage Libraries):

  • Adafruit Fingerprint Sensor Library by Adafruit
  • LiquidCrystal I2C by Frank de Brabander

Or install manually:

# Using Arduino CLI
arduino-cli lib install "Adafruit Fingerprint Sensor Library"
arduino-cli lib install "LiquidCrystal I2C"

4. Hardware Assembly

  • Connect components as per the pin configuration above
  • Double-check power connections (5V and GND)
  • Ensure I2C LCD address is 0x27 (check using I2C scanner if needed)

5. Upload the Code

For Enrollment Mode:

1. Open enroll.ino in Arduino IDE
2. Select: Tools β†’ Board β†’ Arduino Uno
3. Select: Tools β†’ Port β†’ [Your Arduino Port]
4. Click Upload (β†’) button
5. Open Serial Monitor (9600 baud)

For Verification Mode:

1. Open verify.ino in Arduino IDE
2. Follow steps 2-5 above

πŸ’» Usage

πŸ“ Enrolling Fingerprints

  1. Upload enroll.ino to Arduino
  2. Open Serial Monitor (9600 baud rate)
  3. Read LCD message: "Ready to enroll a fingerprint!"
  4. Enter ID number (1-127) in Serial Monitor
  5. Place finger on sensor when prompted
  6. Remove finger when instructed
  7. Place same finger again for verification
  8. Done! LCD shows "Stored!" message
LCD Display Flow:
-----------------
"Hello, Mates'!"
"G'day"
        ↓
"Ready to enroll a fingerprint!"
        ↓
"Please type in the ID #"
        ↓
"Waiting for valid finger..."
        ↓
"Image taken"
        ↓
"Remove finger"
        ↓
"Place same finger again"
        ↓
"Prints matched!"
        ↓
"Stored!"

πŸ” Verifying Fingerprints

  1. Upload verify.ino to Arduino
  2. Wait for LCD message: "Waiting for valid finger..."
  3. Place registered finger on sensor
  4. View results on LCD:
    • βœ… Match Found: Shows ID # and confidence %
    • ❌ No Match: "Finger Not Found - Try Later"
LCD Display Flow:
-----------------
"Hello, Mates'!"
"G'day"
        ↓
"Sensor contains X templates"
        ↓
"Waiting for valid finger..."
        ↓
[Place finger]
        ↓
"Found ID # X"
"with % of YY"
    OR
"Finger Not Found"
"Try Later"

πŸŽ₯ Demo

πŸ“Ή Video Demonstration

For a complete visual walkthrough of the hardware setup, component connections, and system operation, watch the detailed video tutorial:

🎬 Watch Full Demo on YouTube

The video covers:

  • πŸ“¦ All required components
  • πŸ”Œ Step-by-step wiring guide
  • 🎯 Enrollment process demonstration
  • βœ… Verification process in action
  • πŸ’‘ Tips and troubleshooting

Expected Behavior

Enrollment Process:

[LCD] Hello, Mates'! G'day
[LCD] Found fingerprint sensor
[LCD] Ready to enroll a fingerprint!
[Serial] Please type ID (1-127): 5
[LCD] Waiting for valid finger...
[LCD] Image taken
[LCD] Remove finger
[LCD] Place same finger again
[LCD] Image taken
[LCD] Prints matched!
[LCD] Stored!

Verification Process:

[LCD] Hello, Mates'! G'day
[LCD] Sensor contains 5 templates
[LCD] Waiting for valid finger...
[User places finger]
[LCD] Found ID # 5
[LCD] with % of 95

πŸ—οΈ Code Structure

Arduino-fingerprint-system/
β”‚
β”œβ”€β”€ πŸ“„ enroll.ino              # Fingerprint enrollment program
β”‚   β”œβ”€β”€ Setup initialization
β”‚   β”œβ”€β”€ LCD welcome message
β”‚   β”œβ”€β”€ Sensor verification
β”‚   β”œβ”€β”€ ID input handling
β”‚   └── Two-stage fingerprint capture
β”‚
β”œβ”€β”€ πŸ“„ verify.ino              # Fingerprint verification program
β”‚   β”œβ”€β”€ Setup initialization
β”‚   β”œβ”€β”€ Template count display
β”‚   β”œβ”€β”€ Continuous scanning loop
β”‚   └── Match result display
β”‚
β”œβ”€β”€ πŸ“„ README.md               # This file
└── πŸ“„ circuit_diagram.png     # Wiring diagram (recommended to add)

🧩 Key Functions

Enrollment (enroll.ino)

getFingerprintEnroll()  // Main enrollment function
- getImage()            // Capture fingerprint image
- image2Tz(1)          // Convert first image to template
- image2Tz(2)          // Convert second image to template  
- createModel()         // Create fingerprint model
- storeModel(id)        // Store in sensor memory

Verification (verify.ino)

getFingerprintIDez()    // Quick verification function
- getImage()            // Capture fingerprint image
- image2Tz()           // Convert to template
- fingerFastSearch()    // Search database for match
- Return fingerID       // Return matched ID or -1

βš™οΈ Configuration

πŸ”§ Customizable Parameters

// In both enroll.ino and verify.ino

// Sensor Configuration
finger.begin(57600);              // Baud rate (9600, 57600, 115200)

// LCD Configuration
LiquidCrystal_I2C lcd(0x27,20,4); // Address, columns, rows
                                   // Common addresses: 0x27, 0x3F

// Serial Configuration
Serial.begin(9600);               // Serial monitor baud rate

// Fingerprint Storage
#define MAX_FINGERPRINTS 127      // Maximum templates (1-127)

🎨 LCD Address Detection

If LCD doesn't work, scan for I2C address:

#include <Wire.h>

void setup() {
  Wire.begin();
  Serial.begin(9600);
  Serial.println("I2C Scanner");
}

void loop() {
  for(byte i = 1; i < 127; i++) {
    Wire.beginTransmission(i);
    if(Wire.endTransmission() == 0) {
      Serial.print("Found: 0x");
      Serial.println(i, HEX);
    }
  }
  delay(5000);
}

πŸ› Troubleshooting

Common Issues & Solutions

πŸ”΄ "Did not find fingerprint sensor"

Possible Causes:

  • Incorrect wiring connections
  • Sensor not powered properly
  • Wrong TX/RX connections

Solutions:

βœ“ Check VCC connected to 5V
βœ“ Verify GND connections
βœ“ Swap TX and RX pins (common mistake)
βœ“ Test with different baud rate: finger.begin(9600)

πŸ”΄ LCD Shows Nothing

Possible Causes:

  • Wrong I2C address
  • Loose connections
  • Insufficient power

Solutions:

βœ“ Run I2C scanner to find address
βœ“ Try address 0x3F if 0x27 doesn't work
βœ“ Check SDA β†’ A4, SCL β†’ A5
βœ“ Adjust contrast potentiometer on LCD

πŸ”΄ "Image too messy"

Possible Causes:

  • Dirty sensor surface
  • Wet or dirty finger
  • Improper finger placement

Solutions:

βœ“ Clean sensor with soft cloth
βœ“ Clean and dry finger
βœ“ Press firmly but gently
βœ“ Place finger flat on sensor

πŸ”΄ "Fingerprints did not match"

Possible Causes:

  • Different finger placement
  • Finger moved between scans
  • Pressure variation

Solutions:

βœ“ Keep finger still during scan
βœ“ Use same pressure for both scans
βœ“ Wait for "Remove finger" message
βœ“ Ensure good contact with sensor

πŸ”΄ "Could not store in that location"

Possible Causes:

  • Invalid ID number
  • Memory full
  • ID already in use

Solutions:

βœ“ Use ID between 1-127
βœ“ Delete old fingerprints if memory full
βœ“ Use different ID number

πŸ“Š Debugging Tips

Enable verbose output for debugging:

// Add to setup()
Serial.println("System initialized");
Serial.print("Template count: ");
Serial.println(finger.templateCount);

Monitor Serial output at 9600 baud for detailed status messages.


🎯 Applications & Use Cases

🏠 Home & Personal

  • πŸšͺ Smart Door Locks - Keyless entry systems
  • πŸ”’ Personal Safe - Biometric cabinet locks
  • πŸ’» Computer Security - Physical authentication device
  • πŸ“¦ Secure Storage - Jewelry boxes, documents

🏒 Commercial & Office

  • ⏰ Attendance System - Employee time tracking
  • πŸ›οΈ Access Control - Restricted area entry
  • πŸ–₯️ Workstation Security - Computer login
  • πŸ“ File Cabinet Lock - Document security

πŸŽ“ Educational & IoT

  • πŸ”¬ Learning Projects - Embedded systems education
  • πŸ€– IoT Integration - Smart home automation
  • πŸ† Competition Projects - Robotics and maker fairs
  • πŸ“š Research - Biometric authentication studies

πŸš€ Advanced Implementations

  • Multi-User Systems - Household/office access
  • Cloud Integration - Log attendance to database
  • Mobile Alerts - Notify via SMS/email on access
  • Time-Based Access - Scheduled entry permissions

πŸ”¬ Technical Specifications

Hardware Specifications

Component Details
Microcontroller ATmega328P @ 16MHz
Operating Voltage 5V DC
Sensor Type Optical fingerprint sensor
Sensor Baud Rate 9600 / 57600 bps
Image Resolution 256 x 288 pixels
Template Size 512 bytes
Storage Capacity 127 templates
False Acceptance Rate < 0.001%
False Rejection Rate < 1%
Matching Speed < 1 second
LCD Type 20x4 characters, I2C interface

Software Specifications

Feature Implementation
Programming Language C++ (Arduino)
IDE Arduino IDE 1.8+
Libraries Adafruit Fingerprint, LiquidCrystal I2C
Communication SoftwareSerial, Wire (I2C)
Error Handling Comprehensive status codes
User Interface Serial + LCD display

πŸ“š Code Explanation

Key Concepts

1️⃣ Two-Stage Enrollment

// Stage 1: Capture first image
finger.getImage()        // Scan finger
finger.image2Tz(1)       // Store in buffer 1

// Stage 2: Capture second image  
finger.getImage()        // Scan same finger
finger.image2Tz(2)       // Store in buffer 2

// Verification & Storage
finger.createModel()     // Compare buffers
finger.storeModel(id)    // Save if matched

2️⃣ Fast Search Algorithm

// Optimized search through all templates
finger.fingerFastSearch()
// Returns:
// - FINGERPRINT_OK: Match found
// - FINGERPRINT_NOTFOUND: No match
// - finger.fingerID: Matched template ID
// - finger.confidence: Match quality (0-255)

3️⃣ LCD Status Updates

// Real-time user feedback
lcd.clear();             // Clear display
lcd.print("Message");    // Show status
delay(2000);             // Visible duration

🀝 Contributing

Contributions make the open-source community an amazing place to learn and create! Any contributions are greatly appreciated.

How to Contribute

  1. Fork the repository
  2. Create your feature branch
    git checkout -b feature/AmazingFeature
  3. Commit your changes
    git commit -m 'Add some AmazingFeature'
  4. Push to the branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request

Contribution Ideas

  • 🎨 Improve LCD messages and UI
  • πŸ”’ Add multi-level access control
  • πŸ“± Integrate with mobile apps
  • 🌐 Add WiFi/Bluetooth connectivity
  • πŸ“Š Implement access logging
  • πŸ”” Add buzzer feedback
  • 🎯 Create web interface for management
  • πŸ“Έ Add OLED display support
  • ⚑ Optimize performance
  • πŸ“– Improve documentation

πŸ“„ License

This project is licensed under the MIT License.

MIT License

Copyright (c) 2024 Rahul Marreddy Thumma

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

πŸ‘¨β€πŸ’» Author

Rahul Marreddy Thumma


πŸ™ Acknowledgments

Special thanks to:

  • Adafruit Industries - For the excellent fingerprint sensor library
  • Arduino Community - For extensive documentation and support
  • Frank de Brabander - For the LiquidCrystal I2C library
  • Open Source Contributors - For inspiring this project

Resources Used


πŸŽ“ Learning Resources

Want to learn more? Check out these resources:


πŸ“Š Project Stats

GitHub stars GitHub forks GitHub watchers


πŸ—ΊοΈ Roadmap

Current Version: v1.0

  • βœ… Basic enrollment functionality
  • βœ… Fingerprint verification
  • βœ… LCD display integration
  • βœ… Serial communication

Planned Features: v2.0

  • ⏳ Web-based management interface
  • ⏳ WiFi connectivity (ESP8266/ESP32)
  • ⏳ Database logging
  • ⏳ Mobile app integration
  • ⏳ Multi-language support
  • ⏳ OLED display option
  • ⏳ Buzzer feedback

πŸ’¬ FAQ

Q: Can I use a different fingerprint sensor?

Yes! Most optical fingerprint sensors (R307, AS608, GT-511C3) work with minor modifications to the baud rate.

Q: How secure is this system?

The sensor has a False Acceptance Rate (FAR) of < 0.001% and stores templates as mathematical representations, not actual fingerprint images.

Q: Can I store more than 127 fingerprints?

The sensor's hardware limit is 127 templates. For larger capacity, consider upgrading to a database-backed system with multiple sensors.

Q: Does it work with Arduino Mega/Nano?

Yes! Just adjust the pin numbers in the code. Mega has more serial ports, Nano works identically to Uno.

Q: Can I add WiFi to send notifications?

Absolutely! Integrate ESP8266 or ESP32 to add IoT features like cloud logging and mobile notifications.


🌟 Star History

If you found this project helpful, please consider giving it a ⭐ on GitHub!

Star History Chart


πŸ“¬ Support

Need help? Here's how to get support:


⭐ Don't forget to star this repository if you found it useful! ⭐

Made with ❀️ by Rahul Thumma

⬆ Back to Top

About

Finger Print System with Arduino Uno Board

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages