Secure your project with biometrics - this adorably tiny, all-in-one, optical fingerprint sensor will make adding fingerprint detection and verification super simple. It’s extremely slim, with a plastic casing that can be glued or panel mounted into any enclosure! There are some embedded blue LEDs that light up the outer casing when the sensor is waiting for finger touches.
Been working with this sensor for a few days and cannot quite get it to work.
I’m using the Adafruit feather Bluefruit 32u4.
I’m using hardware serial and setting the baud rate to 115200 as specified in the product description.
I’ve tested multiple arduinos and tested that the Serial1 works by using a loopback between the TX and RX.
Occasionally it does enroll and saves to an ID, but when I goto read the fingerprint it says that there are no templates. Although when scanning a correct finger, it does flash green and respectivy red, when scanning an incorrect finger.
The sketches supplied by Adafruit often return “Communication error”, rather that the “.” which indicates that no current finger print is detected.
Last of all, when running finger.getParameters();it return the baud rate as 49664. If i don’t modify the baud rate the library sets it to 57600, but then the sensor does not detect at all.
Any help appreciated!
I’ve just checked Adafruit’s documentation for this one and it looks like these were initially using 115200 baud, before later models used the more standard 57600 baud.
Can you try running the example code at both baud rates and see if you get better results with one rate than the other?
Could you please also send through a photo of your setup? A second set of eyes can often spot something minor that may be causing issues.
I’ll have our product pages updated shortly to include the info about the baud rate change to newer stock.
Hi Trent,
Thank you for the suggestions. Just to give a little more context, I changed the sketch code where it uses finger.verifyPassword() to check if the scanner has been detected.
With the original code it always returns Did not find fingerprint sensor :( regardless if i have it set to either 57600 or 115200.
If i use my new code (which ‘waits’ till the sensor is ready using a while loop)
It eventually detects the sensor (usually after a few trys) - but only when running the 115200 baud rate (it still doesn’t work on 57600).
And as previously mentioned, I’ve tested a couple of the same model of arduino as well as testing a loop back on the serial port of the arduino.
Another telling symptom is when i use the Leo passthrough sketch with SFGDemo software, it’s also very intermittent (I think I’ve had a couple successful scans out of possibly 50 or so attempts)
I have also tried using a different plug and connector to the sensor (with longer wires)
I’ve set this up on the bench with some IC clips with some units from stock, and also found the problems you were experiencing. My go-to tool when something doesn’t talk to something else is to hook up a Saleae and see what’s actually going back and forth.
I found that hardware serial didn’t output anything from the Bluefruit 32u4 with the demo sketches provided, so I got errors like “Could not communicate with the sensor”.
Software serial on pins 2 and 3, however, did get a response. Comment out the #if #else #endif logic in the sketch you’re using to force it into software serial and let us know if that works.
I can confirm 57600 is the right baudrate though, as 115200 did not get a response:
Though I think that the whole “password” system was why the sketch still reported that it couldn’t communicate. Shouldn’t be a problem for you who can safely keep track of a password (your part doesn’t need to go back on a shelf)
Hi James,
Thank you so much for the thorough diagnosis! Unfortunately I’m still not having any joy… I’m not exactly sure what you mean by Shouldn’t be a problem for you who can safely keep track of a password?
Below is the setup code that i’m using. If i remove the finger.verifyPassword() step all together, it does get further, but after pressing a number to enroll to, the Serial Monitor repeatedly outputs Communication Error
I also attempted to use pins 10 and 11, just because pins 2 and 3 are shared with SDA and SCL - I’m not sure if this makes a difference.
Is it possible that you are simply pushing the Feather harder than it can manage? For Arduino the maximum suggested baud rate for software serial is 57600. But the Feather BlueFruit 32U4, with a 8MHz clock, is likely to have a much lower maximum baud rate.
Have you managed reliable software serial at that baud rate with any other device?
I second this, I got framing errors (malformed serial output) when using 115200 on a Bluefruit 32u4, this may be why I didn’t get a response, but I’d be surprised if the sensor has baud rate detection.
My mistake regarding the password, I did not realise that the sensors had no password by default. Ignore that bit if you know you haven’t set one.
To keep things consistent, let’s look at the same bit of example code (delete passwords), with no changes except forcing software serial. We can assume it should work with Adafruit’s demo code, so let’s go from there.
Protocol deep dive
This is why I dislike serial sensors as opposed to I2C ones that use a register model. There are no rules about how you can structure your protocol, so you’ve gotta consult the user manual and pick through the bytes that have gone back and forth to see what’s actually happening.
Perhaps there are additional function codes were added for the slim one? I’m not sure what the 0x13 command refers to. Perhaps a bug in their library? 0x0D is 13 in decimal, so maybe someone did the conversion wrong?
I’ll have to try a different example and get the logic analyser on it to see what it does (are the function codes legal?)
Have you reached out to Adafruit directly on this one? Since they wrote the library they will have a better idea of what’s going on here. If they don’t have an answer, even if you link to this thread, let me know and I’ll set up the hardware and logic analyser again.
I used the following sketch with various configurations to test the software serial (setup not included, but implied)
void loop() {
if (Serial.available()) {
char inByte = Serial.read(); // Captures data from Serial Monitor
mySerial.write(inByte); // Writes to Software Serial (pin 11)
// Serial1.write(inByte); // Writes to Hardware Serial (pin 1)
}
// if (mySerial.available()) {
// char inByte = mySerial.read(); // Reads from Software Serial (pin 10)
// Serial.write(inByte); // Writes data back to Monitor
// }
if (Serial1.available()) {
char inByte = Serial1.read(); // Reads from Hardware Serial (pin 0)
Serial.write(inByte); // Writes data back to Monitor
}
}
I discovered the following,
Hardware TX to Hardware RX - 115200 OK
Hardware TX to Software RX - 57600 OK (malformed at 115200)
Software TX to Hardware RX - 115200 OK - but I think the software serial was ‘just doing it’s best’
Software TX to Software RX - Could not get to work at all… (even at 9600, tried multiple 32u4)
I havn’t tried other serial devices on it (my post for the 0348 DFRobot scanner was unfortunately a false positive, which i have since removed )
Hi James, thanks again for the thorough assistence. No I havn’treached out directly to Adafruit yet, but I’m not familiar with I2C, I guess it’s some kind of protocol to consolidate things? Might be a question for a direct email, but would it be possible for me to send the sensors back for a credit and look at an I2C solution?
Getting a return done will likely incur shipping costs. Have you sent Adafruit an email? They are generally pretty good at getting back to people. Due to it being their library, they should be able to give you a direct way to get it working, whether being changes to their library, or just direct support.
The suggestion James had about the I2C fingerprint scanner worked straight away on the ADA2829.
I tried baud rate changes, delays, while loops etc. but I could not get the sensor working on the ADA2829 using hardware serial. (It works on other 32u4 chips - so perhaps it’s to do with the Bluetooth module?)
I eventually got the ADA4750 working on the ADA2829 using software serial - albeit intermittent communication issues. (I think this could be because the software serial has flakey issues with baud rates above 57600 - As the example sketches advise to NOT use software serial)
The ADA4750 worked straight away with the ESP32-S3 (ADA5323) without any flakey communication errors.