Interfacing an FPS-GT511C1R with Arduino Pro Mini

Hi to everyone, my name is Neil and i’m building a device courtesy:

I was able to get the FPS to blink its blue LED, and enroll & identify 2 thumbprints using the example codes from the C3 library, however the code for the device is not recognizing the prints and is not turning on like it should be. There is a relay that should get continuity when turned on and no continuity when turned off. I need the code to set digital pin10 to HIGH when the FPS recognizes the enrolled print while the handle is being grabbed. It should stay HIGH (including after the handle has been released) until the FPS recognizes an enrolled print while the handle is being grabbed again. Any help would be much appreciated.

Below is the code the original creator provided at the site above.

/*
FPS library created by Josh Hawley, July 23rd 2013
Licensed for non-commercial use, must include this license message
basically, Feel free to hack away at it, but just give me credit for my work =)
TLDR; Wil Wheaton’s Law
*/

#include “FPS_GT511C3.h”
#include “SoftwareSerial.h”

FPS_GT511C3 fps(4, 5);

int touch = 0;
int capPin = 9;
int flag = 0;

void setup() {
Serial.begin(9600);
fps.UseSerialDebug = true; // so you can see the messages in the serial debug screen
fps.Open();
pinMode(10, OUTPUT);
digitalWrite(10, LOW);
pinMode(capPin, INPUT_PULLUP);
}

void loop() {
touch = digitalRead(capPin);
//Serial.println(touch);
delay(1000);
if ((touch == 0) && flag == 0) {
digitalWrite(10, HIGH);
fps.SetLED(true);
if (fps.IsPressFinger()) {
fps.CaptureFinger(false);
int id = fps.Identify1_N();
if (id<200) { //Don’t care which fingerprint matches, just as long as there is a match
digitalWrite(10, LOW);
fps.SetLED(false);
flag = 1;
}
}

}
else {
fps.SetLED(false);
digitalWrite(10, LOW);
}
if ((touch == 1) && flag == 1) { //Reset the flag after the hammer has been lifted to return to normal behavior
flag = 0;
}
}

What is a "FPS-GT511C1R" ? Please post a link to its datasheet.

It is generally too tedious to read the Instructables website.

...R

OOPs. Here is the Datasheet link:

If that one doesn't work you can find it here:

The Sparkfun website seems to have some example code. Is that what you have posted above?

If not, have you tried their examples? With what result?

...R

Yes I used the sparkfun examples, and they all work for me fine. The light blinked, and I was able to enroll 2 thumbprints and identify them both. I'm unable to get the device to work though. The code above should turn the device on when the handle is grabbed(touch=0) and when a print is recognized(flag=0). I believe the code lines ((touch = 0) && flag = 0) and ((touch = 1) && flag = 1) is the function that turns it on and off.

neiljams:
Yes I used the sparkfun examples, and they all work for me fine. The light blinked, and I was able to enroll 2 thumbprints and identify them both. I'm unable to get the device to work though.

I hope you will see why the words I have highlighted leave me confused.

You will need to have another go at explaining what the problem is.

If you mean that one program works and another does not then I suggest you use the working program as the starting point for your project.

...R

I'm super sorry :o I thought I provided adequate enough information to receive a constructive and helpful response. I know this might be tedious but if you could please go to the instructable link provided in my original post. He has provided all you'll need to better understand the device and code. I am extremely new to programming so ill try and give the best explanation of my problem I can below.

SCENARIO: The Device is a magnetic hammer that should magnetize when I set it down. It does this by turning on a relay (the magnet is connected to) when a combination of the handle sensing touch capacitance when I grab it and a verified thumbprint scan from the FPS. It should demagnetize when again a combination of the handle senses touch capacitance and a verified thumbprint is scanned from the FPS.

MY PROBLEM: Digital Pin 10 isn't staying high when the above conditions are met.

I've tried rearranging some code lines and was able to get Digital Pin 10 to HIGH when the above conditions were met, but was unable to get it to go back to LOW.

neiljams:
I'm super sorry :o I thought I provided adequate enough information

You have missed the point of my comment in Reply #5 - which may be my fault.

You said (in Reply #4) that something worked. And in the same Reply you said that something does not work. But you have not clearly explained what works what does not work. If they are two programs then post both of them so we can see what is different.

You say you are using a relay. What sort of relay (link to datasheet, please) and how have you connected it to your Arduino. If it is an electromechanical relay an Arduino cannot proide enough current to power it directly, and if you are trying that it may be making the Arduino misbehave.

Also, telling us "I've tried rearranging some code lines" is meaningless without seeing the program with the changes.

And, sorry, I am not going to wade through the Instructables website. It just takes too long and I would prefer to use my limited time with questions and information made available on this Forum. You should also be aware that some Instructables projects don't work.

...R

@neiljams: Thanks for your "report to moderator": please read the earlier replies, and the clearly-posted forum posting guidelines.

i'm building a device courtesy:

Please, do the rest of us the courtesy of reading the clearly-posted guidelines at the top of just about every section of the forum, particularly the bit about code tags.

I've tried rearranging some code lines and was able to get Digital Pin 10 to HIGH when the above conditions were met, but was unable to get it to go back to LOW.

But you didn't think we'd want to see either your code or your observations?

Please understand that Instructables have a very low reputation; people here are reluctant to read them.