Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
BETTESWORTHConstruction
access control

Arduino Fingerprint Door Lock Using an ESP32 and Local Web App

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can build a useful fingerprint-controlled door-lock prototype with an ESP32 running the Arduino framework, a UART fingerprint sensor, and a browser-based interface hosted on your local network. The fingerprint module performs the biometric matching; the ESP32 manages the decision, lock driver, Wi-Fi connection, and web app.

This design is appropriate for a cabinet, interior door, laboratory demonstrator, or controlled educational project. It is not automatically a production-grade access-control system. Door hardware, emergency egress, power-failure behavior, authentication, electrical protection, and local building requirements must be treated as part of the design.

As an Amazon Associate I earn from qualifying purchases.

What you will build

Fingerprint sensor -- TTL UART --> ESP32 -- Wi-Fi --> Browser
                                      |
                                      v
                              Relay or MOSFET driver
                                      |
                                      v
                         Low-voltage electric lock

The access sequence is:

  1. A user places a finger on the sensor.
  2. The sensor captures and compares the print with templates stored in its own memory.
  3. The sensor sends a match ID or failure status to the ESP32 over serial.
  4. The ESP32 validates the result and activates the lock driver for a limited period.
  5. The web app displays the current state and recent event.
  6. A non-blocking timer returns the lock to its secure state automatically.

The browser interface is for administration and optional local manual release. It does not replace the sensor’s matching function.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Parts and tools

  • A conventional ESP32-WROOM or DevKit-style development board.
  • A UART fingerprint module compatible with the Adafruit Fingerprint Sensor Library, such as a documented optical sensor.
  • A low-voltage electric strike, solenoid, cabinet lock, or electronic latch suitable for the door.
  • A logic-level MOSFET driver for a DC lock, or a correctly rated relay module.
  • A separate power supply rated for the lock’s voltage and current.
  • A flyback diode for a DC coil, plus a fuse or resettable fuse.
  • An inside exit button, status LED, optional buzzer, enclosure, terminal blocks, and strain relief.
  • USB cable, jumper wire for bench testing, and a multimeter.

Fingerprint modules that look similar can have different pinouts, voltages, baud rates, capacities, commands, and logic levels. Check the exact module datasheet before applying power. Do not assume an AS608, R305, R307, or R503-style module is electrically identical to another seller’s version.

#1 Best Overall
Sale
Apple Watch Series 11 [GPS 46mm] Smartwatch with Jet Black Aluminum Case with Black Sport Band - M/L. Sleep Score, Fitness Tracker, Health Monitoring, Always-On Display, Water Resistant
  • A FULL-FEATURED HEALTH TRACKER—Apple Watch Series 11 gives you invaluable insights about your body, right from your wrist. Take an ECG anytime* and get alerts for a high and low heart rate or an irregular rhythm*—so you can stay closer to your heart. You can also view your overnight health tracking metrics with the Vitals app* and be notified of possible sleep apnea.*
  • KNOW YOUR SLEEP SCORE—With advanced sleep tracking, Series 11 gives you a daily sleep score. It’s an easy way to help measure and understand the quality of your sleep, so you can make it more restorative.
  • GET HYPERTENSION NOTIFICATIONS—Did you know that Series 11 can spot signs of chronic high blood pressure? By analyzing how your blood vessels respond to beats of the heart, it can notify you of possible hypertension.*
  • SAFETY FEATURES—A smartwatch that puts your safety first. Series 11 can detect a hard fall or severe car crash, automatically help connect you with emergency services, and notify your emergency contacts.* Check In can automatically notify a loved one when you’ve arrived at your destination.
  • A POWERFUL FITNESS TRACKER—With advanced metrics and motivating features like Pacer, Heart Rate Zones, training load, and Workout Buddy powered by Apple Intelligence from your nearby iPhone*—Series 11 is made to help everyone stay active, from runners and hikers to strength-training enthusiasts.

Example ESP32 pin assignment

This example suits many classic ESP32 DevKit boards, but verify the pinout of your exact board:

Function ESP32 pin Note
Sensor TX to ESP32 RX GPIO16 UART2 RX
Sensor RX from ESP32 TX GPIO17 UART2 TX
Lock-driver control GPIO26 Output
Exit button GPIO27 Input with pull-up
Buzzer GPIO25 Optional
Status LED GPIO33 Optional

On classic ESP32 boards, avoid GPIO6–11, which are normally connected to flash. GPIO34–39 are input-only. Use GPIO0, GPIO2, GPIO5, GPIO12, and GPIO15 cautiously because they are boot-strapping pins. See Espressif’s DevKitC pin guidance and hardware design checklist.

