Translate

Arduino-Based Fingerprint Attendance System

 1. Introduction

An Arduino-Based Fingerprint Attendance System using R307 is a secure and reliable biometric system used to record attendance using fingerprints. Unlike RFID or password systems, fingerprint-based systems are highly secure and cannot be duplicated easily.

The R307 Fingerprint Sensor is widely used because of its high accuracy, built-in storage, and fast recognition speed. This project is ideal for schools, colleges, and offices.


2. Components

  • Arduino UNO / Nano
  • R307 H Fingerprint Sensor (1000 finger storage)
  • DS3231 RTC Module
  • 16x2 LCD Display with I2C 
  • Buzzer
  • Jumper Wires
  • Breadboard
  • Power Supply

3. Circuit and Connections

Pinout Diagram of Arduino Uno R3

Pinout Diagram R307 Fingerprint Sensor

Pinout Diagram Buzzer

Pinout Diagram of LCD with I2C
PINOUT LCD WITH I2C

R307 Fingerprint Sensor

  • VCC → 5V
  • GND → GND
  • TX → Arduino Pin 2
  • RX → Arduino Pin 3

RTC DS3231

  • SDA → A4
  • SCL → A5
  • VCC → 5V
  • GND → GND

Buzzer

  • Positive → Pin 8
  • Negative → GND

LCD 

  • SDA → A4
  • SCL → A5
  • VCC → 5V
  • GND → GND   same as RTC since it is a shared wire system 

4. Detailed Step By Step Circuit Working

  1. The fingerprint sensor scans the finger and converts it into a digital template.
  2. This template is stored inside the sensor memory.
  3. When a user places a finger:
    • Sensor captures fingerprint
    • Compares with stored templates
  4. If match found:
    • Arduino receives ID number
  5. Arduino then:
    • Activates buzzer (confirmation)
    • Displays message on LCD (optional)
  6. If no match:
    • Access denied

5. Fingerprint Enrollment Code (IMPORTANT – DO THIS FIRST)

Before running the main project, you must register fingerprints into the sensor memory.

Step 1: Upload Enrollment Code

#include <Adafruit_Fingerprint.h> #include <SoftwareSerial.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> // Fingerprint Sensor SoftwareSerial mySerial(2, 3); Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial); // LCD (I2C) LiquidCrystal_I2C lcd(0x27, 16, 2); int id = 1; // Change this for each new user void setup() { Serial.begin(9600); finger.begin(57600); lcd.init(); lcd.backlight(); lcd.setCursor(0, 0); lcd.print("Enroll Finger"); if (finger.verifyPassword()) { Serial.println("Sensor ready"); lcd.setCursor(0, 1); lcd.print("Sensor Ready"); } else { Serial.println("Sensor error"); lcd.setCursor(0, 1); lcd.print("Sensor Error"); while (1); } delay(2000); lcd.clear(); } void loop() { enrollFingerprint(); } // Enrollment Function void enrollFingerprint() { lcd.clear(); lcd.setCursor(0, 0); lcd.print("Place Finger"); // Wait for finger while (finger.getImage() != FINGERPRINT_OK); finger.image2Tz(1); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Remove Finger"); delay(2000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Place Again"); // Wait again while (finger.getImage() != FINGERPRINT_OK); finger.image2Tz(2); // Create model if (finger.createModel() == FINGERPRINT_OK) { if (finger.storeModel(id) == FINGERPRINT_OK) { lcd.clear(); lcd.setCursor(0, 0); lcd.print("Stored ID:"); lcd.setCursor(0, 1); lcd.print(id); Serial.println("Stored Successfully!"); } else { lcd.clear(); lcd.print("Store Failed"); } } else { lcd.clear(); lcd.print("Error Try Again"); } delay(3000); }

Step 2: Important Instructions

  • Open Serial Monitor
  • Follow instructions:
    • Place finger
    • Remove
    • Place again
  • Fingerprint will be stored with ID

Step 3: Repeat for Multiple Users

Change:

int id = 1;

👉 Use:

  • ID 1 → Student 1
  • ID 2 → Student 2

6. Main Code (Attendance System)

#include <Adafruit_Fingerprint.h> #include <SoftwareSerial.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> #include <RTClib.h> // Fingerprint SoftwareSerial mySerial(2, 3); Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial); // LCD LiquidCrystal_I2C lcd(0x27, 16, 2); // RTC RTC_DS3231 rtc; int buzzer = 8; void setup() { Serial.begin(9600); finger.begin(57600); lcd.init(); lcd.backlight(); pinMode(buzzer, OUTPUT); if (!rtc.begin()) { lcd.print("RTC Error"); while (1); } if (!finger.verifyPassword()) { lcd.print("Sensor Error"); while (1); } lcd.print("System Ready"); delay(2000); lcd.clear(); } void loop() { lcd.setCursor(0, 0); lcd.print("Place Finger"); int id = getFingerprintID(); if (id != -1) { DateTime now = rtc.now(); lcd.clear(); lcd.setCursor(0, 0); lcd.print("ID:"); lcd.print(id); lcd.setCursor(0, 1); lcd.print(now.hour()); lcd.print(":"); lcd.print(now.minute()); Serial.print("ID:"); Serial.print(id); Serial.print(", Date:"); Serial.print(now.day()); Serial.print("/"); Serial.print(now.month()); Serial.print("/"); Serial.print(now.year()); Serial.print(", Time:"); Serial.print(now.hour()); Serial.print(":"); Serial.println(now.minute()); digitalWrite(buzzer, HIGH); delay(1000); digitalWrite(buzzer, LOW); delay(3000); lcd.clear(); } } int getFingerprintID() { if (finger.getImage() != FINGERPRINT_OK) return -1; if (finger.image2Tz() != FINGERPRINT_OK) return -1; if (finger.fingerSearch() != FINGERPRINT_OK) return -1; return finger.fingerID; }

7. Detailed Step By Step Code Working

  1. Library Used
    • Adafruit_Fingerprint.h for sensor communication
  2. Enrollment
    • Fingerprint scanned twice
    • Stored in sensor memory
  3. Recognition
    • Finger scanned
    • Compared with stored data
  4. Matching
    • If match → returns ID
  5. Action
    • Buzzer ON
    • Attendance recorded in Serial Monitor

8. Tips

  • Store up to 1000 fingerprints (sensor dependent)
  • Clean sensor surface regularly
  • Use stable power supply
  • Assign unique IDs properly
  • Add RTC for date/time logging

9. Uses

  • School attendance system
  • Office biometric system
  • Access control systems
  • Secure authentication projects

10. Conclusion

The Arduino-Based Fingerprint Attendance System using R307 is a highly secure and efficient solution. It is easy to implement and can be upgraded with database, IoT, and cloud storage.


************************************************************************************************

12. For RTC Load this code first for settings up time

#include <Wire.h>
#include <RTClib.h>

RTC_DS3231 rtc;

void setup() {
  Serial.begin(9600);

  if (!rtc.begin()) {
    Serial.println("RTC not found");
    while (1);
  }

  // Set RTC time from computer
  rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));

  Serial.println("RTC Time Set!");
}

void loop() {}



How to setup RTC: Details are given in https://simplebasicelectronics.blogspot.com/2026/04/arduino-water-reminder-bell-system.html
തുടക്കക്കാർക്കായി ഇലക്ട്രോണിക്സ് ലളിതമായി പഠിക്കാം.

Empowering students in Kerala with hands-on technical skills.