Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Build a Wi-Fi Fingerprint Sensor for Home Assistant

· 6 min read · Home Networking

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

This guide shows you how to build a Wi-Fi connected fingerprint sensor that works with Home Assistant, letting you lock/unlock doors, trigger automations, or arm/disarm your alarm with a touch. You'll use an ESP32 board, an optical fingerprint sensor module, and the open-source ESPHome firmware—no coding required beyond copying a config. The sensor appears as a binary sensor in Home Assistant, and you can map each fingerprint to a different action.

What You'll Need

  • ESP32 development board (any with Wi-Fi, e.g., ESP32 DevKit V1)
  • Fingerprint sensor module (R307 or R503 are common; both use a 6-pin UART interface)
  • Jumper wires (female-to-female and female-to-male)
  • Breadboard (optional, for prototyping)
  • 5V power supply for the sensor (the ESP32's 3.3V may not power it reliably; use a USB 5V source or a separate regulator)
  • USB cable for programming the ESP32
  • Home Assistant instance (with ESPHome add-on or standalone ESPHome installation)

Step-by-Step

  1. Wire the hardware. Connect the fingerprint sensor to the ESP32 as follows: sensor VCC to ESP32 5V (or external 5V), GND to GND, TX to ESP32 GPIO16 (RX2), RX to ESP32 GPIO17 (TX2). If your sensor has a touch detection pin (like the R503's TOUCH), connect it to a free GPIO (e.g., GPIO4) for optional presence detection. Double-check your sensor's pinout—labels vary by model.
  2. Install ESPHome. In Home Assistant, go to Settings > Add-ons, search for ESPHome, and install it. If you're using standalone ESPHome, install it on your computer via pip or Docker.
  3. Create a new ESPHome device. In the ESPHome add-on, click “New Device,” give it a name (e.g., “fingerprint_sensor”), and select your ESP32 board. It will generate a basic YAML config.
  4. Edit the configuration. Open the device's YAML file and replace the contents with the following minimal config. Adjust the platform to match your board (esp32 or esp8266—but ESP32 is recommended for UART2).
  5. Add the fingerprint sensor component. In the YAML, add a uart: section for the sensor (baud rate 57600, pins TX/RX as wired), then a fingerprint_grow: component (the standard for most optical sensors). Example:
  6. Define a binary sensor for each fingerprint. Inside fingerprint_grow:, add a binary_sensor: entry for each fingerprint ID you want to use, e.g., id: finger1, name: "Finger 1". This creates a binary sensor that turns on when that specific finger is recognized.
  7. Upload the firmware. Click “Install” in ESPHome and choose “Plug into this computer” (or “Manual download” if using a different machine). The firmware will compile and flash to the ESP32 via USB.
  8. Add the device to Home Assistant. Once flashed, the ESP32 automatically connects to your Wi-Fi (configured in the ESPHome setup wizard). In Home Assistant, go to Settings > Devices & Services > Add Integration > ESPHome, and enter the device's IP address or hostname. The fingerprint sensors will appear as binary sensors.
  9. Enroll fingerprints. Use the ESPHome logs to enroll fingerprints. In the ESPHome dashboard, click “Logs” on your device. Then send a command via the ESPHome API (or use a simple web server) to enter enrollment mode. The typical command is fingerprint_enroll with an ID number. Follow the log prompts: place your finger on the sensor twice. Repeat for each finger you want to register.
  10. Test the sensor. Touch a registered finger to the sensor. The corresponding binary sensor in Home Assistant should turn on for a few seconds (configurable). If not, check the logs for errors.
  11. Create automations. In Home Assistant, go to Settings > Automations & Scenes > Create Automation. Trigger on the binary sensor turning on, then perform your desired action (e.g., unlock a smart lock via a service call, send a notification, or toggle a light).

Common Mistakes

  • Using the wrong UART pins: many ESP32 boards have multiple UARTs; ensure you're using the correct RX/TX pins for the second UART (GPIO16/17 are typical).
  • Powering the sensor from the ESP32's 3.3V pin—most fingerprint sensors need 5V and may fail or be unstable.
  • Forgetting to set the baud rate to 57600 in the UART config; the default is 9600.
  • Not connecting a common ground between the sensor and the ESP32.
  • Using an ESP8266 board—it has only one UART and may conflict with the serial console.

Tips

  • Use a separate 5V power supply (like a USB wall adapter) for the sensor, and connect the grounds together.
  • Add a switch: in ESPHome to trigger enrollment remotely via a Home Assistant service call, making it easier to add new fingers without re-flashing.
  • Set the sensor's fingerprint_grow sensing_pin to a GPIO if your sensor has a touch output—this can be used as a presence sensor.
  • Test the sensor with a simple script (like a Python serial test) before integrating with Home Assistant to isolate hardware issues.
  • If you have multiple sensors, give each a unique name in ESPHome to avoid conflicts.

Troubleshooting

  1. No response from the sensor. Check power (5V) and ground connections. Verify the TX/RX wiring is correct (TX to RX, RX to TX). Check the baud rate in the UART config.
  2. Sensor responds but fingerprint not recognized. Re-enroll the finger, ensuring you lift and re-place the finger cleanly. Clean the sensor surface with a soft cloth.
  3. Binary sensor doesn't appear in Home Assistant. Check that the ESPHome device is online (see the ESPHome dashboard). If it's offline, re-flash the firmware and check Wi-Fi credentials.
  4. ESP32 keeps rebooting. This often indicates a power issue—use a stable 5V supply for the sensor and a separate USB power for the ESP32.
  5. Logs show “UART read error”. Verify the UART pins are correct and not used by other peripherals. Try swapping TX/RX.
  6. Fingerprint sensor works but automations don't fire. Check the automation trigger: make sure the binary sensor is set to “turns on” and the entity ID is correct. Test the automation manually.

Frequently Asked Questions

Can I use a capacitive fingerprint sensor instead?

Yes, but the wiring and protocol differ. Capacitive sensors (like the R503) also use UART but may have different commands. ESPHome's fingerprint_grow component supports both optical and capacitive Grow sensors; check your sensor's datasheet for pinout.

How many fingerprints can I store?

Most Grow modules store up to 200 fingerprints, but this varies by model. The ESPHome component uses the sensor's internal storage, so the limit is hardware-defined.

Can I use this to unlock a smart lock directly?

Yes, by creating an automation in Home Assistant that calls the lock's unlock service when the fingerprint binary sensor turns on. Ensure your smart lock is integrated with Home Assistant first.

Do I need to re-flash the ESP32 to add a new fingerprint?

No. You can trigger enrollment via the ESPHome API or a custom service call without re-flashing. The simplest way is to use the ESPHome logs and send a command via the API (e.g., using a REST call or a script).

Is this secure enough for a door lock?

Fingerprint sensors are convenient but not as secure as a strong PIN or key. The sensor only sends a match/no-match signal over Wi-Fi, which could be intercepted. For high-security applications, consider using a local, wired connection or combining with a PIN.

Can I use multiple fingerprint sensors in one Home Assistant setup?

Yes, you can flash multiple ESP32s with the same config (changing the device name) and add each as a separate ESPHome device. They will appear as separate binary sensors.