adafruit / Adafruit_CircuitPython_Fingerprint

CircuitPython library for talking to UART-based Fingerprint sensors
MIT License
54 stars 50 forks source link

Aura LED control not functioning #48

Open blindman2k opened 2 years ago

blindman2k commented 2 years ago

I am using the Ultra-Slim Round Fingerprint Sensor and having an issue controlling the aura LED. The scanner is working perfectly in all other respects (scanning, enrolling, etc) and the aura LED is working fine it automatic mode. But I need to turn off the blue breathing LED when my device is not ready to scan a fingerprint and I am so-far unable to do so.

The LED control function (set_led) sends and receives ok.

SENT: 0xEF 0x01 0xFF 0xFF 0xFF 0xFF 0x01 0x00 0x07 0x35 0x04 0x80 0x01 0x00 0x00 0xC2 
RCVD: 0x00 

If it adds any useful information the FINGERPRINT_LEDOFF (0x51) command fails. I am not sure if it is supposed to work on this device because it is not in all versions of the code.

I started a thread in the Adafruit forum but we were unable to resolve it there.

jerryneedell commented 2 years ago

I am not aware of a data sheet for this particular sensor. I have one for the r503 (https://www.adafruit.com/product/4651) but not for this one so it is hard to look into this. The led commands as written were for the R503 sensor.

blindman2k commented 2 years ago

That makes sense. Looks like someone worked out this device works well with the current software and left it at that. I suppose I could randomly throw values at it and see if anything changes.

Zumili commented 2 years ago

A little bit late, but maybe helpful for others as well. Your fingerprint module does not support Aura Led Control! Have a look at the Dropbox folder containing a lot of fingerprint modules: https://www.dropbox.com/sh/epucei8lmoz7xpp/AAAmon04b1DiSOeh1q4nAhzAa?dl=0 R557 is your module. It only has a build in LED control mechanism, and you cannot set the color via a command. R553 modules will definitely work! But there are 2 versions, old one with 3 colors and new one with 7 colors.

bdh8 commented 1 year ago

I ran into this as well and would like to share my solution. Looking at the datasheets for other fingerprint sensors included in the dropbox folder indicated by Zumili, I noticed it explaining the standby mode, which it describes as "cutting of the main power supply of the module" which also turns off the light.

You can do this with a GPIO pin, but cannot power the fingerprint sensor directly (as the GPIO pin can only provide 16mA, at least on the Raspberry Pi that I am using) because the fingerprint sensor needs around 30mA, but I was able to get this to work by assigning a GPIO pin to disable the sensor (high turns the sensor OFF with this solution) by going through a 680 ohm resistor to the base of a S8550 PNP transistor that has its emitter connected to 3V3 and its collector connected to the red wire of the module. (See Section VII Reference Circuit: Q2 attached to the R307 pin 1. The drop to 680 ohm from 1K is due to that circuit being based on 5V instead of 3.3V that the R557 runs on.) This functions quite nicely as a switch controlled by the GPIO pin to turn the sensor (and its blue light) on and off. Be aware that every time the sensor is turned on, comes out of standby, you must wait 200ms for it to initialize before it can be used. Also, in my case using CuircitPython, I also had to re-setup the uart and finger objects before communication would work.

This leaves you with the issue of determining when to enable the module... well, remember those other two wires that Adafruit doesn't explain and just says to leave unattached? The IRQ (white) is the output of a touch sensor in the module that indicates when the module is in contact with a finger. The Vcc (blue) lead is power for this touch sensor so it still functions while the fingerprint sensor is powered down. You can attach the white wire to a pulled down input GPIO pin. When it goes high, you can reenable the fingerprint sensor. One issue you need to be aware of is that the IRQ lead goes high for about 9 seconds when the module is powered up (taken off standby), so you will want to take this into consideration in your use case. It may not be much of an issue, because it does go low immediately when the module is used to scan a fingerprint... which is most likely why you turned the module on in the first place... but if you are going to turn it on programmatically (and not immediately scan a finger), and are still watching the IRQ, you will want to consider this rather long initialization time for the touch sensor.

blindman2k commented 1 year ago

Thanks for sharing. We ended up switching it out for a different fingerprint sensor with a bit more functionality. We are now using the Waveshare UART Fingerprint Sensor (C). The protocol is different but the ideas are the same and everything works.

mimie123456 commented 1 year ago

I have another problem with this r557 on how to connect it to lock. Can Yuu help me?

jepler commented 1 year ago

This is not a good place for getting project help. If you purchased an Adafruit product, then the adafruit forums or adafruit discord are more appropriate places.