Skip to content

Commit fc8f3d8

Browse files
authored
Update FPS_Enroll.ino
- fix spelling error at output from "Enrolling Successfull" to "Enrolling Successful" - added a description for this example - updated the hardware hookup - added option to adjust software serial for other Arduino microcontrollers (i.e. ATmega32U4, ATmega2560, etc.) due to limitations with the library. - added some a little bit more comments. =) - changed resistors used in voltage division: _Logic Level Conversion_ I tested the setup with the previous resistors. I was not able to get it working with the GT511C1R model. However, I was able to get it working when using a voltage divider (with 10kΩ and 20kΩ) similar to the setup used in our previous logic level converter’s application circuit [ [https://cdn.sparkfun.com/assets/b/0/e/1/0/522637c6757b7f2b228b4568.png](https://cdn.sparkfun.com/assets/b/0/e/1/0/522637c6757b7f2b228b4568.png) ]. I believe the IC used in the GT511C1R requires a slightly higher logic level for the input voltage in order for the signal to be considered a logic HIGH by the fingerprint scanner [similar to this general explanation of 3.3V CMOS Logic Levels – [https://learn.sparkfun.com/tutorials/logic-levels#33-v-cmos-logic-levels](https://learn.sparkfun.com/tutorials/logic-levels#33-v-cmos-logic-levels) ]. Doing a stress test (with the original 560Ohm and 1000Ohm resistor) and measuring the voltage with a multimeter, I noticed that the divided voltage was about 3.14V. When the GT511C1R was connected, the voltage dropped to about 2.97V. This is probably not high enough for the fingerprint scanner to recognize a logic HIGH. _Replace Resistors for Higher Logic Level Threshold_ I was able to get the Arduino example code working by replacing the 560Ohm resistor with the 10kΩ resistor and replacing the 1000Ohm resistor with two 10kΩ resistors in series for 20kΩ. Testing the circuit with the resistors replaced, my multimeter read a divided voltage of 3.3V. When the GT511C1R was connected, the voltage dropped to about ~3.18V-3.04V. This was sufficient enough for the fingerprint scanner to receive the commands from the Arduino. I tested this with the blink examples and there were no problems.
1 parent debc44f commit fc8f3d8

File tree

1 file changed

+61
-13
lines changed

1 file changed

+61
-13
lines changed

FPS_GT511C3/Examples/FPS_Enroll/FPS_Enroll.ino

Lines changed: 61 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,81 @@
1-
/*
1+
/*****************************************************************
22
FPS_Enroll.ino - Library example for controlling the GT-511C3 Finger Print Scanner (FPS)
33
Created by Josh Hawley, July 23rd 2013
44
Licensed for non-commercial use, must include this license message
55
basically, Feel free to hack away at it, but just give me credit for my work =)
66
TLDR; Wil Wheaton's Law
7-
*/
7+
8+
Description: This code enrolls a fingerprint by creating a ID template. It requires
9+
three samples of your fingerprint.
10+
11+
This code should work with the any model of ADH-Tech's FPS as long as
12+
you are within the minimum logic level threshold for the FPS serial UART.
13+
This code has been tested with these models:
14+
15+
GT-511C3 [ https://www.sparkfun.com/products/11792 ]
16+
GT-511C1R [ https://www.sparkfun.com/products/13007 ]
17+
18+
-------------------- HARDWARE HOOKUP with 5V Arduino --------------------
819
20+
1.) Dedicated Bi-Directional Logic Level Converter (LLC)
21+
22+
It is recommended to use a dedicated bi-direcitonal LLC
23+
[ https://www.sparkfun.com/products/12009 ] for a reliable connection if you
24+
are using a 5V Arduino microcontroller:
25+
26+
Fingerprint Scanner (Pin #) <-> Logic Level Converter <-> 5V Arduino w/ Atmega328P
27+
UART_TX (3.3V TTL)(Pin 1) <-> LV1 <-> HV1 <-> RX (pin 4)
28+
UART_RX (3.3V TTL)(Pin 2) <-> LV4 <-> HV4 <-> TX (pin 5)
29+
GND (Pin 3) <-> GND <-> GND <-> GND
30+
Vin (3.3V~6V) (Pin 4) <-> HV <-> 5V
31+
LV <-> 3.3V
32+
33+
2.) Voltage Division w/ 3x 10kOhm Resistors
34+
35+
Otherwise, you could use 3x 10kOhm resistors [ https://www.sparkfun.com/products/11508 ]
36+
to divide the voltage from a 5V Arduino down to 3.3V FPS similar to the
37+
"Uni-Directional" application circuit on our old logic level converter
38+
[ https://cdn.sparkfun.com/assets/b/0/e/1/0/522637c6757b7f2b228b4568.png ]:
39+
40+
Voltage Divider <-> Fingerprint Scanner(Pin #) <-> Voltage Divider <-> 5V Arduino w/ Atmega328P
41+
<-> UART_TX (3.3V TTL) (Pin 1) <-> <-> RX (pin 4)
42+
GND <-> 10kOhm <-> 10kOhm <-> UART_RX (3.3V TTL) (Pin 2) <-> 10kOhm <-> TX (pin 5)
43+
GND <-> GND (Pin 3) <-> GND <-> GND
44+
<-> Vin (3.3V~6V) (Pin 4) <-> <-> 5V
45+
46+
Note: You can add the two 10kOhm resistors in series for 20kOhms. =)
47+
48+
--------------------------------------------------------------------------------
49+
50+
*****************************************************************/
951

1052
#include "FPS_GT511C3.h"
1153
#include "SoftwareSerial.h"
1254

13-
// Hardware setup - FPS connected to:
14-
// digital pin 4(arduino rx, fps tx)
15-
// digital pin 5(arduino tx - 560ohm resistor fps rx - 1000ohm resistor - ground)
16-
// this brings the 5v tx line down to about 3.2v so we dont fry our fps
55+
// set up software serial pins for Arduino's w/ Atmega328P's
56+
// FPS (TX) is connected to pin 4 (Arduino's Software RX)
57+
// FPS (RX) is connected through a converter to pin 5 (Arduino's Software TX)
58+
FPS_GT511C3 fps(4, 5); // (Arduino SS_RX = pin 4, Arduino SS_TX = pin 5)
1759

18-
FPS_GT511C3 fps(4, 5);
60+
/*If using another Arduino microcontroller, try commenting out line 58 and
61+
uncommenting line 67 due to the limitations listed in the
62+
library's note => https://www.arduino.cc/en/Reference/softwareSerial . Do
63+
not forget to rewire the connection to the Arduino*/
64+
65+
// FPS (TX) is connected to pin 10 (Arduino's Software RX)
66+
// FPS (RX) is connected through a converter to pin 11 (Arduino's Software TX)
67+
//FPS_GT511C3 fps(10, 11); // (Arduino SS_RX = pin 10, Arduino SS_TX = pin 11)
1968

2069
void setup()
2170
{
22-
Serial.begin(9600);
71+
Serial.begin(9600); //set up Arduino's hardware serial UART
2372
delay(100);
24-
fps.Open();
25-
fps.SetLED(true);
73+
fps.Open(); //send serial command to initialize fps
74+
fps.SetLED(true); //turn on LED so fps can see fingerprint
2675

27-
Enroll();
76+
Enroll(); //begin enrolling fingerprint
2877
}
2978

30-
3179
void Enroll()
3280
{
3381
// Enroll test
@@ -70,7 +118,7 @@ void Enroll()
70118
iret = fps.Enroll3();
71119
if (iret == 0)
72120
{
73-
Serial.println("Enrolling Successfull");
121+
Serial.println("Enrolling Successful");
74122
}
75123
else
76124
{

0 commit comments

Comments
 (0)