Skip to content

Commit c15fc44

Browse files
authored
Merge pull request #45 from sparkfun/bboyho-FPS_Enroll-patch-1
Update FPS_Enroll.ino
2 parents debc44f + fc8f3d8 commit c15fc44

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)