GT-511C1R Fingerprint Scanner

Hello. I am trying to get my GT-511C1R fingerprint scanner (found here https://www.sparkfun.com/products/13007 ) to work with my photon. I was wondering if someone could give me a hand with getting the library switched over along with the wiring for this. Any help is much appreciated. Thank you!

Have you tried the library already?

I gave a quick look and it all seems straight fwd… Only might need some pin adjustments but…

@nbmoretto, first things first. I suggest you power the module via Vin (ie USB power) since the photon’s onboard 3.3V regulator won’t produce enough extra current to power it. You will be able to use the photon’s Serial1 port for communications. From what I can find, the connections between the module and the photon should be:

Pin    GT-511C1R     Photon
1         TX           RX
2         RX           TX
3         GND          GND
4         Vin (5v)     Vin (5v)

The library pointed to on the Adafruit page is designed to work with Software Serial which is not supported on the Photon. So the code needs to be changed to use Serial1. I’ll have the modified library up shortly on my github page, untested mind you!

UPDATE: Here is the link to the modified library!

2 Likes

Thank you so much for your help. I will be giving this a go and post back with my results.

1 Like

So in the example code you initiate the scanner with the following line:

FPS_GT511C3 fps(4, 5);

The 4/5 are the pins for the RX and TX for SoftwareSerial. However in your library you replaced the code with

FPS_GT511C3(void);

So when initiating it should I just use the line:

FPS_GT511C3 fps();

And connect the RX and TX to the according serial pins on the photon?

EDIT: I did not see your edited example files, giving them a go now.

I’d say so (but without the () - just FPS_GT511C3 fps;), since you can’t assign any other pins then RX/TX anyhow, there is no need to pass them into the function.
You can also look in the examples in Paul’s repo, they have been adapted to work with the Photon port.

But as Paul mentioned, you need to cross RX -> TX and TX -> RX.

@peekay123 after some troubleshooting on my end your code worked perfectly! Thank you so much for your help, it is much appreciated. One quick comment, in your .cpp file on line 11 you need to remove the ;

Other than that this is working great!

1 Like

@nbmoretto I’ve made a simple pull-request to remove the semi-colon here :smile:

Anyone still using the fingerprint scanner? I have the http://www.robotshop.com/ca/en/fingerprint-scanner-5v-ttl.html

The datasheet http://www.robotshop.com/media/files/pdf/datasheet-sen-11792.pdf suggests that

Red 3.3V (Max 6V)
Black =GDN
Yellow = RX
Green TX

As per normal I have a few issues. I have loaded both fingerprint.ino and enroll.ino from the library ADAFRUIT_FINGERPRINT, using the "Use this Example" neither compile, can't seem to find the .h file. I can get around this by loading both the .cpp and .h files onto the particle.ide.

Seems to have a password issue. With the .h and .cpp files in the particle IDE .

Adafruit_Fingerprint/Adafruit_Fingerprint.cpp:56:36: warning: narrowing conversion of '(((Adafruit_Fingerprint*)this)->Adafruit_Fingerprint::thePassword >> 24)' from 'uint32_t {aka long unsigned int}' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]
(thePassword >> 24), (thePassword >> 16),

Looks like the code wants some kind of a password, but I got nothing with the scanner about this. Any suggestions.

If anyone is curious other than @peekay123. Here are the error messaqges straight from loading the files from the library with the "Use This example".

enroll.ino say

enroll.cpp:19:55: fatal error: Adafruit_Fingerprint/Adafruit_Fingerprint.h: No such file or directory
void setup();
^

compilation terminated.
make[1]: *** [../build/target/user/platform-6enroll.o] Error 1
make: *** [user] Error 2

fingerprint.ino say

