🚘 Garage Fingerprint Sensor

You can use a breadboard but you can also just solder them to the board. I soldered them to the board because it’s a long term solution.

I use a nodemcu esp8266 board from aliexpress.

I wrote in the post which colors you need to connect to which wire.

Okay, having just received the ‘proper’ R503 device today, I connected it to my LOLIN D1 mini, and ESPHome is happily reporting the device online. :slight_smile: All fine and dandy EXCEPT I cannot for the life of me call the service esphome.fingerscan_enroll data: { finger_id: 0, num_scans: 2 } successfully. The Developer Tools / Services screen quickly displays this error message:

Failed to call service esphome.fingerscan_enroll. Unable to find service esphome.fingerscan_enroll

The ESPhome fingerscan.yaml file contents:

esphome:
  name: fingerscan
  platform: esp8266
  board: d1_mini

# Enable logging
logger:
  level: DEBUG

# Enable Home Assistant API
api:
  password: "nonono"

# Enable over-the-air updates
ota:
  password: "nonono"

wifi:
  fast_connect: false
  power_save_mode: NONE
  domain:          .local
  use_address:     fingerscan.local
  reboot_timeout:  5min
  networks:
    ssid: "SuperSecretSSID"
    password: "SuperSecretPW"

#
# setup UART after WIFI
#
uart:
  baud_rate: 57600
  tx_pin: D2
  rx_pin: D1


# Declare Grow Fingerprint Reader
fingerprint_grow:
  password: 0x00
  sensing_pin: D3

#
# Fingerprint matched - open/close the door
#
  on_finger_scan_matched:
    - switch.turn_on: garage_door
    - fingerprint_grow.aura_led_control:
        state: BREATHING
        speed: 200
        color: PURPLE
        count: 2
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Authorized finger"
#
# Fingerprint not matched - FLASH RED
#
  on_finger_scan_unmatched:
    - fingerprint_grow.aura_led_control:
        state: FLASHING
        speed: 25
        color: RED
        count: 4
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Unauthorized finger"
#
# Enrollment scan - FLASH BLUE, then SOLID PURPLE
#
  on_enrollment_scan:
    - fingerprint_grow.aura_led_control:
        state: FLASHING
        speed: 25
        color: BLUE
        count: 2
    - fingerprint_grow.aura_led_control:
        state: ALWAYS_ON
        speed: 0
        color: PURPLE
        count: 0
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Finger scanned"
#
# Enrollment complete - BREATHE PURPLE
#
  on_enrollment_done:
    - fingerprint_grow.aura_led_control:
        state: BREATHING
        speed: 100
        color: PURPLE
        count: 2
    - fingerprint_grow.aura_led_control:
        state: FLASHING
        speed: 25
        color: BLUE
        count: 2
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Enrolled fingerprint"
#
# Enrollment failed - FLASH RED FOUR TIMES
#
  on_enrollment_failed:
    - fingerprint_grow.aura_led_control:
        state: FLASHING
        speed: 25
        color: RED
        count: 4
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Failed to enroll fingerprint"


#
# Optional template text sensor for visual feedback
#
text_sensor:
  - platform: template
    id: fingerprint_state
    name: "Fingerprint State"

#
# Optional component (GPIO switch, lock etc.) to control in on_finger_scan_matched trigger
#
switch:
  - platform: gpio
    pin: D5
    id: garage_door

#
# Optional sensors
#
binary_sensor:
  - platform: fingerprint_grow
    id: fingerprint_enrolling
    name: "Fingerprint Enrolling"

sensor:
  - platform: fingerprint_grow
  
    fingerprint_count:
      name: "Fingerprint Count"
      
    last_finger_id:
      name: "Fingerprint Last Finger ID"
      
    last_confidence:
      name: "Fingerprint Last Confidence"
      
    status:
      name: "Fingerprint Status"
      
    capacity:
      name: "Fingerprint Capacity"
      
    security_level:
      name: "Fingerprint Security Level"

Kinda feel like the GEICO gecko when he had a flat tire. :frowning:

The AS608 uses the same SynoChip integrated circuit, but apparently draws more current than the R503. It also appears to be heavily counterfeited, judging from the quality of the chip etching. I was never able to get one of them to talk properly. It validates the password, and provides other status values via the ESPHome driver, but I never found the service in Home Assistant.

Now that I have the R503, I still can’t find the service. :frowning:

You’re missing something under the api:in the esphome yaml.

1 Like

DOH! :woozy_face:

Okay, now that THAT stupid omission has been corrected, I can call the service, and the ESP8266 logs the service call. But the LED ring isn’t lighting up, at all. This leads me to believe I’ve wired something wrong. Here’s what I’ve got:

R503 Color         ESP8266
Red                3V3 Power
Black              Ground
Yellow             D1 / RXD
Tan/Brown          D2 / TXD
White              3V3 power
Blue               D3 / Touch

