(UART) Optical Fingerprint Scanner (GT-521F32) Sample Project

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

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.

Fingerprint Scanner - TTL (GT-521F32) - SEN-14518 - SparkFun Electronics

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).

IMG_3318.JPG

The schematic looks like

schematic.JPG

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...

001-enroll.JPG

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.

002-verify.JPG

moto

23 Replies
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hello Moto san,

Thanks for contributing to the community .

Best Regards,
VRS

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

本サンプルは CQ出版 インターフェース 2019年4月号に

2019年4月号目次 | Interface – CQ出版

ふえる今どきセンサNote

その15 200個登録&認識できる指紋センサ

として掲載されました。

I contributed this sample project to a Japanese technical magazine

"Interface" Apr/2019 edition.

moto

0 Likes
abalc_2740841
Level 1
Level 1

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

0 Likes
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

In general 042 has very limited memory size

FYI

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?

I assigned

UART (for PC) rx: P4[0] tx: P4[1]

Note: Please jumper these to the on board PSoC 5LP P12[7], P12[6]

FPS rx: P3[0] tx[ P3[1], ICPCK P2[7]

moto

0 Likes
lock attach
Attachments are accessible only for community members.

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:

#include "project.h"

int main(void)

{

    PWM_Servo_Start();

  

    int i = 12000;

    while (i == 12000)

    {

        PWM_Servo_WriteCompare(i);

        i++;

        CyDelay(504);

        if (i > 12000)

        {

            PWM_Servo_WriteCompare(0);

        }

    }

}

Also, the project of controlling the servo motor is attached here.FPR Errors Screenshot.PNG

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Dear Salom-san,

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.

Best Regards,

27-Apr-2019

Motoo Tanaka

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Dear Salom-san,

I have just posted a sample program of using SG-90.

TSoC CY8C4146LQI-S433 基板 サーボ SG-90 サンプル

Although description is in Japanese, I hope that the project and pictures can be a hint for you.

Best Regards,

27-Apr-2019

Motoo Tanaka

0 Likes

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.

Salom,

0 Likes
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Dear Salom-san,

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.

Best Regards,

2-May-2019 2:41AM (JST)

Motoo Tanaka

0 Likes
lock attach
Attachments are accessible only for community members.

Happy holiday!

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!

0 Likes
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Dear Salom-san,

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 😉

moto

chascha
Level 1
Level 1
First reply posted Welcome!

Hi!

Is there any way i could port over this component to my PSoC5 CY8C5888LTI-LP09768 specifically

If theres any way that would be possible i would appreciate it!

0 Likes

I do have the 52 version of the FPS

0 Likes
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

I tried with CY8CKIT-059 (and a CY8CKIT-044 as a 3.3V and 5.0V power supply).

 

Schematic

Note: FPS_TX (P3[1]) of CY8CKIT-059 should not be connect directly to the RX of RU94V.

I used 3 x 1kOhm resisters to divide the 5V signal to (around) 3V signal.

Since RU94V's TX and ICPCK are output, I just decided to go with it,

but it would be nicer if you can apply level shifter (5V<->3.3V) between all these signals.

002-schematic.JPG

Pins

003-Pins.JPG

Tera Term log

001-TeraTerm-log.JPG

moto

lock attach
Attachments are accessible only for community members.

moto-san,

I'm very interested in your finger-print project. 

Question:  I thought the SIO port (Port 12) on the PSoC5 has a level shifter without need for external resistors.  The PSoC5LP is one of the few offerings from Cypress with this feature.   Bravo to the IC designers!

I added a VDAC8 set to 3.3V as a vref for the SIO pins.

I changed the FPS_RX, FPS_TX and ICPCK pins to pins on port 12 to make use of the Input and Output level shifting.

I've attached a modified version of your project with these changes if you're interested.

Len_CONSULTRON_1-1619439981788.png

Once I can buy a GT-521F32 I plan to try your project.   I'm a little tight on funds.  The possibilities!!!  

Do you think the comm interface to the FPS makes sense as a component?

Len
"Engineering is an Art. The Art of Compromise."
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Dear Len-san,

I tried your trick.

Although I have a little concern about P12[0] as it has a pull-up

I went ahead and tried.

Yes, it worked OK.

Still CY8CKIT-044 (or other external power supply of  3.3V (and 5V)) was required,

at least we could save 3 resistors 😉

moto

0 Likes

moto-san,

Thanks for the feedback.

Yes.  On the CY8CKIT-059, P12[0] has a switched pull up on the KitProg board.  It is switched through a FET using port P2[6] on the KitProg.   I've never checked if P2[6] was active only when the KitPRog I2C mode was enabled.

I made a slight change to the project I sent you.  I moved FPS_RX from P12[0] to P12[3].  There were no complaints from the Application build phase.  This should eliminate the pullup on the KitProg.

If you still would like to use P12[0] here's some thoughts:

Either way, a 2.2K ohm pullup on would limit any possible reverse current into the FPS_RX output of the FPS to <0.7mA.   Usually not enough to cause latchup conditions especially since this is configured as an output on the FPS.

If you wanted to avoid the pullup, you could place both the PSoC inputs (FPS_RX and ICPCK) on GPIO pins but configured as LVTTL level inputs.  With LVTTL, the Vih threshold is 2.0 (min) and the Vil is 0.8V (max).  The PSoC output would still have to stay on the SIO with the Vref at 3.3V.

I can't wait until I can get this FPS for myself.  I've always wanted to upgrade my home security system.  

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Hi!

Thanks alot for doing this!

I have one more question though!

Could you post a picture of the circuit setup?

 

Thanks!

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi

Picture

IMG_4723.JPG

Circuit Diagram (or something like that)

004-schematic.JPG

Note: As CY8CKIT-059 does not have 3.3V out, 

I used CY8CKIT-044 as a power supply.

moto

P.S. I'm going to try Len-san's trick later... 😉

0 Likes
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

moto-san,

This could be very useful in a biometric-based security system!

 

Len
"Engineering is an Art. The Art of Compromise."

To all,

I finally purchased the GT-521F32.  I used a modified version of the project uploaded here and it works!!!

However I may have found an undocumented issue with the GT-521F32 module (FPS).

My GT-521F32 power on the UART QWIIC connector is powered directly with 5V from the PSoC.

After issuing  multiple commands to the FPS, it stopped responding and returned "Recv DWord Timed out!".  The FPS basically stopped responding to commands.

I issued a "Close" command.  Same result.

I reset the PSoC using the reset button on the KitProg board.   Same result on re-entering main().

I finally had to power down the PSoC.  Because the FPS was powered off the PSoC, this reset the FPS.  This worked and corrected the problem.

The issue is that the FPS module has NO reset signal in any of the two QWIIC connectors.  It appears that it is possible to "confuse" the FPS.  How did I confuse it?  I don't know.

I'm going to have to put a FPS VDD power transistor to force a power reset to FPS in case of a detected comm "No response" lockup.

I have found a way to get this comm lockup.

  • Change the FPS baud rate (ex. 19200).
  • communicate to the FPS.   Success.
  • reset the PSoC without power cycling.
  • communicate to the FPS.   Received the error "Recv Dword Timed out".  This is because the FPS baudrate was changed before the PSoC reset.   You can't change the baudrate on the FPS back to 9600 but the reset of the PSoC dropped it's baud back down to the default 9600.   

It would be useful if the designers of the GT-521F32 module had a HW reset signal.  That way, you wouldn't need a silicon switch (transistor or FET) to power cycle the FPS.

Len
"Engineering is an Art. The Art of Compromise."
vijeeshchimbu
Level 1
Level 1
First reply posted Welcome!

Hello moto san,

 

Really appreciate for your work.I need to wake the led of sensor only when I place finger.I used this sensor for car starting project .how to use ICPCK pin in arduino.beacause i am using Arduino only.Simply speaking i want to use wake on finger feature by arduino.can u guide through that

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Dear Vijeeshchimbu-san,

Since this is an Infineon device community and at least I am not familiar with Arduino,

I'm afraid that we won't be able to help you a lot.

Having written above, when I googled "Arduino GT-521F32) I sound a page like below

it may be able to provide you better information.

https://learn.sparkfun.com/tutorials/fingerprint-scanner-gt-521fxx-hookup-guide/all

 

Best Regards,

12-Sep-2022

Motoo Tanaka

0 Likes