Build a Fingerprint-Scanner Door Lock with Arduino
Free Daily Electronics Newsletter
Tutorials, news, and one component explained simply — every day.
Tutorials, news, and one component explained simply — every day.
Difficulty: Beginner — Ever wished you could unlock your door like a spy in a movie? No keys to lose, no codes to remember — just press your finger and you’re in. The best part? You can build this with an Arduino, a fingerprint sensor, and a servo motor for under $30.
The Adafruit fingerprint sensor (or similar optical models) works by shining an LED onto your finger and capturing the reflected image with a tiny camera. An onboard processor analyzes the ridges and valleys of your fingerprint, converts them into a mathematical template, and stores it in flash memory. It can hold up to 127 different fingerprints.
When you place your finger on the sensor, it captures a new image, generates a template, and compares it against all stored templates. If it finds a match, it returns the matching ID. If not, it returns an error. The entire process takes less than a second.
The sensor communicates with the Arduino via UART (serial) — just two wires for data plus power and ground.
The wiring is straightforward. The fingerprint sensor has four pins:

The servo motor connects to:
Make sure your power supply can handle the servo — servos can draw significant current when moving under load. For a prototype, USB power is usually fine, but a production installation should use a separate 5V supply.
You’ll need two libraries: the Adafruit Fingerprint Sensor Library and the built-in Servo library. Install the Adafruit library through the Arduino Library Manager.
The code has two parts: an enrollment sketch (run once to register fingerprints) and the main lock sketch (runs continuously).
Enrollment — Upload the “enroll” example from the Adafruit library. Open the Serial Monitor, and it will walk you through placing your finger twice to register it. Repeat for each person who needs access.
Main lock code — The core logic is simple:
The key functions from the Adafruit library are finger.getImage(), finger.image2Tz(), and finger.fingerFastSearch(). The servo is controlled with myservo.write(90) to unlock and myservo.write(0) to lock.
Once the prototype works on a breadboard, you can make it into a real door lock:
For a more advanced version, you could add two-factor authentication by combining the fingerprint with a keypad, or use an ESP32 instead of an Arduino to add WiFi connectivity for remote monitoring and control.
The same pull-up resistor concepts apply here — make sure any status LEDs or buttons have proper pull-ups or pull-downs to avoid erratic behavior.
This project was inspired by an original video tutorial. Watch the full process:
Here are the components for this project (affiliate links):
Tutorials, news, and one component explained simply — every day.