1
- /*
2
- FPS_Enroll .ino - Library example for controlling the GT-511C3 Finger Print Scanner (FPS)
1
+ /* ****************************************************************
2
+ FPS_IDFinger .ino - Library example for controlling the GT-511C3 Finger Print Scanner (FPS)
3
3
Created by Josh Hawley, July 23rd 2013
4
4
Licensed for non-commercial use, must include this license message
5
5
basically, Feel free to hack away at it, but just give me credit for my work =)
6
6
TLDR; Wil Wheaton's Law
7
7
8
- This sketch will attempt to identify a previously enrolled fingerprint.
9
- */
8
+ Description: This sketch will attempt to identify a previously enrolled fingerprint
9
+ saved in its database.
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 --------------------
19
+ 1.) Dedicated Bi-Directional Logic Level Converter (LLC)
20
+ It is recommended to use a dedicated bi-direcitonal LLC
21
+ [ https://www.sparkfun.com/products/12009 ] for a reliable connection if you
22
+ are using a 5V Arduino microcontroller:
23
+ Fingerprint Scanner (Pin #) <-> Logic Level Converter <-> 5V Arduino w/ Atmega328P
24
+ UART_TX (3.3V TTL)(Pin 1) <-> LV1 <-> HV1 <-> RX (pin 4)
25
+ UART_RX (3.3V TTL)(Pin 2) <-> LV4 <-> HV4 <-> TX (pin 5)
26
+ GND (Pin 3) <-> GND <-> GND <-> GND
27
+ Vin (3.3V~6V) (Pin 4) <-> HV <-> 5V
28
+ LV <-> 3.3V
29
+
30
+ 2.) Voltage Division w/ 3x 10kOhm Resistors
31
+ Otherwise, you could use 3x 10kOhm resistors [ https://www.sparkfun.com/products/11508 ]
32
+ to divide the voltage from a 5V Arduino down to 3.3V FPS similar to the
33
+ "Uni-Directional" application circuit on our old logic level converter
34
+ [ https://cdn.sparkfun.com/assets/b/0/e/1/0/522637c6757b7f2b228b4568.png ]:
35
+ Voltage Divider <-> Fingerprint Scanner(Pin #) <-> Voltage Divider <-> 5V Arduino w/ Atmega328P
36
+ <-> UART_TX (3.3V TTL) (Pin 1) <-> <-> RX (pin 4)
37
+ GND <-> 10kOhm <-> 10kOhm <-> UART_RX (3.3V TTL) (Pin 2) <-> 10kOhm <-> TX (pin 5)
38
+ GND <-> GND (Pin 3) <-> GND <-> GND
39
+ <-> Vin (3.3V~6V) (Pin 4) <-> <-> 5V
40
+
41
+ Note: You can add the two 10kOhm resistors in series for 20kOhms. =)
42
+ --------------------------------------------------------------------------------
43
+ *****************************************************************/
10
44
11
45
#include " FPS_GT511C3.h"
12
46
#include " SoftwareSerial.h"
13
47
14
- // Hardware setup - FPS connected to:
15
- // digital pin 4(arduino rx, fps tx)
16
- // digital pin 5(arduino tx - 560ohm resistor fps tx - 1000ohm resistor - ground)
17
- // this brings the 5v tx line down to about 3.2v so we dont fry our fps
48
+ // set up software serial pins for Arduino's w/ Atmega328P's
49
+ // FPS (TX) is connected to pin 4 (Arduino's Software RX)
50
+ // FPS (RX) is connected through a converter to pin 5 (Arduino's Software TX)
51
+ FPS_GT511C3 fps (4 , 5 ); // (Arduino SS_RX = pin 4, Arduino SS_TX = pin 5)
52
+
53
+ /* If using another Arduino microcontroller, try commenting out line 51 and
54
+ uncommenting line 60 due to the limitations listed in the
55
+ library's note => https://www.arduino.cc/en/Reference/softwareSerial . Do
56
+ not forget to rewire the connection to the Arduino*/
18
57
19
- FPS_GT511C3 fps (4 , 5 );
58
+ // FPS (TX) is connected to pin 10 (Arduino's Software RX)
59
+ // FPS (RX) is connected through a converter to pin 11 (Arduino's Software TX)
60
+ // FPS_GT511C3 fps(10, 11); // (Arduino SS_RX = pin 10, Arduino SS_TX = pin 11)
20
61
21
62
void setup ()
22
63
{
23
- Serial.begin (9600 );
64
+ Serial.begin (9600 ); // set up Arduino's hardware serial UART
24
65
delay (100 );
25
- fps.Open ();
26
- fps.SetLED (true );
66
+ fps.Open (); // send serial command to initialize fps
67
+ fps.SetLED (true ); // turn on LED so fps can see fingerprint
27
68
}
28
69
29
70
void loop ()
30
71
{
31
-
32
72
// Identify fingerprint test
33
73
if (fps.IsPressFinger ())
34
74
{
35
75
fps.CaptureFinger (false );
36
76
int id = fps.Identify1_N ();
77
+
78
+ /* Note : GT-511C3 can hold 200 fingerprint templates.
79
+ GT-511C1R can hold 20 fingerprint templates.
80
+ Make sure to change the id depending on what
81
+ model you are using */
37
82
if (id <200 )
38
- {
83
+ {// if the fingerprint matches, provide the matching template ID
39
84
Serial.print (" Verified ID:" );
40
85
Serial.println (id);
41
86
}
42
87
else
43
- {
88
+ {// if unable to recognize
44
89
Serial.println (" Finger not found" );
45
90
}
46
91
}
@@ -49,4 +94,4 @@ void loop()
49
94
Serial.println (" Please press finger" );
50
95
}
51
96
delay (100 );
52
- }
97
+ }
0 commit comments