Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino UNO-Based Fingerprint-Activated Door Lock System with LCD Display

Image of Arduino UNO-Based Fingerprint-Activated Door Lock System with LCD Display

Circuit Documentation

Summary

This circuit is a fingerprint-based door lock system. It uses an Arduino UNO microcontroller to control a 12V solenoid lock, an LCD display for user feedback, and a fingerprint scanner for authentication. The system also includes LEDs to indicate the status of the door (locked or unlocked) and a buzzer for audio feedback.

Component List

  1. Arduino UNO

    • Description: Microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. 12V Solenoid Lock

    • Description: Electromechanical lock that operates on 12V.
    • Pins: -, +
  3. LCD Display 16x2

    • Description: 16x2 character LCD display.
    • Pins: LEDK, LEDA, DB7, DB6, DB5, DB4, DB3, DB2, DB1, DB0, E, RW, RS, VO, VDD, VSS
  4. Potentiometer

    • Description: Variable resistor used to adjust the contrast of the LCD.
    • Pins: GND, Output, VCC
  5. LED: Two Pin (red)

    • Description: Red LED.
    • Pins: cathode, anode
  6. 12V Power Supply

    • Description: Power supply providing 12V.
    • Pins: +, -
  7. 12V Relay

    • Description: Relay module for switching the solenoid lock.
    • Pins: NO, COM, NC, IN, DC-, DC+
  8. LED: Two Pin (green)

    • Description: Green LED.
    • Pins: cathode, anode
  9. Resistor (200 Ohms)

    • Description: Resistor with a resistance of 200 Ohms.
    • Pins: pin1, pin2
  10. Battery AAx3 4.5V

    • Description: Battery pack providing 4.5V.
    • Pins: VCC, GND
  11. 2.1mm Barrel Jack with Terminal Block

    • Description: Barrel jack for connecting the power supply.
    • Pins: POS, NEG
  12. Fingerprint Scanner

    • Description: Fingerprint sensor for user authentication.
    • Pins: VCC, TX, RX, GND

Wiring Details

Arduino UNO

  • 5V: Connected to LEDA and VDD of LCD Display 16x2, and VCC of Fingerprint Scanner.
  • GND: Connected to LEDK, RW, and VSS of LCD Display 16x2, pin2 of both Resistors, and GND of Fingerprint Scanner.
  • D5: Connected to anode of Red LED.
  • D6: Connected to anode of Green LED.
  • D12: Connected to E of LCD Display 16x2.
  • D11: Connected to DB4 of LCD Display 16x2.
  • D10: Connected to RS of LCD Display 16x2.
  • D9: Connected to DB5 of LCD Display 16x2.
  • D8: Connected to DB6 of LCD Display 16x2.
  • D7: Connected to DB7 of LCD Display 16x2.
  • D4: Connected to IN of 12V Relay.
  • D3: Connected to RX of Fingerprint Scanner.
  • D2: Connected to TX of Fingerprint Scanner.

12V Solenoid Lock

  • -: Connected to DC- of 12V Relay.
  • +: Connected to COM of 12V Relay.

LCD Display 16x2

  • LEDA: Connected to 5V of Arduino UNO.
  • LEDK: Connected to GND of Arduino UNO.
  • DB7: Connected to D7 of Arduino UNO.
  • DB6: Connected to D8 of Arduino UNO.
  • DB5: Connected to D9 of Arduino UNO.
  • DB4: Connected to D11 of Arduino UNO.
  • E: Connected to D12 of Arduino UNO.
  • RW: Connected to GND of Arduino UNO.
  • RS: Connected to D10 of Arduino UNO.
  • VO: Connected to Output of Potentiometer.
  • VDD: Connected to 5V of Arduino UNO.
  • VSS: Connected to GND of Arduino UNO.

Potentiometer

  • VCC: Connected to 5V.
  • GND: Connected to GND.
  • Output: Connected to VO of LCD Display 16x2.

LED: Two Pin (red)

  • anode: Connected to D5 of Arduino UNO.
  • cathode: Connected to pin1 of Resistor.

LED: Two Pin (green)

  • anode: Connected to D6 of Arduino UNO.
  • cathode: Connected to pin1 of Resistor.

12V Power Supply

  • -: Connected to DC- of 12V Relay.
  • +: Connected to NO and DC+ of 12V Relay.

12V Relay

  • IN: Connected to D4 of Arduino UNO.
  • DC-: Connected to - of 12V Power Supply.
  • DC+: Connected to + of 12V Power Supply.
  • COM: Connected to + of 12V Solenoid Lock.
  • NO: Connected to + of 12V Power Supply.

Resistor (200 Ohms)

  • pin1: Connected to cathode of Red LED.
  • pin2: Connected to GND of Arduino UNO.

Resistor (200 Ohms)

  • pin1: Connected to cathode of Green LED.
  • pin2: Connected to GND of Arduino UNO.

Battery AAx3 4.5V

  • VCC: Connected to POS of 2.1mm Barrel Jack with Terminal Block.
  • GND: Connected to NEG of 2.1mm Barrel Jack with Terminal Block.

2.1mm Barrel Jack with Terminal Block

  • POS: Connected to VCC of Battery AAx3 4.5V.
  • NEG: Connected to GND of Battery AAx3 4.5V.

Fingerprint Scanner

  • VCC: Connected to 5V of Arduino UNO.
  • TX: Connected to D2 of Arduino UNO.
  • RX: Connected to D3 of Arduino UNO.
  • GND: Connected to GND of Arduino UNO.

Code Documentation

#include <Adafruit_Fingerprint.h>
#include <LiquidCrystal.h>

// Pin Definitions
const int relayPin = 2;
const int redLEDPin = 3;
const int greenLEDPin = 4;
const int buzzerPin = 11;

// LCD Pins
LiquidCrystal lcd(10, 9, 8, 7, 6, 5);

// Fingerprint Sensor Pins
SoftwareSerial mySerial(12, 13); // RX, TX
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

void setup() {
  // Initialize Serial Monitor
  Serial.begin(9600);
  
  // Initialize LCD
  lcd.begin(16, 2);
  lcd.clear();
  
  // Initialize Fingerprint Sensor
  finger.begin(57600);
  if (finger.verifyPassword()) {
    Serial.println("Fingerprint sensor detected.");
    lcd.print("Fingerprint ready");
    delay(2000);
  } else {
    Serial.println("Fingerprint sensor not detected.");
    lcd.print("Sensor failure");
    while (1);
  }
  
  // Set Pin Modes
  pinMode(relayPin, OUTPUT);
  pinMode(redLEDPin, OUTPUT);
  pinMode(greenLEDPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
  
  // Lock the door initially
  lockDoor();
}

void loop() {
  int fingerprintID = getFingerprintID();
  
  if (fingerprintID >= 0) {
    // Fingerprint recognized
    lcd.clear();
    lcd.print("FINGERPRINT");
    lcd.setCursor(0, 1);
    lcd.print("RECOGNISED");
    delay(5000);
    unlockDoor();
  } else {
    // Fingerprint not recognized
    lcd.clear();
    lcd.print("FINGERPRINT");
    lcd.setCursor(0, 1);
    lcd.print("NOT RECOGNISED");
    delay(5000);
    lockDoor();
  }
}

// Unlock the door
void unlockDoor() {
  digitalWrite(relayPin, HIGH);
  lcd.clear();
  lcd.print("DOOR OPEN");
  
  // Activate the buzzer and green LED
  digitalWrite(greenLEDPin, HIGH);
  tone(buzzerPin, 1000); // 100