Electrical design: never power the lock from an ESP32 GPIO

An ESP32 pin is a control signal, not a door-lock power source. The lock must use its own correctly sized low-voltage supply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Lock supply positive ---- lock coil ---- drain/collector of driver
                                             source/emitter ---- supply negative
ESP32 GPIO -------------- driver input
ESP32 GND --------------- supply negative, where common ground is required
Flyback diode ----------- across the DC lock coil

Place the flyback diode directly across a DC solenoid or electric-lock coil, observing polarity. Without suppression, the coil’s inductive voltage spike can reset the ESP32 or damage the switching device. A MOSFET is generally quieter and more efficient for a DC lock. A relay may be preferable where isolation or unusual load switching is required, but relay inputs are often active-low and their coil voltage, trigger level, and contact ratings vary.

Test first with an LED and resistor or another low-current dummy load. Then test the lock with the door physically unlatched. Keep lock current off the breadboard for a permanent installation, use suitable terminals and cable, and add a fuse. If the ESP32 resets when the lock activates, use separate supplies or regulation, improve suppression and wiring, and check for voltage sag.

Rank #2
Apple Watch Series 11 [GPS 42mm] Smartwatch with Rose Gold Aluminum Case with Light Blush Sport Band - S/M. Sleep Score, Fitness Tracker, Health Monitoring, Always-On Display, Water Resistant
  • A FULL-FEATURED HEALTH TRACKER—Apple Watch Series 11 gives you invaluable insights about your body, right from your wrist. Take an ECG anytime* and get alerts for a high and low heart rate or an irregular rhythm*—so you can stay closer to your heart. You can also view your overnight health tracking metrics with the Vitals app* and be notified of possible sleep apnea.*
  • KNOW YOUR SLEEP SCORE—With advanced sleep tracking, Series 11 gives you a daily sleep score. It’s an easy way to help measure and understand the quality of your sleep, so you can make it more restorative.
  • GET HYPERTENSION NOTIFICATIONS—Did you know that Series 11 can spot signs of chronic high blood pressure? By analyzing how your blood vessels respond to beats of the heart, it can notify you of possible hypertension.*
  • SAFETY FEATURES—A smartwatch that puts your safety first. Series 11 can detect a hard fall or severe car crash, automatically help connect you with emergency services, and notify your emergency contacts.* Check In can automatically notify a loved one when you’ve arrived at your destination.
  • A POWERFUL FITNESS TRACKER—With advanced metrics and motivating features like Pacer, Heart Rate Zones, training load, and Workout Buddy powered by Apple Intelligence from your nearby iPhone*—Series 11 is made to help everyone stay active, from runners and hikers to strength-training enthusiasts.

Do not connect mains voltage in this beginner project. Use a certified enclosed product and qualified installation if mains-powered equipment is involved.

Install Arduino-ESP32 and the libraries

  1. Install the Arduino IDE.
  2. In Preferences, add Espressif’s stable Boards Manager URL: https://espressif.github.io/arduino-esp32/package_esp32_index.json.
  3. Install the ESP32 board package and select your exact board.
  4. Upload a basic Blink sketch to confirm the board and USB connection.
  5. Install Adafruit Fingerprint Sensor Library through Library Manager.

Espressif’s current documentation target identifies Arduino-ESP32 Core 3.3.10, based on ESP-IDF 5.5, but board-package releases change. Check the current documentation and adapt examples if your installed version differs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Wire and test the fingerprint reader

Cross the serial lines: sensor TX goes to ESP32 RX, and sensor RX goes to ESP32 TX. Connect the sensor ground to the ESP32 ground. Provide the sensor’s specified supply voltage and verify that its TX output is safe for the ESP32 input; use a level shifter or divider if required.

The ESP32’s hardware UART is preferable to software serial. A starting point is:

#include <Adafruit_Fingerprint.h>

HardwareSerial fingerSerial(2);
Adafruit_Fingerprint finger(&fingerSerial);

void setup() {
  fingerSerial.begin(57600, SERIAL_8N1, 16, 17);
  finger.begin(57600);

  if (finger.verifyPassword()) {
    Serial.println("Fingerprint sensor found");
  } else {
    Serial.println("Fingerprint sensor not responding");
  }
}

57,600 baud is an example, not a universal value. Confirm the rate in the module documentation. The library supports initialization, password verification, parameter retrieval, enrollment, searching, and template operations; its API is documented here.

