Error integrating a R503 fingerprint sensor

Good evening,

I’im trying to integrate an R503 fingerprint sensor using a nodeMCU and ESPHome.
I have followed this tutorial:

But the sensor can’t communicate with ESPHome, I get the error “No response received from reader” and “Component fingerprint_grow was marked as failded”.

The sensor as a difference with the one on the tutorial: it has a brown cable instead of the green one, I don’t know if this can be the problem.

Also I can say that the fingerprint works perfectly with Arduino, so it is not broken.

This is my ESPHome yaml file:

esphome:
  name: esp-fingerprint

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

ota:
  password: "ed986bbd295b4827931083280c2a6851"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp-Fingerprint Fallback Hotspot"
    password: "4L7h9BuAV4Pg"

captive_portal:
    
uart:
  rx_pin: GPIO14
  tx_pin: GPIO13
  baud_rate: 57600
    
fingerprint_grow:
  sensing_pin: GPIO12
  on_finger_scan_matched:
    - logger.log: "scan matched"
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Impronta autorizzata"
    - delay: 3000ms
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Attesa"
    - fingerprint_grow.aura_led_control:
        state: BREATHING
        speed: 200
        color: BLUE
        count: 1
  on_finger_scan_unmatched:
    - logger.log: "scan unmatched"
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Impronta non autorizzata"
    - fingerprint_grow.aura_led_control:
        state: FLASHING
        speed: 25
        color: RED
        count: 2
  on_enrollment_scan:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Impronta acquisita"
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Impronta acquisita"
    - 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
  on_enrollment_failed:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Acquisizione impronta fallita"
    - fingerprint_grow.aura_led_control:
        state: FLASHING
        speed: 25
        color: RED
        count: 4

api:
  encryption:
    key: "Irl7QrFQs/qaAOaTlcl0zXy5xAKww9e2vvD+b2a24vI="
  services:
  - service: enroll
    variables:
      finger_id: int
      num_scans: int
    then:
      - fingerprint_grow.enroll:
          finger_id: !lambda 'return finger_id;'
          num_scans: !lambda 'return num_scans;'
  - service: cancel_enroll
    then:
      - fingerprint_grow.cancel_enroll:
  - service: delete
    variables:
      finger_id: int
    then:
      - fingerprint_grow.delete:
          finger_id: !lambda 'return finger_id;'
  - service: delete_all
    then:
      - fingerprint_grow.delete_all: 

text_sensor:
  - platform: template
    id: fingerprint_state
    name: "Stato impronta"

binary_sensor:
  - platform: fingerprint_grow
    id: fingerprint_enrolling
    name: "Acquisendo impronta"

sensor:
  - platform: fingerprint_grow
    fingerprint_count:
      name: "Conta impronte"
    last_finger_id:
      name: "Ultimo ID impronta"
    last_confidence:
      name: "Affidabilità ultima impronta"
    status:
      name: "Stato impronta"
    capacity:
      name: "Capacità impronta"
    security_level:
      name: "Livello di sicurezza"

Can someone help me?

This is a photo of the connections I made:

The differences with the tutorial are:

  • nodeMCU is powered by the microUSB cable connected to a notebook

  • fingerprint is powered by an Arduino at 3.3V (that is because on the breadboard I can’t access the GND pin that is on the bottom side, see photo)

I’m not certain about the ESP32, but I can tell you the Wemos D1 Mini (ESP8266) was rather persnickety about precisely which digital input and output pins you used. Have you tried general digital pins, specifically not already designated to I2C or UART or SPI functions?

Thank you for your answer!

Yes, I’ve tried using free pins, but the result was the same.

Hi, in the linked tutorial tx and rx pins are swapped with respect to your yaml. Did you tried to swap the UART link cables? This is a very common mistake :grimacing:

Thank you for your answer.

Yes, I’ve tried to swap them but the result was the same.
But why are you saying that in my yaml the pins are swapped? In the linked tutorial there is:

uart:
  rx_pin: GPIO14
  tx_pin: GPIO13
  baud_rate: 57600

that is the same as my yaml.

Ops, you are right, looking at the tutorial I read the UART config swapped. Sorry.

I have exactly the same problem, with brown cable no green, and it only works the led when i call the service to enroll, but it dont do anything… i try all that i can think. Please if you solved it, we will help me

Hey! Did you ended up figuring it out?
I have the exact same problem, but my sensor was working for a while before giving me this issue!