I’m fairly certain D1 and D2 are correct, because the default 0x00 password value is being validated, and the R503 is returning all sensor values. Where I’m not so certain are the White and Blue wires. Think I’m going to switch those and see if I get any lights. Nope, no LED ring illumination at all. I sent e-mail to [email protected] asking for help.

There is a decent datasheet available here.

1 Like

Did you try changing the sensing pin from D3, you never know.

Yup, tried D5 instead, no difference. Tried placing white wire on 5V point, still no lights. Tried swapping white and blue, still no lights. Thanks for the suggestion.

The sensing pin should not affect the start of an enrollment. What does the fingerprint state entity say when you call the enrollment service?

Does the led blink red when you put your unenrolled finger on the sensor? What if you remove the sensing pin? (It will continuously scan for fingers then)

Nope, the LEDs don’t light AT ALL. Not when trying to scan a fingerprint for the enroll service, not when trying to validate a fingerprint. Just don’t light at all. Let me try again while watching the text sensor state.

RXD and TXD are sometimes in use (especially if you have the board connected via USB). I’ve found that using software serial is more stable.
The white and blue wires shouldn’t affect behavior - it’s just an optimization, and you can leave them disconnected during testing.

Today I received the Item 4651 R503 fingerprint sensor from Adafruit and surprise, no brown wire, and all wires match colors with the PDF. Being wary of soldering to these wires again (I don’t believe this was the problem with the AliExpress sensor, but you just never know) I went looking for the JST-style connector needed. There is a discussion thread at the Adafruit forum that shows this.

The cable connector is an MX1.0–6P.

DigiKey has the socket to mate with the connector

Digikey name: CONN HEADER SMD 6POS 1MM
Googling “6-pin Molex-style 1mm pitch connector 1734595-6” is how to find it.

1 Like

Hope it will work for you now. You could also use a female ethernet connector if you plan to use an ethernet cable.

1 Like

First things first. I wired it up as carefully and nicely as possible this morning. Then HomeAssistant would not “recognize” the ESPHome device as a new entity. :confounded: I had to clean up files in the homeassistant/.storage directory, and restart HA twice before it was recognized and registered as a valid entity with valid sensors and states. And still it did NOT WORK. :sob:

Before totally giving up, I tried one final thing. I used your exact pin assignments for TX and RX and SENSE. (I was previously using D1, D2, and D3. That NEVER worked.) I used your D0, D1, and D2 and it just started working :partying_face:

Lesson learned: If these pin assignments worked for the author, JUST USE THEM.

Thanks for your post!

Something that is not obvious to me right now, i have created a template switch in the esphome config. but it is never triggered when i put a finger on it,am i doing something wrong?

[...]
switch:
  - platform: template
    name: "Finger scanned"
    id: finger_scanned

fingerprint_grow:
  sensing_pin: D2
  on_finger_scan_matched:
    - switch.turn_on: finger_scanned
[...]

or is there a better approach for triggering in home assistant?

After the turn on, you should add a small delay of 100ms and then turn it off again.

2 Likes

Like this:

[...]
switch:
  - platform: template
    name: "Finger scanned"
    id: finger_scanned

fingerprint_grow:
  sensing_pin: D2
  on_finger_scan_matched:
    - switch.turn_on: finger_scanned
    - delay: 500ms
    - switch.turn_off: finger_scanned

This simulates a momentary button press.

1 Like

Like this

  on_finger_scan_unmatched:
    - fingerprint_grow.aura_led_control:
        state: FLASHING
        speed: 20
        color: RED
        count: 3
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Unauthorized finger"
    - delay: 3s
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Scan your finger"

After any action you need to add this to return to a state that another finger can be scanned.

    - delay: 3s
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Scan your finger"

Edit: That is separate from any automatons. You need what you have to turn the switch off.

1 Like

this does not seem to work for me, in the log I see that the switch is switched on and off, but it is not apparent in Home assistant this stays always on state off… even if I manually set it to on it jumps right back to off…

The Log:

[19:07:22][I][fingerprint_grow:148]: Processed image 1
[19:07:22][D][fingerprint_grow:101]: Fingerprint matched
[19:07:22][D][sensor:127]: 'fingerprint Last Finger ID': Sending state 0.00000  with 0 decimals of accuracy
[19:07:22][D][sensor:127]: 'fingerprint Last Confidence': Sending state 68.00000  with 0 decimals of accuracy
[19:07:22][D][switch:021]: 'Finger scanned' Turning ON.
[19:07:23][D][switch:025]: 'Finger scanned' Turning OFF.
[19:07:23][D][fingerprint_grow:304]: Setting Aura LED
[19:07:23][D][fingerprint_grow:308]: Aura LED set
[19:07:23][D][text_sensor:015]: 'fingerprint State': Sending state 'Authorized finger'

smart! this works for me. Thanks a lot!

unfortunately the switch does not work but so I find it almost the neater way to go.

Is the name of the switch finger_scanned? Is this switch also defined and connected to the same esp board? If your still having trouble post the whole config

  on_finger_scan_matched:
    - switch.turn_on: finger_scanned
    - delay: 500ms
    - switch.turn_off: finger_scanned
1 Like