Rank #3
Apple Watch SE 3 [GPS 40mm] Smartwatch with Starlight Aluminum Case with Starlight Sport Band - S/M. Fitness and Sleep Trackers, Heart Rate Monitor, Always-On Display, Water Resistant
  • GET SMARTER HEALTH INSIGHTS—Apple Watch SE 3 is an advanced health tracker that helps you better understand your body. The smartwatch sends alerts for an irregular heart rhythm, or an unusually high or low heart rate.* You can view your overnight health tracking metrics with the Vitals app,* track your sleep score, and get sleep apnea notifications.*
  • A GREAT FITNESS TRACKER—SE 3 can track your workouts in a healthy number of ways—from running and strength training to simply achieving your 10K steps a day. With real-time metrics and Workout Buddy powered by Apple Intelligence from your nearby iPhone,* you’ll hit your goals like never before.
  • KEEP HELP CLOSE AT HAND—SE 3 is a smartwatch that can detect a hard fall or severe car crash and automatically help connect you to emergency services and notify your emergency contacts.* Check In can automatically notify a loved one when you’ve arrived at your destination.
  • WOMEN’S HEALTH INSIGHTS—SE 3 has advanced sensors that track your wrist temperature while you sleep. With this smartwatch, you can log your periods and symptoms, get period predictions, and get notified of cycle deviations.*
  • GREAT BATTERY LIFE AND FASTER CHARGING—Enjoy a smartwatch with all-day, 18-hour battery life* from sunup to sundown. Then charge up to twice as fast as SE 2* and get up to 8 hours of battery in just 15 minutes.*

Enroll fingerprints before testing the lock

Start with the library’s enrollment example. Adafruit’s documented path is File → Examples → Adafruit_Fingerprint → enroll.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Adapt the example to your ESP32 hardware UART and pins.
  2. Upload it and open Serial Monitor at the sketch’s configured baud rate.
  3. Choose an unused numeric ID.
  4. Place the same finger when prompted.
  5. Remove and replace it as requested.
  6. Confirm that the template is stored.
  7. Run a search test with the enrolled and an unknown finger.

For a web-admin version, provide an authenticated enrollment workflow, one-template deletion, and a separately confirmed “clear all” operation. Maintain a display mapping such as ID 3 = Alex in ESP32 storage, while the biometric template remains in the sensor. Do not store raw fingerprint images on the ESP32. Capacity depends on the exact module and must not be generalized.

Firmware architecture

Keep fingerprint servicing, HTTP handling, button monitoring, Wi-Fi recovery, and lock timing responsive. Avoid a long delay() after unlocking.

enum LockState {
  LOCKED,
  UNLOCKED_TEMPORARILY,
  SENSOR_ERROR,
  WIFI_DISCONNECTED
};

const uint8_t LOCK_PIN = 26;
const unsigned long UNLOCK_MS = 5000;
bool unlocked = false;
unsigned long unlockStarted = 0;

void unlockTemporarily() {
  digitalWrite(LOCK_PIN, HIGH); // invert for an active-LOW relay
  unlocked = true;
  unlockStarted = millis();
}

void serviceLockTimer() {
  if (unlocked && millis() - unlockStarted >= UNLOCK_MS) {
    digitalWrite(LOCK_PIN, LOW);
    unlocked = false;
  }
}

Useful firmware modules include connectWiFi(), serviceFingerprint(), serviceLockTimer(), serviceExitButton(), handleWebRequests(), loadConfiguration(), saveConfiguration(), and auditEvent(). Use Preferences or another nonvolatile store for unlock duration, relay polarity, display names, and other non-sensitive settings. If storing an administrator password, store a suitable hash rather than plaintext.

Local Wi-Fi and the web app

