Matrixchung/SFM-V1.7

Low-power design

lhofinger opened this issue · 3 comments

Hello. Thank you very much for this library. It works well (tested with an ESP32).
But it seems VCC pin is always HIGH?
From the doc I've read: it is recommended to keep VCC in the power-off state in actual application, and control the voltage
on or off by judging the TOUCH_OUT pin signal. That is, when TOUCH_OUT presents a valid level, the VCC power supply is enabled,
and the fingerprint module enters the working state at this time.
Is it possible to adapt the library? Thanks!

Is it possible to adapt the library?

The answer is definitely yes.
In fact, the library was initially designed based on the sensor doc, however I realized that my MCU can't provide such a high power draw with direct GPIO connection (even use Output Push Pull). So, I removed the control part and changed my hardware wiring, making the VCC connect directly to the 3.3V input.

To make a low-power design, you can connect the VCC to a relay or something and use a GPIO pin to control the power state. Then, you can modify the bool SFM_Module::isTouched() in src/sfm.cpp and add some digitalWrite() stuffs.

Thank you very much. It is working great with direct GPIO connection. To use the library as it is, I just

  • Call SFM.disable(); at the end of the setup()
  • Call SFM.enable();delay(200); in the loop() (in the if(SFM.isTouched()) test)
  • Call delay(200);SFM.disable(); at the end of the else part.

Laurent

I'm happy to hear that you have solved the problem.
If necessary, you can open a pull request about your changes mentioned above.