0

NodeMCU (ESP8266) with Fingerprint Sensor (DY50)
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

NodeMCU (ESP8266) with Fingerprint Sensor (DY50)

by aleadsk on Mon Oct 07, 2019 10:28 am

Hello,

I am new to IoT and have the following problem trying to use NodeMCU and the DY50 Fingerprint Sensor. I followed the instructions in the Adafruit DY50 sensor manual when plugging into the ESP8266 ports (D4 and D5) (I'm using the NODEMCU Lolin ESP8266), and I'm having communication problems and sometimes unknown errors, so I would like to know if you are forgetting something or the other.
Attachments
error.jpeg
Communication error ESP8266 with Fingerprint Sensor Dy50
error.jpeg (91.6 KiB) Viewed 195 times

aleadsk
 
Posts: 4
Joined: Thu Sep 05, 2019 11:11 pm

Re: NodeMCU (ESP8266) with Fingerprint Sensor (DY50)

by NelsonVasquez on Tue Oct 29, 2019 2:41 pm

Buenas tardes yo tambien he querido conectarme con mi modulo esp8266 junto con el sensor de huella dy50-2V1
pero no lo he logrado quisiera saber si lograte solucionar este problema mi correo es fva_97@hotmail.com

NelsonVasquez
 
Posts: 1
Joined: Tue Oct 29, 2019 2:39 pm

Re: NodeMCU (ESP8266) with Fingerprint Sensor (DY50)

by elyprado on Wed Nov 06, 2019 3:02 pm

También tengo el mismo problema. ¿Alguien ha encontrado la solución?

elyprado
 
Posts: 1
Joined: Wed Nov 06, 2019 3:01 pm

Re: NodeMCU (ESP8266) with Fingerprint Sensor (DY50)

by oesterle on Wed Nov 06, 2019 5:17 pm

Hi, aleadsk.

Can you post a sharp picture of your project wiring? 800x600 works well.

Also, can you post your source code? You can paste it in your reply, highlight it, then click the [ CODE ] button to format it nicely.

Cheers,

Eric

oesterle
 
Posts: 683
Joined: Tue Sep 17, 2013 11:32 pm

Re: NodeMCU (ESP8266) with Fingerprint Sensor (DY50)

by patrb on Thu Nov 07, 2019 1:50 pm

Hello oesterle,
I am getting the exact same response as aleadsk above, but with the ZFM 20 module. Posting a picture with my wiring (I don't think that is the problem because I have tried using many different pins) and my code (Really just the enroll example from the Adafruit Fingerprint Library(https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library))

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_Fingerprint.h>
#include <SoftwareSerial.h>

SoftwareSerial mySerial(4,5);

Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

uint8_t id;

void setup(){
  Serial.begin(9600);
  Serial.println("Adafruit Fingerprint sensor enrollment");
  finger.begin(57600);
  if (finger.verifyPassword())
    Serial.println("Found fingerprint sensor!");
  else {
    Serial.println("Did not find fingerprint sensor :(");
    while (1)
      delay(1);
  }
}

uint8_t readnumber(void){
  uint8_t num = 0;
  while (num == 0) {
    while (! Serial.available());
    num = Serial.parseInt();
  }
  return num;
}

void loop(){
  Serial.println("Ready to enroll a fingerprint!");
  Serial.println("Please type in the ID # (from 1 to 127) you want to save this finger as...");
  id = readnumber();
  if (id == 0)
     return;
  Serial.print("Enrolling ID #");
  Serial.println(id);
  while (!getFingerprintEnroll());
}

uint8_t getFingerprintEnroll(){
  int p = -1;
  Serial.print("Waiting for valid finger to enroll as #");
  Serial.println(id);
  while (p != FINGERPRINT_OK){
    p = finger.getImage();
    switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image taken");
      break;
    case FINGERPRINT_NOFINGER:
      Serial.println(".");
      break;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      break;
    case FINGERPRINT_IMAGEFAIL:
      Serial.println("Imaging error");
      break;
    default:
      Serial.println("Unknown error");
      break;
    }
  }
  p = finger.image2Tz(1);
  switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image converted");
      break;
    case FINGERPRINT_IMAGEMESS:
      Serial.println("Image too messy");
      return p;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return p;
    case FINGERPRINT_FEATUREFAIL:
      Serial.println("Could not find fingerprint features");
      return p;
    case FINGERPRINT_INVALIDIMAGE:
      Serial.println("Could not find fingerprint features");
      return p;
    default:
      Serial.println("Unknown error");
      return p;
  }
  Serial.println("Remove finger");
  delay(2000);
  p = 0;
  while (p != FINGERPRINT_NOFINGER) {
    p = finger.getImage();
  }
  Serial.print("ID ");
  Serial.println(id);
  p = -1;
  Serial.println("Place same finger again");
  while (p != FINGERPRINT_OK) {
    p = finger.getImage();
    switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image taken");
      break;
    case FINGERPRINT_NOFINGER:
      Serial.print(".");
      break;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      break;
    case FINGERPRINT_IMAGEFAIL:
      Serial.println("Imaging error");
      break;
    default:
      Serial.println("Unknown error");
      break;
    }
  }
  p = finger.image2Tz(2);
  switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image converted");
      break;
    case FINGERPRINT_IMAGEMESS:
      Serial.println("Image too messy");
      return p;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return p;
    case FINGERPRINT_FEATUREFAIL:
      Serial.println("Could not find fingerprint features");
      return p;
    case FINGERPRINT_INVALIDIMAGE:
      Serial.println("Could not find fingerprint features");
      return p;
    default:
      Serial.println("Unknown error");
      return p;
  }
  Serial.print("Creating model for #");
  Serial.println(id);
  p = finger.createModel();
  if (p == FINGERPRINT_OK) {
    Serial.println("Prints matched!");
  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    Serial.println("Communication error");
    return p;
  } else if (p == FINGERPRINT_ENROLLMISMATCH) {
    Serial.println("Fingerprints did not match");
    return p;
  } else {
    Serial.println("Unknown error");
    return p;
  }
  Serial.print("ID "); Serial.println(id);
  p = finger.storeModel(id);
  if (p == FINGERPRINT_OK) {
    Serial.println("Stored!");
  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    Serial.println("Communication error");
    return p;
  } else if (p == FINGERPRINT_BADLOCATION) {
    Serial.println("Could not store in that location");
    return p;
  } else if (p == FINGERPRINT_FLASHERR) {
    Serial.println("Error writing to flash");
    return p;
  } else {
    Serial.println("Unknown error");
    return p;
  }   
}



