|
1 |
| -/* |
| 1 | +/***************************************************************** |
2 | 2 | FPS_Enroll.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 | + 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 -------------------- |
8 | 19 |
|
| 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 | +*****************************************************************/ |
9 | 51 |
|
10 | 52 | #include "FPS_GT511C3.h"
|
11 | 53 | #include "SoftwareSerial.h"
|
12 | 54 |
|
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) |
17 | 59 |
|
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) |
19 | 68 |
|
20 | 69 | void setup()
|
21 | 70 | {
|
22 |
| - Serial.begin(9600); |
| 71 | + Serial.begin(9600); //set up Arduino's hardware serial UART |
23 | 72 | 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 |
26 | 75 |
|
27 |
| - Enroll(); |
| 76 | + Enroll(); //begin enrolling fingerprint |
28 | 77 | }
|
29 | 78 |
|
30 |
| - |
31 | 79 | void Enroll()
|
32 | 80 | {
|
33 | 81 | // Enroll test
|
@@ -70,7 +118,7 @@ void Enroll()
|
70 | 118 | iret = fps.Enroll3();
|
71 | 119 | if (iret == 0)
|
72 | 120 | {
|
73 |
| - Serial.println("Enrolling Successfull"); |
| 121 | + Serial.println("Enrolling Successful"); |
74 | 122 | }
|
75 | 123 | else
|
76 | 124 | {
|
|
0 commit comments