fingerprint.cpp: In function 'uint8_t getFingerprintID()':
fingerprint.cpp:135:1: warning: control reaches end of non-void function [-Wreturn-type]
return p;
^
Adafruit_Fingerprint/Adafruit_Fingerprint.cpp: In member function 'boolean Adafruit_Fingerprint::verifyPassword()':
Adafruit_Fingerprint/Adafruit_Fingerprint.cpp:56:36: warning: narrowing conversion of '(((Adafruit_Fingerprint*)this)->Adafruit_Fingerprint::thePassword >> 24)' from 'uint32_t {aka long unsigned int}' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]
(thePassword >> 24), (thePassword >> 16),
^
Adafruit_Fingerprint/Adafruit_Fingerprint.cpp:56:57: warning: narrowing conversion of '(((Adafruit_Fingerprint*)this)->Adafruit_Fingerprint::thePassword >> 16)' from 'uint32_t {aka long unsigned int}' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]
(thePassword >> 24), (thePassword >> 16),
^
Adafruit_Fingerprint/Adafruit_Fingerprint.cpp:57:36: warning: narrowing conversion of '(((Adafruit_Fingerprint*)this)->Adafruit_Fingerprint::thePassword >> 8)' from 'uint32_t {aka long unsigned int}' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]
(thePassword >> 8), thePassword};
^
Adafruit_Fingerprint/Adafruit_Fingerprint.cpp:57:54: warning: narrowing conversion of '((Adafruit_Fingerprint*)this)->Adafruit_Fingerprint::thePassword' from 'uint32_t {aka long unsigned int}' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]
(thePassword >> 8), thePassword};
^
Adafruit_Fingerprint/Adafruit_Fingerprint.cpp: In member function 'uint8_t Adafruit_Fingerprint::storeModel(uint16_t)':
Adafruit_Fingerprint/Adafruit_Fingerprint.cpp:107:51: warning: narrowing conversion of '(((int)id) >> 8)' from 'int' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]
uint8_t packet = {FINGERPRINT_STORE, 0x01, id >> 8, id & 0xFF};
^
Adafruit_Fingerprint/Adafruit_Fingerprint.cpp:107:60: warning: narrowing conversion of '(((int)id) & 255)' from 'int' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]
uint8_t packet = {FINGERPRINT_STORE, 0x01, id >> 8, id & 0xFF};
^
Adafruit_Fingerprint/Adafruit_Fingerprint.cpp: At global scope:
This looks like an error in Adafruit_Fingerprint library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
Adafruit_Fingerprint/Adafruit_Fingerprint.cpp:117:54: error: no 'uint8_t Adafruit_Fingerprint::deleteModel(uint16_t)' member function declared in class 'Adafruit_Fingerprint'
uint8_t Adafruit_Fingerprint::deleteModel(uint16_t id) {
^

make[1]: *** [../build/target/user/platform-6Adafruit_Fingerprint/Adafruit_Fingerprint.o] Error 1
make: *** [user] Error 2
Error: Could not compile. Please review your code.

@rocksetta, the unit you have is a Sparkfun unit and not from Adafruit. The correct library to use is the one I listed in a previous post (above). :wink:

1 Like

This looks better https://github.com/pkourany/FPS_GT511C3_Library

@peekay123

From the .ino file at https://github.com/pkourany/FPS_GT511C3_Library/blob/master/Examples/FPS_IDFinger/FPS_IDFinger.ino it says

// Hardware setup - FPS connected to:
// digital pin 4(arduino rx, fps tx)
// digital pin 5(arduino tx - 560ohm resistor fps tx - 1000ohm resistor - ground)
// this brings the 5v tx line down to about 3.2v so we dont fry our fps

I assume that if I power the Fingerprint scanner with 3.3V I do not have to use the resistors. Does that make any sense

@rocksetta, you could not use the Photon’s 3V3 supply since the fingerprint unit uses more than 100ma. Can still power via Vin (5V) and connect to TX/RX without shifter as I believe these pins are 5V tolerant and I’ve never had any issues (@BDub?). You could also power both the Photon and the unit with a separate 3.3v supply capable of the necessary current (750ma just to be sure).

@peekay123

Can still power via Vin (5V) and connect to TX/RX without shifter as I believe these pins are 5V tolerant and I've never had any issues (@BDub?). You could also power both the Photon and the unit with a separate 3.3v supply capable of the necessary current (750ma just to be sure).

That means the photon is protected but using VIn still does not protect the FPS (fingerprint scanner) I think I may have to use the resistors or the other 3.3 power supply

I believe the theory was that you’d power using USB and use the VIN pin on the Photon as a power output. It can source about 4.8 volts at 1A, well within the capabilities of the sensor (3.3V to 6V at < 130 mA). Since most of the IO pins are 5V tolerant in digital mode in INPUT mode (with no internal pull-ups or pull-downs) you should be all set with no level shifters or resistors. Or at least that how I would hook it up.

3 Likes

The Photon pins are 5V tolerant but don't output 5V, so no danger from this end either.

1 Like

@peekay123

I previously found (from left to right) this info:

But this part of one .ino file says (which I think is for the spark)

**// Hardware setup - FPS connected to:
// digital pin 4(arduino rx, fps tx)
// digital pin 5(arduino tx - 560ohm resistor fps tx - 1000ohm resistor - ground)
// this brings the 5v tx line down to about 3.2v so we dont fry our fps
**

Then in the FPS_Enro.ino at https://github.com/pkourany/FPS_GT511C3_Library/blob/master/Examples/FPS_Enroll/FPS_Enroll.ino it says

Hardware setup - FPS connected to:
Pin.........GT-511C1R.... Photon
1............TX ...................RX
2............ RX...................TX
3.............GND................GND
4...........Vin (5v).............Vin (5v)

So it looks like my photon needs to connect (From Image left to right)

FPS Green =TX ......... Photon RX
FPS Yellow = RX ........ Photon TX
FPS Black = GND....... common ground
FPS Red = 3.3V ...... external 3.3 V battery

That all seems to make sense so I am going to give it a try.

If I get the RX and TX mixed up are we talking a puff of magic smoke or is it not a big deal?

Thanks @ScruffR the Photon VIN was the best voltage source to use. This is really cool. I can send the information to Google Spreadsheets using IFTTT to make an attendance tracker for my classroom.

@peekay123 I am going to fork the library and get it ready to publish for the particle IDE. Would you like me to do a pull request for you to publish or just publish it myself?

1 Like

@rocksetta, if you intend on maintaining the library then please go ahead. Otherwise, post a PR and I’ll publish. Before that happens though, we should make sure the library works will all Particle supported devices if possible.

I will just do a PR since I don't have an electron.

Strange device, took forever to get it to read my fingerprint the first time when I was doing the enrollment. It had lots of errors etc. Then it seemed to become really fast, not really sure why. Almost like it had to warm-up first.

Thanks for porting the library.

Here are my Google Docs Sheets. The red box has a fairly complex equation to isolate the last time entry for the students fingerprint scan.

=index(filter(Sheet1!A$1:C$200, Sheet1!A$1:A$200 = A2),count(filter(Sheet1!A$1:C$200, Sheet1!A$1:A$200 = A2)))

Here is the sheet that is uploaded from the photon using IFTTT

Here is the class names sheet which matches the ID's to the student names.

1 Like