White = Rx, Green = Tx
IMG_20191107_182340.jpg
IMG_20191107_182340.jpg (188.67 KiB) Viewed 111 times

patrb
 
Posts: 1
Joined: Thu Nov 07, 2019 1:36 pm

Re: NodeMCU (ESP8266) with Fingerprint Sensor (DY50)

by oesterle on Fri Nov 08, 2019 7:08 pm

Hi, patrb!

Thanks for posting a sharp image and your source code. Here's what I'd look into:
  • Your code creates a SoftwareSerial instance on pin 4 (rx) and pin 5 (tx). But your jumper wires are on pin 1 and pin 2. Code needs to match wiring for communication to happen.
  • It's common for ESP8266 and ESP32 microcontrollers to reserve some pins for other uses, especially at bootup, and also, when Wi-Fi is active or starting up. This ESP8266/NodeMCU forum will likely have more people familiar with that product: ESP8266 Forum - Everything ESP8266. Adafruit stocks ESP8266 and ESP32 products (branded “HUZZAH”), but their pinouts and firmware are likely different from your NodeMCU board.
  • Doing a quick search on ESP8266 forums, I find that users of ESP8266 boards have had mixed success with SoftwareSerial. I'd look into trying built-in hardware serial pins, if that's a possibility, and they don't conflict with USB or Wi-Fi.
  • Is your sensor the Adafruit Fingerprint sensor, and did you order it from Adafruit? Components ordered from other merchants, while they may look identical, can differ in firmware version or pinouts from what Adafruit and official distributors stock.

Cheers,

Eric

oesterle
 
Posts: 683
Joined: Tue Sep 17, 2013 11:32 pm

Re: NodeMCU (ESP8266) with Fingerprint Sensor (DY50)

by inauj on Sat Nov 09, 2019 2:05 pm

solution??

