Microcontroller › Arduino › Why does arduino shows “fingerprint sensor not found” even after connecting the fingerprint module properly?
- This topic has 9 replies, 6 voices, and was last updated 8 years, 9 months ago by Muhammad Muaaz Khan.
-
AuthorPosts
-
March 24, 2014 at 2:18 pm #2980HemaliParticipant
Hi. I am final year cse student. We are creating a project “secured login through fingerprint module” wherein we can login in any website without typing password , directly through fingerprint. Now the problem is our arduino is not detecting the fingerprint module. It always shows “fingerprint sensor not found ” can anyone pls help me? I am new to arduino and I have no idea regarding how it works. Please help
March 24, 2014 at 5:27 pm #11375Ganesh SelvarajParticipantWe need you to give us more details about this, like what type of module you are using,etc. And the code too. Then only we will be able to help.
March 25, 2014 at 5:01 am #11380HemaliParticipantwe are using arduino uno and fingerprint sensor 1125.
our code is as follows….the underlined part is always coming as an output….any idea whats wrong withg this code?
#include <Adafruit_Fingerprint.h>
#if ARDUINO >= 100
#include <SoftwareSerial.h>
#else
#include <NewSoftSerial.h>
#endifuint8_t getFingerprintEnroll(uint8_t id);
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino (WHITE wire)
#if ARDUINO >= 100
SoftwareSerial mySerial(2, 3);
#else
NewSoftSerial mySerial(2, 3);
#endifAdafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
void setup()
{
Serial.begin(9600);
Serial.println(“fingertest”);// set the data rate for the sensor serial port
finger.begin(57600);
if (finger.verifyPassword()) {
Serial.println(“Found fingerprint sensor!”);
} else {
Serial.println(“Did not find fingerprint sensor “);
while (1);
}
}void loop() // run over and over again
{
Serial.println(“Type in the ID # you want to save this finger as…”);
uint8_t id = 0;
while (true) {
while (! Serial.available());
char c = Serial.read();
if (! isdigit(c)) break;
id *= 10;
id += c – ‘0’;
}
Serial.print(“Enrolling ID #”);
Serial.println(id);
while (! getFingerprintEnroll(id) );
}uint8_t getFingerprintEnroll(uint8_t id) {
uint8_t p = -1;
Serial.println(“Waiting for valid finger to enroll”);
while (p != FINGERPRINT_OK) {
p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
Serial.println(“Image taken”);
break;
case FINGERPRINT_NOFINGER:
Serial.println(“.”);
break;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println(“Communication error”);
break;
case FINGERPRINT_IMAGEFAIL:
Serial.println(“Imaging error”);
break;
default:
Serial.println(“Unknown error”);
break;
}
}// OK success!
p = finger.image2Tz(1);
switch (p) {
case FINGERPRINT_OK:
Serial.println(“Image converted”);
break;
case FINGERPRINT_IMAGEMESS:
Serial.println(“Image too messy”);
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println(“Communication error”);
return p;
case FINGERPRINT_FEATUREFAIL:
Serial.println(“Could not find fingerprint features”);
return p;
case FINGERPRINT_INVALIDIMAGE:
Serial.println(“Could not find fingerprint features”);
return p;
default:
Serial.println(“Unknown error”);
return p;
}
Serial.println(“Remove finger”);
delay(2000);
p = 0;
while (p != FINGERPRINT_NOFINGER) {
p = finger.getImage();
}p = -1;
Serial.println(“Place same finger again”);
while (p != FINGERPRINT_OK) {
p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
Serial.println(“Image taken”);
break;
case FINGERPRINT_NOFINGER:
Serial.print(“.”);
break;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println(“Communication error”);
break;
case FINGERPRINT_IMAGEFAIL:
Serial.println(“Imaging error”);
break;
default:
Serial.println(“Unknown error”);
break;
}
}// OK success!
p = finger.image2Tz(2);
switch (p) {
case FINGERPRINT_OK:
Serial.println(“Image converted”);
break;
case FINGERPRINT_IMAGEMESS:
Serial.println(“Image too messy”);
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println(“Communication error”);
return p;
case FINGERPRINT_FEATUREFAIL:
Serial.println(“Could not find fingerprint features”);
return p;
case FINGERPRINT_INVALIDIMAGE:
Serial.println(“Could not find fingerprint features”);
return p;
default:
Serial.println(“Unknown error”);
return p;
}
// OK converted!
p = finger.createModel();
if (p == FINGERPRINT_OK) {
Serial.println(“Prints matched!”);
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println(“Communication error”);
return p;
} else if (p == FINGERPRINT_ENROLLMISMATCH) {
Serial.println(“Fingerprints did not match”);
return p;
} else {
Serial.println(“Unknown error”);
return p;
}
p = finger.storeModel(id);
if (p == FINGERPRINT_OK) {
Serial.println(“Stored!”);
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println(“Communication error”);
return p;
} else if (p == FINGERPRINT_BADLOCATION) {
Serial.println(“Could not store in that location”);
return p;
} else if (p == FINGERPRINT_FLASHERR) {
Serial.println(“Error writing to flash”);
return p;
} else {
Serial.println(“Unknown error”);
return p;
}
}
April 24, 2015 at 6:28 pm #12829bhargav04Participantu can check the connetion….Rx,Tx,VCC and Gnd…
Then it will work..
May 17, 2015 at 8:00 am #12897howParticipantSame project….the program can run and detect the fingerprint . but after the program run a few mins it can detect the fingerprint sensor
May 17, 2015 at 8:02 am #12898howParticipantWhen u reopen the serial monitor it run again. What the problem????
May 18, 2015 at 9:14 am #12902howParticipantsame project……..using arduino mega………the program can runand the fingerprint can detected. but after the program run a few mins , the fingerprint cannot be detected. after reopen the serial monitar the program again……………….wat the problems??????
May 18, 2015 at 9:16 am #12903howParticipantsame project……..using arduino mega………the program can runand the fingerprint can detected. but after the program run a few mins , the fingerprint cannot be detected. after reopen the serial monitar the program again……………….wat the problems??????
April 26, 2016 at 12:03 pm #13898SAI VISWANADH KINTALIParticipantIm using R305 FINGERPRINT SENSOR and ARDUINO UNO. Im facing the same issue. can anyone help me with this..?
And the code is :
#include <Adafruit_Fingerprint.h> #include <SoftwareSerial.h> int getFingerprintIDez(); // pin #2 is IN from sensor (GREEN wire) // pin #3 is OUT from arduino (WHITE wire) SoftwareSerial mySerial(2, 3); Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial); // On Leonardo/Micro or others with hardware serial, use those! #0 is green wire, #1 is white //Adafruit_Fingerprint finger = Adafruit_Fingerprint(&Serial1); void setup() { while (!Serial); // For Yun/Leo/Micro/Zero/… Serial.begin(9600); Serial.println("Adafruit finger detect test"); // set the data rate for the sensor serial port finger.begin(57600); if (finger.verifyPassword()) { Serial.println("Found fingerprint sensor!"); } else { Serial.println("Did not find fingerprint sensor "); while (1); } Serial.println("Waiting for valid finger…"); } void loop() // run over and over again { getFingerprintIDez(); delay(50); //don't ned to run this at full speed. } uint8_t getFingerprintID() { uint8_t p = finger.getImage(); switch (p) { case FINGERPRINT_OK: Serial.println("Image taken"); break; case FINGERPRINT_NOFINGER: Serial.println("No finger detected"); return p; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); return p; case FINGERPRINT_IMAGEFAIL: Serial.println("Imaging error"); return p; default: Serial.println("Unknown error"); return p; } // OK success! p = finger.image2Tz(); switch (p) { case FINGERPRINT_OK: Serial.println("Image converted"); break; case FINGERPRINT_IMAGEMESS: Serial.println("Image too messy"); return p; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); return p; case FINGERPRINT_FEATUREFAIL: Serial.println("Could not find fingerprint features"); return p; case FINGERPRINT_INVALIDIMAGE: Serial.println("Could not find fingerprint features"); return p; default: Serial.println("Unknown error"); return p; } // OK converted! p = finger.fingerFastSearch(); if (p == FINGERPRINT_OK) { Serial.println("Found a print match!"); } else if (p == FINGERPRINT_PACKETRECIEVEERR) { Serial.println("Communication error"); return p; } else if (p == FINGERPRINT_NOTFOUND) { Serial.println("Did not find a match"); return p; } else { Serial.println("Unknown error"); return p; } // found a match! Serial.print("Found ID #"); Serial.print(finger.fingerID); Serial.print(" with confidence of "); Serial.println(finger.confidence); } // returns -1 if failed, otherwise returns ID # int getFingerprintIDez() { uint8_t p = finger.getImage(); if (p != FINGERPRINT_OK) return –1; p = finger.image2Tz(); if (p != FINGERPRINT_OK) return –1; p = finger.fingerFastSearch(); if (p != FINGERPRINT_OK) return –1; // found a match! Serial.print("Found ID #"); Serial.print(finger.fingerID); Serial.print(" with confidence of "); Serial.println(finger.confidence); return finger.fingerID;
}
April 26, 2016 at 6:48 pm #13899Muhammad Muaaz KhanParticipantPlease Can any one help me on this code I am working with PIC 16F877A controller On mikroC compiler. My code work right but i it not stop while loop(1) when I pressed switch PORTD.F2 can any one tell me how I stop it and how I am going to Exit from whole loop(1) when I pressed PORTD.F2 == 0
void main()
{
TRISD.F0 = 1; //Configure 1st bit of PORTD as input
TRISD.F1 = 1; //Configure 1st bit of PORTD as input
TRISD.F2 = 1; //Configure 1st bit of PORTD as input
TRISD.F3 = 1; //Configure 1st bit of PORTD as input
TRISB.F0 = 0; //Makes PORTB0 or RB0 Output Pin
TRISB.F1 = 0; //Makes PORTB1 or RB0 Output Pin
TRISB.F2 = 0; //Makes PORTB0 or RB0 Output Pin
TRISB.F3 = 0; //Makes PORTB1 or RB0 Output Pin
TRISB.F4 = 0; //Makes PORTB0 or RB0 Output Pin
TRISB.F5 = 0; //Makes PORTB1 or RB0 Output Pin
TRISB.F6 = 0; //Makes PORTB0 or RB0 Output Pin
TRISB.F7 = 0; //Makes PORTB1 or RB0 Output Pin
while(1) //Infinite Loop
{
if(PORTD.F1 == 0) //If the switch is pressed
{
PORTB.F0 = 1; //LED ON
PORTB.F1 = 0; //LED OFF
PORTB.F2 = 0; //LED OFF
PORTB.F3 = 1; //LED OFF
PORTB.F4 = 1; //LED ON
PORTB.F5 = 0; //LED OFF
PORTB.F6 = 0; //LED OFF
PORTB.F7 = 1; //LED ON
Delay_ms(2000); //1 Second Delay
PORTB.F0 = 0; //LED OFF
PORTB.F3 = 0; //LED OFF
PORTB.F4 = 0; //LED OFF
PORTB.F5 = 0; //LED OFF
PORTB.F6 = 0; //LED OFF
PORTB.F7 = 0; //LED OFF
}
if(PORTD.F0 == 0) //If the switch is pressed
{
PORTB.F1 = 1; //LED ON
PORTB.F0 = 0; //LED OFF
PORTB.F2 = 1; //LED ON
PORTB.F3 = 0; //LED OFF
PORTB.F4 = 0; //LED OFF
PORTB.F5 = 1; //LED ON
PORTB.F6 = 1; //LED ON
PORTB.F7 = 0; //LED OFF
Delay_ms(2000); //1 Second Delay
PORTB.F1 = 0; //LED OFF
PORTB.F2 = 0; //LED OFF
PORTB.F3 = 0; //LED OFF
PORTB.F4 = 0; //LED OFF
PORTB.F5 = 0; //LED OFF
PORTB.F6 = 0; //LED OFF
PORTB.F7 = 0; //LED OFF
}
if(PORTD.F3 == 0) //If the switch is pressed
{
PORTB.F0 = 0; //LED OFF
PORTB.F1 = 0; //LED OFF
PORTB.F2 = 0; //LED OFF
PORTB.F3 = 0; //LED OFF
PORTB.F4 = 0; //LED OFF
PORTB.F5 = 0; //LED OFF
PORTB.F6 = 0; //LED OFF
PORTB.F7 = 0; //LED OFF
Delay_ms(5000); //1 Second Delay
}
if(PORTD.F2 == 0) //If the switch is pressed
{
while(1) //Infinite Loop
{
PORTB.F0 = 0; //LED OFF
PORTB.F1 = 1; //LED ON
PORTB.F2 = 0; //LED OFF
PORTB.F3 = 0; //LED OFF
PORTB.F4 = 0; //LED OFF
PORTB.F5 = 0; //LED OFF
PORTB.F6 = 0; //LED OFF
PORTB.F7 = 0; //LED ON
Delay_ms(500); //1 Second Delay
PORTB.F3 = 1; //LED ON
PORTB.F0 = 0; //LED OFF
PORTB.F1 = 1; //LED ON
PORTB.F2 = 0; //LED OFF
PORTB.F4 = 0; //LED OFF
PORTB.F5 = 0; //LED OFF
PORTB.F6 = 0; //LED OFF
PORTB.F7 = 0; //LED OFF
Delay_ms(1000); //1 Second Delay
PORTB.F0 = 1; //LED ON
PORTB.F1 = 0; //LED OFF
PORTB.F2 = 1; //LED ON
PORTB.F3 = 0; //LED OFF
PORTB.F4 = 0; //LED OFF
PORTB.F5 = 0; //LED OFF
PORTB.F6 = 0; //LED OFF
PORTB.F7 = 0; //LED OFF
Delay_ms(100); //1 Second Delay Both legs are off
PORTB.F0 = 0; //LED OFF
PORTB.F1 = 0; //LED OFF
PORTB.F2 = 0; //LED OFF
PORTB.F3 = 0; //LED OFF
PORTB.F4 = 0; //LED OFF
PORTB.F5 = 0; //LED OFF
PORTB.F6 = 0; //LED OFF
PORTB.F7 = 0; //LED OFf
Delay_ms(500); //1 Second Delay second leg Left leg
PORTB.F0 = 0; //LED OFF
PORTB.F1 = 0; //LED OFF
PORTB.F2 = 0; //LED OFF
PORTB.F3 = 0; //LED OFF
PORTB.F4 = 0; //LED OFF
PORTB.F5 = 1; //LED ON
PORTB.F6 = 0; //LED OFF
PORTB.F7 = 0; //LED OFF
Delay_ms(500); //1 Second Delay
PORTB.F0 = 0; //LED OFF
PORTB.F1 = 0; //LED OFF
PORTB.F2 = 0; //LED OFF
PORTB.F3 = 0; //LED OFF
PORTB.F4 = 0; //LED OFF
PORTB.F5 = 1; //LED ON
PORTB.F6 = 0; //LED OFF
PORTB.F7 = 1; //LED ON
Delay_ms(1000); //1 Second Delay
PORTB.F0 = 0; //LED OFF
PORTB.F1 = 0; //LED OFF
PORTB.F2 = 0; //LED OFF
PORTB.F3 = 0; //LED OFF
PORTB.F4 = 1; //LED ON
PORTB.F5 = 0; //LED OFF
PORTB.F6 = 1; //LED ON
PORTB.F7 = 0; //LED OFF
Delay_ms(100); //1 Second Delay Both legs are off
PORTB.F0 = 0; //LED OFF
PORTB.F1 = 0; //LED OFF
PORTB.F2 = 0; //LED OFF
PORTB.F3 = 0; //LED OFF
PORTB.F4 = 0; //LED OFF
PORTB.F5 = 0; //LED OFF
PORTB.F6 = 0; //LED OFF
PORTB.F7 = 0; //LED OFf
Delay_ms(1000); //1 Second Delay
}
}
}
} -
AuthorPosts
- You must be logged in to reply to this topic.