The heat of the Year End and the New Year hustle has calmed down.
But I've been struggling with my private project, which is a Fingerprint Scanner, namely GT-521F32.
Anyway, finally I could come up with the initial working version.
Although we've already been familiar with a Fingerprint Scanner with iPhones and Smartphones,
I wanted to play with one. And I found a reasonable priced one.
So I gave a try, since it is connected via UART, it seems to be easy to handle.
Well, communicating with module was easy, but control the device was another story (at least to me).
The schematic looks like
According to the programming guide term, to register a finger print is "enroll".
Since finding 200 person sounds difficult, I used a few of my fingers to try.
I enrolled my left thumb as 0, left index as 1, right thumb as 2, right index as 3...
To enroll a finger, the device requires us to release and touch the finger 3 times.
Then we can identify a finger (print) if it's enrolled or verify if enrolled finger can be verified correctly.
本サンプルは CQ出版 インターフェース 2019年4月号に
I contributed this sample project to a Japanese technical magazine
"Interface" Apr/2019 edition.
Thanks for sharing the project. I tried to apply the project with psoc 4 pioneer kit ( CY8CKIT-042) and I got two errors :
ERROR: region RAM overflowed with stack
collect2.exe: error: ld returned 1 exit status
The command 'arm-none-eabi-gcc.exe' failed with exit code '1'.
Could you tell me what is wrong. Thanks
In general 042 has very limited memory size
CY8CKIT-042 SRAM 4KB Flash 32KB
CY8CKIT-044 SRAM 16KB Flash 128KB
CY8CKIT-046 SRAM 32KB Flash 256KB
Anyway, I found a few problems to compile my project with CY8CKIT-042
(1) UART module does not support byte mode, I just set it off
(2) SRAM overflow, CY8CKIT-042 has only 4KB instead of 16KB of CY8CKIT-044
So, I tried to reduce the size of buffer for string and command.
And I could compile the project.
But I have not tested the code, because I left the sensor at my home,
so if you don't mind would you test it with your system?
UART (for PC) rx: P4 tx: P4
Note: Please jumper these to the on board PSoC 5LP P12, P12
FPS rx: P3 tx[ P3, ICPCK P2
Hi, thanks for having the time to make some changes to the code!
I actually tried it but still getting some errors as shown in the attached screenshot. It seems that it is not enrolling my finger ID.
All I want is to enroll my fingerprint ID. Then, the FPR will wait for my fingerprint to be scanned. Whenever it accepts it, a servo motor should spin so the door can be unlocked. The following is the code I wrote for spinning the servo motor:
int i = 12000;
while (i == 12000)
if (i > 12000)
Also, the project of controlling the servo motor is attached here.
I must apologize you about this,
when I tried to build and run this project on CY8CKIT-042,
I noticed that the program is running out the memory.
although it could be built, almost no working space was left
in the SRAM.
So I'm afraid that this program can not be run on CY8CKIT-042.
Please consider using CY8CKIT-044 or CY8CKIT-046 kind of boards.
I have just posted a sample program of using SG-90.
Although description is in Japanese, I hope that the project and pictures can be a hint for you.
Thank you very much for this modification. I managed to get it working on my friend's 44 kit.
I also tried using the arduino with the same fingerprint scanner and could get it working.
I wonder what would be the reason that it works well on the arduino but not on my CY8CKIT-042 kit even though the arduino has 2k bytes of SRAM while the CY8CKIT-042 kit has 4k bytes of SRAM! Is it something that has to do with the code efficiency which would cause a high usage in the SRAM? or what would be the reason?
I am new to the PSoC and Arduino world.
Thank you again for your input. I really appreciate it.
Reading your message, I checked the Arduino sample.
In their sample, they have not implemented all template and Image related functions,
which I tried to implement in my version, not fully tested though.
The template itself require 498 byte, which is already 1/4 of Arduino memory,
so probably it was impossible for Aruduino.
Meantime, if all you need to do is same thing with what Arduino version does,
we may be able to remove all these functions, which should reduce required memory a lot.
Attached is my project modified for CY8CKIT-042 and removed all template related functions
along with "template" data.
It could be built, but as we are in the middle of 10 days national holidays in Japan
and unfortunately I don't have the sensor with me right now,
I could not test it, so please let me know if it works for you or not.
2-May-2019 2:41AM (JST)
Your latest edit works! I connected the fingerprint scanner and servo motor and got them to work.
The issue I am running into is that I am restricted with sending commands and communicating with the fingerprint through the terminal. I tried to edit the functions in main.c so I can have the fingerprint to be working all the time and waiting for my fingerprint ID without the need to use the terminal. But I end up getting some code errors!
Please check the attached project that has the servo motor code with it.
Thank you again!
It seems that you are almost there!
I touched up your code a little as
(1) I added following functions
int doServo(void) ;
void run_servo(int x) ;
void stop_servo(void) ;
(2) doServo is now added in the command list
so if you enter "servo" to the prompt, the program will enter in servo mode.
As I made this mode an infinite loop, you need push reset button to exit from this loop.
You may be register a special finger and let the loop exit if that finger is identified.
(3) As usual, I could not test the program, I only could make sure that the program is compile-able.
Hoping that this can be a little hint for you 😉