patrb wrote:Hello oesterle,
I am getting the exact same response as aleadsk above, but with the ZFM 20 module. Posting a picture with my wiring (I don't think that is the problem because I have tried using many different pins) and my code (Really just the enroll example from the Adafruit Fingerprint Library(https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library))

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_Fingerprint.h>
#include <SoftwareSerial.h>

SoftwareSerial mySerial(4,5);

Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

uint8_t id;

void setup(){
  Serial.begin(9600);
  Serial.println("Adafruit Fingerprint sensor enrollment");
  finger.begin(57600);
  if (finger.verifyPassword())
    Serial.println("Found fingerprint sensor!");
  else {
    Serial.println("Did not find fingerprint sensor :(");
    while (1)
      delay(1);
  }
}

uint8_t readnumber(void){
  uint8_t num = 0;
  while (num == 0) {
    while (! Serial.available());
    num = Serial.parseInt();
  }
  return num;
}

void loop(){
  Serial.println("Ready to enroll a fingerprint!");
  Serial.println("Please type in the ID # (from 1 to 127) you want to save this finger as...");
  id = readnumber();
  if (id == 0)
     return;
  Serial.print("Enrolling ID #");
  Serial.println(id);
  while (!getFingerprintEnroll());
}

uint8_t getFingerprintEnroll(){
  int p = -1;
  Serial.print("Waiting for valid finger to enroll as #");
  Serial.println(id);
  while (p != FINGERPRINT_OK){
    p = finger.getImage();
    switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image taken");
      break;
    case FINGERPRINT_NOFINGER:
      Serial.println(".");
      break;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      break;
    case FINGERPRINT_IMAGEFAIL:
      Serial.println("Imaging error");
      break;
    default:
      Serial.println("Unknown error");
      break;
    }
  }
  p = finger.image2Tz(1);
  switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image converted");
      break;
    case FINGERPRINT_IMAGEMESS:
      Serial.println("Image too messy");
      return p;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return p;
    case FINGERPRINT_FEATUREFAIL:
      Serial.println("Could not find fingerprint features");
      return p;
    case FINGERPRINT_INVALIDIMAGE:
      Serial.println("Could not find fingerprint features");
      return p;
    default:
      Serial.println("Unknown error");
      return p;
  }
  Serial.println("Remove finger");
  delay(2000);
  p = 0;
  while (p != FINGERPRINT_NOFINGER) {
    p = finger.getImage();
  }
  Serial.print("ID ");
  Serial.println(id);
  p = -1;
  Serial.println("Place same finger again");
  while (p != FINGERPRINT_OK) {
    p = finger.getImage();
    switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image taken");
      break;
    case FINGERPRINT_NOFINGER:
      Serial.print(".");
      break;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      break;
    case FINGERPRINT_IMAGEFAIL:
      Serial.println("Imaging error");
      break;
    default:
      Serial.println("Unknown error");
      break;
    }
  }
  p = finger.image2Tz(2);
  switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image converted");
      break;
    case FINGERPRINT_IMAGEMESS:
      Serial.println("Image too messy");
      return p;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return p;
    case FINGERPRINT_FEATUREFAIL:
      Serial.println("Could not find fingerprint features");
      return p;
    case FINGERPRINT_INVALIDIMAGE:
      Serial.println("Could not find fingerprint features");
      return p;
    default:
      Serial.println("Unknown error");
      return p;
  }
  Serial.print("Creating model for #");
  Serial.println(id);
  p = finger.createModel();
  if (p == FINGERPRINT_OK) {
    Serial.println("Prints matched!");
  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    Serial.println("Communication error");
    return p;
  } else if (p == FINGERPRINT_ENROLLMISMATCH) {
    Serial.println("Fingerprints did not match");
    return p;
  } else {
    Serial.println("Unknown error");
    return p;
  }
  Serial.print("ID "); Serial.println(id);
  p = finger.storeModel(id);
  if (p == FINGERPRINT_OK) {
    Serial.println("Stored!");
  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    Serial.println("Communication error");
    return p;
  } else if (p == FINGERPRINT_BADLOCATION) {
    Serial.println("Could not store in that location");
    return p;
  } else if (p == FINGERPRINT_FLASHERR) {
    Serial.println("Error writing to flash");
    return p;
  } else {
    Serial.println("Unknown error");
    return p;
  }   
}



White = Rx, Green = Tx
IMG_20191107_182340.jpg

inauj
 
Posts: 1
Joined: Sat Nov 09, 2019 2:04 pm

Re: NodeMCU (ESP8266) with Fingerprint Sensor (DY50)

by jsn77 on Tue Nov 12, 2019 2:00 pm

Hello, oesterle!

Can you help me? I'm on a project involving fingerprint (obviously), and I need to catch the image, my job is precisely get the image. I already saw some previous forums, but didn't help much. Do you know how to get the image from a optical fingerprint sensor?

Thank you for your attention!

Sam

jsn77
 
Posts: 3
Joined: Tue Oct 22, 2019 2:33 pm

Re: NodeMCU (ESP8266) with Fingerprint Sensor (DY50)

by oesterle on Tue Nov 12, 2019 3:47 pm

Hi, jsn77.

Please start a new topic with your question, and I'll be happy to answer there.

Cheers,

Eric

oesterle
 
Posts: 683
Joined: Tue Sep 17, 2013 11:32 pm

Please be positive and constructive with your questions and comments.