Use local-LAN station mode for the main build. The ESP32 joins an existing router and the browser connects directly to its IP address:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Apple Watch SE 3 [GPS 40mm] Smartwatch with Midnight Aluminum Case with Midnight Sport Band - S/M. Fitness and Sleep Trackers, Heart Rate Monitor, Always-On Display, Water Resistant
  • GET SMARTER HEALTH INSIGHTS—Apple Watch SE 3 is an advanced health tracker that helps you better understand your body. The smartwatch sends alerts for an irregular heart rhythm, or an unusually high or low heart rate.* You can view your overnight health tracking metrics with the Vitals app,* track your sleep score, and get sleep apnea notifications.*
  • A GREAT FITNESS TRACKER—SE 3 can track your workouts in a healthy number of ways—from running and strength training to simply achieving your 10K steps a day. With real-time metrics and Workout Buddy powered by Apple Intelligence from your nearby iPhone,* you’ll hit your goals like never before.
  • KEEP HELP CLOSE AT HAND—SE 3 is a smartwatch that can detect a hard fall or severe car crash and automatically help connect you to emergency services and notify your emergency contacts.* Check In can automatically notify a loved one when you’ve arrived at your destination.
  • WOMEN’S HEALTH INSIGHTS—SE 3 has advanced sensors that track your wrist temperature while you sleep. With this smartwatch, you can log your periods and symptoms, get period predictions, and get notified of cycle deviations.*
  • GREAT BATTERY LIFE AND FASTER CHARGING—Enjoy a smartwatch with all-day, 18-hour battery life* from sunup to sundown. Then charge up to twice as fast as SE 2* and get up to 8 hours of battery in just 15 minutes.*
#include <WiFi.h>

WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
  delay(250);
}
Serial.println(WiFi.localIP());

A local app needs no cloud account and continues working without internet access if the local Wi-Fi network remains available. If there is no router, the ESP32 can run SoftAP mode and serve the site directly; Espressif documents both station and access-point modes.

For a small project, the built-in WebServer class is sufficient:

#include <WebServer.h>
WebServer server(80);

void setupRoutes() {
  server.on("/api/status", HTTP_GET, []() {
    server.send(200, "application/json",
                "{"locked":true,"sensor":"online"}");
  });

  server.on("/api/unlock", HTTP_POST, []() {
    if (!isAuthenticated()) {
      server.send(401, "application/json", "{"error":"unauthorized"}");
      return;
    }
    unlockTemporarily();
    server.send(200, "application/json", "{"ok":true}");
  });

  server.begin();
}

For a larger interface, store separate HTML, CSS, and JavaScript files in LittleFS. A filesystem web-server library is optional; the esp-fs-webserver documentation lists version 3.3.0, but it may be unnecessary for a focused build.

Recommended pages and endpoints

  • Dashboard: lock state, Wi-Fi state, sensor availability, last event, last ID, and remaining unlock time.
  • Fingerprint administration: enroll, name, delete one ID, view occupied IDs, and clear all templates after confirmation.
  • Settings: unlock duration, relay polarity, hostname or IP display, and password change.
  • Event log: uptime or timestamp, event type, ID, result, source, and failure reason.
GET  /api/status
POST /api/unlock
POST /api/enroll
POST /api/delete
POST /api/clear
GET  /api/events
POST /api/login
POST /api/logout

Poll /api/status periodically, or use server-sent events for live updates. Report failures clearly, such as “sensor unavailable,” “unknown finger,” or “lock supply fault,” rather than leaving the page stale.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Authentication and safety

An interface on a home network is not automatically secure. Do not publish an unauthenticated endpoint such as GET /unlock. At minimum, require authentication, use POST for state-changing actions, rate-limit failed logins, validate and limit request sizes, and add CSRF protection when cookies are used. Never put administrator credentials in client-side JavaScript.

Best Value
Apple Watch Series 11 [GPS 42mm] Smartwatch with Jet Black Aluminum Case with Black Sport Band - S/M. Sleep Score, Fitness Tracker, Health Monitoring, Always-On Display, Water Resistant
  • A FULL-FEATURED HEALTH TRACKER—Apple Watch Series 11 gives you invaluable insights about your body, right from your wrist. Take an ECG anytime* and get alerts for a high and low heart rate or an irregular rhythm*—so you can stay closer to your heart. You can also view your overnight health tracking metrics with the Vitals app* and be notified of possible sleep apnea.*
  • KNOW YOUR SLEEP SCORE—With advanced sleep tracking, Series 11 gives you a daily sleep score. It’s an easy way to help measure and understand the quality of your sleep, so you can make it more restorative.
  • GET HYPERTENSION NOTIFICATIONS—Did you know that Series 11 can spot signs of chronic high blood pressure? By analyzing how your blood vessels respond to beats of the heart, it can notify you of possible hypertension.*
  • SAFETY FEATURES—A smartwatch that puts your safety first. Series 11 can detect a hard fall or severe car crash, automatically help connect you with emergency services, and notify your emergency contacts.* Check In can automatically notify a loved one when you’ve arrived at your destination.
  • A POWERFUL FITNESS TRACKER—With advanced metrics and motivating features like Pacer, Heart Rate Zones, training load, and Workout Buddy powered by Apple Intelligence from your nearby iPhone*—Series 11 is made to help everyone stay active, from runners and hikers to strength-training enthusiasts.

