Did not found figerprint sensor

I AM USING R307S FIGERPRINT SENSOR WITH ESP32
CONNECTION ARE
R307S PIN 1 VCC- 5V(EXTERNAL)
PIN2 GND-GND(ESP32)
PIN3 TX- RX(16)ESP32
PIN4 RX-TX(17)ESP32
AND THE GND IS COMMON OF EXTERNAL POWER SUPPLY AND ESP32

#include <Adafruit_Fingerprint.h>
#include <HardwareSerial.h>
 
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&Serial2);
 
uint8_t id;
 
void setup()
{
Serial.begin(57600);
Serial2.begin(115200);
while (!Serial); // For Yun/Leo/Micro/Zero/...
delay(100);
Serial.println("\n\nAdafruit Fingerprint sensor enrollment");
 
// set the data rate for the sensor serial port
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() // run over and over again
{
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) {// ID #0 not allowed, try again!
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;
}
}
 
// OK success!
 
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;
}
}
 
// OK success!
 
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;
}
 
// OK converted!
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;
}
}

I get the message
Did not find fingerprint sensor :frowning:
anyone can help!!!

Your ESP32 is a 3.3V device which should not be directly connected to a 5V sensor.

i am not giving 5v to esp32 . i am giving 5v to figerprint sensor

But you have RX and TX connected between the ESP32 and the fingerprint sensor. What do you think that voltage level will be?

which means it will send stuff on the Serial line (its Tx) to the ESP32 using 0V (for bit 0) and 5V (for bit 1)... The Rx pin of your ESP32 can only handle 3.3V...

but sensor was not working at 3.3 volt

ok I will try

it depends on the model, this one is 3.3V for example and many will work with 3.3V even if the spec states 3.6V...

of course a voltage adapter will solve the situation safely and 5V can't hurt then.

fingerprint sensor is not working totally with 3.3 volt and 5 volts too .
I don't know what is the problem.
is my sensor died .

fingerprint sensor is not working totally with 3.3 volt and 5 volts too .
I don't know what is the problem.
is my sensor died .

May be
I can’t tell

ok can you tell me how to check the sensor?
is it died or not?

I don’t know how to check it simply other than connecting it with trusted wires to a trusted board and running one of the example made for this specific sensor.

If not you need to dig into the datasheet, understand the communication protocol and poke around to see if you are getting answers

OK THANK YOU @J-M-L FOR GIVING ME RESPONSES :smiling_face_with_three_hearts:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.