Hi, I bought a fingerprint sensor off AliExpress, marked as "DX1," but I can't find any tutorials, and AI can't help either.
Edit/solved: For everyone that encounters this issue, try every combination of GND and VCC. If the light lights up blue, try different combos of RX and TX.
It looks like more than DX1 written on the back of the device, google all of it in various combinations.
Did you check the AE page, most people never discover the documentation that is often on the page at AE. If you can;t find anything post the AE link so we can look.
Take a look at this my project.
It's written for ESP-IDF, but since the code for fingerprint sensor is written as a cpp class, it should be quite easy to adapt for Arduino.
Despite different module names, most fingerprint sensors share identical firmware.
In fact, you could try one of the libraries already included in the IDE, even if they refer to other modules.
A simple google gave me the esp32 bus to use (UART) and which colour wires go where PLUS sample code.
I used how do I connect a Capacitive Fingerprint scanner to an esp32
in the search box not the omni box.
Here is the start of the search result, there is more.
Thanks for the help; those schemas didn't work for me, so I just tried all possible combinations. In the end, I connected it to my Arduino Uno: green to GND, white to 3V3, and yellow and brown to TX and RX. However, I have another issue: the sensor says "Could not find fingerprint features" every time I try something, e.g., adding or checking fingerprints. I couldn't find any solution or posts of someone having the same issue.
Has anyone told you to read the pinned post re 'How to get the most from the forum'? We have to SEE what you see, all your code, formatted by the IDE Tools/Auto Format then IDE Edit/Copy For Forum and paste in a replay. Same for any error logs. Now take a picture of a hand drawn wiring diagram.
my bad, here is the diagram:
white -> 3v3
green -> gnd
yellow -> pin2/rx
brown -> pin3/tx
here are some logs:
Fingerprint sensor found!
Reading sensor parameters
Status: 0x0
Sys ID: 0x1F4
Capacity: 100
Security level: 3
Device address: FFFFFFFF
Packet len: 128
Baud rate: 57600
Ready to enroll a fingerprint!
Please type in the ID # (from 1 to 127) you want to save this finger as...
Enrolling ID #1
Waiting for valid finger to enroll as #1
Image taken
Could not find fingerprint features
Ready to enroll a fingerprint!
Please type in the ID # (from 1 to 127) you want to save this finger as...
Enrolling ID #1
Waiting for valid finger to enroll as #1
Image taken
Could not find fingerprint features
Ready to enroll a fingerprint!
Please type in the ID # (from 1 to 127) you want to save this finger as...
#if (defined(__AVR__) || defined(ESP8266)) && !defined(__AVR_ATmega2560__)
SoftwareSerial mySerial(2, 3);
#else
#define mySerial Serial1
#endif
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
uint8_t id;
void setup() {
Serial.begin(9600);
while (!Serial);
delay(100);
Serial.println("\n\nAdafruit Fingerprint sensor enrollment");
finger.begin(57600);
delay(5);
Serial.println("Searching for fingerprint sensor...");
while (!finger.verifyPassword()) {
Serial.println("Sensor not found, retrying...");
delay(500);
}
Serial.println("Fingerprint sensor found!");
Serial.println(F("Reading sensor parameters"));
finger.getParameters();
Serial.print(F("Status: 0x"));
Serial.println(finger.status_reg, HEX);
Serial.print(F("Sys ID: 0x"));
Serial.println(finger.system_id, HEX);
Serial.print(F("Capacity: "));
Serial.println(finger.capacity);
Serial.print(F("Security level: "));
Serial.println(finger.security_level);
Serial.print(F("Device address: "));
Serial.println(finger.device_addr, HEX);
Serial.print(F("Packet len: "));
Serial.println(finger.packet_len);
Serial.print(F("Baud rate: "));
Serial.println(finger.baud_rate);
}
uint8_t readnumber(void) {
uint8_t num = 0;
while (num == 0) {
while (!Serial.available());
num = Serial.parseInt();
Serial.read();
}
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.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(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; }
return true;
}```
Which example is that, and what wires were connected where. Show a clear photo of the wires so I can read the pins. If you want assistance, you need to provide what we ask.
The documentation I saw was quite clear about what wires go where.
I am using an arduino uno, ->esp32 ai thinker cam<-main one for this project and generic esp32 wroom module, all have the same outcome and its an example for adding an fingerprint to the sensor memory
Using the esp32-cam is a big problem, there are almost no free pins. If he uses the SD card the entrire left side is for that. That only leaves 0, 1, 3, 16 but 16 is connected to the PSRAM,so if you need that that pin is gone. Pin 0 is for flashing, and 1, and 3 are the UART and needed to upload the sketch and see anything on the Serial output. Since I have no idea what role the esp32-cam is playing nor the UNO and the OP has been difficult to get any information from I think I will just say adieu.
Hi, my apologies for not being precise. I was first using ESP32, but now I am using an Uno/R3 because it has better support for this. Then I will switch the code to ESP32. The main issue is solved, but I've encountered another one. I've solved the "fingerprint tools not found" issue, but I am unable to do anything with it now. It just does the "waiting for fingerprint" thing. Is there any way to solve that? At this point, even Claude told me to just buy a new sensor, so I am low-key desperate.
Is the code you displayed ing post #12 the code you are using with the UnoR3?
And, is the report in Post #12 using the UnoR3?
If so, this tells me the fingerprint reader is working, but the identification if the image needed to store a valid fingerprint failed...
There are two "could not find features" errors that look the same in the output. In your code make the responses different, like this...
case FINGERPRINT_FEATUREFAIL: Serial.println("Could not find fingerprint features FEATUREFAIL"); return p;
case FINGERPRINT_INVALIDIMAGE: Serial.println("Could not find fingerprint features INVALIDIMAGE"); return p;
I can not find where you started mySerial or Serial1 which could explain "no image" and "failed image" ... and why did you rename mySerial?