This simple fingerprint door unlock project using Arduino can be very useful for door security, forensics, crime investigation, personal identification, attendance system and much more. In the future, there could be many more applications like fingerprint based driving licences, bank accounts operation and so on.
The whole system works under a simple algorithm called matching algorithm, which is used to compare previously-stored templates of fingerprints against users’ fingerprints for authentication purposes.
A key is normally used for traditional door opening, but it provides very poor security. In this fingerprint door unlock project, only when an authorized person places a finger on the sensor, the door unlocks and the LCD displays a welcome message along with that person’s name.
Circuit and working
The circuit shown in Fig. 1 operates using a 12V power supply. An Arduino microcontroller (MCU) requires only 5V but the solenoid electric lock requires 12V. As Arduino Uno has an inbuilt 5V voltage regulator, a common 12V supply can be used for the whole system.
The brain of the circuit is Arduino Uno MCU board (BOARD1). It is based on ATmega328/ATmega328P and has 14 digital input/output (I/O) pins, six analogue inputs, 32k flash memory, 16MHz crystal oscillator, a USB connection, power jack, ICSP header and reset button, among others. It can be programmed using Arduino IDE software.
An electronic door-lock solenoid (connected across connector CON3) is basically an electromagnet made of a big coil of copper wire with an armature (slug of metal) in the middle. When the coil is energised, the slug is pulled into the centre of the coil. This allows the solenoid to move to one end.
The solenoid lock requires more current than what Arduino can provide. Therefore to operate the lock, a 5V relay (RL1) is used. CON3 is connected between normally open (N/O) contacts of RL1 and GND. The sequence of messages on the LCD from author’s prototype are shown in Figs 2, 3 and 4.
Programs named enroll and fingerprint use different functions like getFingerprintEnroll(int,id), Adafruit_Fingerprint(&mySerial) and getFingerprintEnroll(id). These functions are defined inside the library and pass arguments when called.
After uploading enroll in the Arduino, open serial monitor from Arduino IDE from Tools→Serial monitor options. Change baud rate below the serial monitor window to 38400. Choose Newline option from the same place. Then, follow the instructions on the serial monitor. Place the finger on the fingerprint module. Type any whole number as the ID number. Press Send tab to send the ID number from the serial monitor to Arduino. This fingerprint gets converted into digital data and gets store inside R305 module database.
More than 200 fingerprints can be stored on this system. Make sure that each fingerprint has a unique ID number. This ID number will be used in the next program to identify the authenticated person’s name. The serial monitor will guide the user as to when he or she should place the finger and when to remove it.
For debugging without an LCD display, make the same settings for the serial monitor after uploading Fingerprint program. This is used to compare the fingerprint in the sensor with stored prints. The serial monitor guides here also. The fingerprint program should be edited to change the name and ID numbers according to how users want.
Download source code: click here
Construction and testing
The single-side PCB for the fingerprint door unlock system is shown in Fig. 5 and it’s component layout in Fig. 6. For convenience, we have designed the PCB as an Arduino shield. The users can modify the design as per requirement. Also, they can test PCB with Arduino board using a cable connector.
Download PCB and component layout PDFs: click here
Make sure the baud rate given in the program is correct. Baud rate for the serial monitor can be anything but the baud rate for R305 sensor should match that given in its datasheet. Baud rate may vary with different versions of the sensor. It is given in the program like Serial.begin(38400) [baud rate for serial monitor]; finger.begin(57600) [baud rate for sensor]. Reset Arduino board before validation of the fingerprint.
Dinu D. and Cinla K. Pappachan are fourth-year BE (ECE) students at Mar Ephraem College of Engineering and Technology, Tamil Nadu. They are also electronics hobbyists