Do not port-forward the ESP32 directly to the public internet. HTTP on a trusted LAN is not equivalent to HTTPS, and any compromised device on that network may be able to attack the interface. If remote access is essential, use a properly secured gateway or VPN rather than exposing the microcontroller directly. A cloud design can add notifications and remote dashboards, but also adds internet dependency, accounts, tokens, third-party risk, and attack surface. Adafruit’s documented networked lock project is useful background, but it uses an Arduino/ESP8266 split architecture and is not a drop-in ESP32 implementation: reference project.

Fingerprint matching is not equivalent to cryptographic identity. Low-cost optical readers can reject legitimate users because of wet, dirty, dry, or injured fingers and may be vulnerable to presentation attacks. A PIN, NFC credential, or physical key provides a useful second factor. Never rely on this prototype as the sole security mechanism for a high-value property without professional assessment and suitable certified hardware.

Fail-safe, fail-secure, and physical release

  • Fail-secure: the lock remains locked when power fails. This may improve security but can create an egress hazard.
  • Fail-safe: the lock releases when power fails. This may support emergency egress but can be unsuitable for some security requirements.

The correct choice depends on the lock, building use, fire-egress requirements, local regulations, and risk model. Provide a physical inside exit mechanism and mechanical key override. Confirm that the lock is appropriate for the door, frame, weather exposure, holding force, duty cycle, and continuous or pulsed operation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build and test sequence

  1. Software: install Arduino-ESP32, upload Blink, and install the fingerprint library.
  2. Sensor: verify power, cross TX/RX, confirm baud rate, call verifyPassword(), enroll a finger, and perform a search test.
  3. Driver: test the output with an LED, confirm active-high or active-low behavior, and verify that startup leaves the lock in its intended state.
  4. Lock circuit: add the separate supply, driver, diode, and fuse. Test with the door unlatched.
  5. Wi-Fi: connect in station mode, print WiFi.localIP(), and open that address in a browser.
  6. Web app: add status reporting, authenticated manual unlock, automatic relock, fingerprint events, and administration.
  7. Installation: use an enclosure, proper terminals, strain relief, manual release, and mechanically secure mounting.

Failure-testing checklist

Test Expected behavior
Unknown finger Remain locked and record a denial.
Sensor unplugged Show sensor error; never unlock.
Wi-Fi unavailable at boot Lock control and local recovery remain safe; firmware continues retrying.
Wi-Fi lost after boot Fingerprint and physical exit remain independent of the web page.
ESP32 reset while unlocked Output returns to the defined safe state.
Lock activates No brownout, repeated reset, or false trigger.
Browser closes during command One bounded lock cycle, not an indefinite unlock.
Duplicate POST requests State remains controlled and time-limited.
Exit button during unlock Behavior is explicitly defined and safe.
Power restoration System starts locked unless the chosen hardware requires another behavior.

Troubleshooting

Symptom Likely cause and recovery
Sensor never responds TX/RX reversed, wrong baud, incorrect voltage, or missing ground. Check the datasheet and test verifyPassword().
ESP32 resets when the lock activates Supply sag or inductive noise. Separate supplies, add flyback protection, improve grounding, and check current.
Relay activates on boot Active-low input or a boot-sensitive GPIO. Choose a safer pin and force a known output state early.
Board will not upload A driver is holding a strapping pin at the wrong level. Disconnect it during upload or move the signal.
Web page works but lock does not Driver polarity or lock-power wiring is wrong. Test the output with an LED first.
Unlock never ends A blocking delay or timer error is preventing relock. Use one lock-state owner and millis().
Status is stale Add polling or a push-update mechanism for /api/status.
Bench works but door fails Check mechanical alignment, current draw, cable losses, supply capacity, and environmental conditions.

Useful upgrades

  • Add PIN or NFC as a second factor.
  • Use a weather-rated reader for exposed locations.
  • Add a gateway or VPN rather than exposing the ESP32 for remote access.
  • Use PlatformIO for dependency pinning and structured builds.
  • Add a watchdog, persistent event storage, battery backup, and supervised lock-power monitoring.
  • Choose professional access-control hardware or a certified smart lock where life safety, insurance, or high-value security is involved.

The ESP32 is a strong controller for a prototype because it combines Wi-Fi, hardware UARTs, GPIO, and sufficient memory for a small HTTP interface. The hardware and software still need to be selected and tested as one system; a fingerprint module, relay, and lock are not interchangeable accessories.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.