Skip to content

Commit 26732e0

Browse files
authored
Merge pull request #46 from sparkfun/bboyho-FPS_IDFinger-patch-1
Update FPS_IDFinger.ino
2 parents c15fc44 + 1f8cabc commit 26732e0

File tree

1 file changed

+61
-16
lines changed

1 file changed

+61
-16
lines changed
Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,91 @@
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)
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
77
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+
*****************************************************************/
1044

1145
#include "FPS_GT511C3.h"
1246
#include "SoftwareSerial.h"
1347

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*/
1857

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

2162
void setup()
2263
{
23-
Serial.begin(9600);
64+
Serial.begin(9600); //set up Arduino's hardware serial UART
2465
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
2768
}
2869

2970
void loop()
3071
{
31-
3272
// Identify fingerprint test
3373
if (fps.IsPressFinger())
3474
{
3575
fps.CaptureFinger(false);
3676
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 */
3782
if (id <200)
38-
{
83+
{//if the fingerprint matches, provide the matching template ID
3984
Serial.print("Verified ID:");
4085
Serial.println(id);
4186
}
4287
else
43-
{
88+
{//if unable to recognize
4489
Serial.println("Finger not found");
4590
}
4691
}
@@ -49,4 +94,4 @@ void loop()
4994
Serial.println("Please press finger");
5095
}
5196
delay(100);
52-
}
97+
}

0 commit comments

Comments
 (0)