Hello..
Please I need help on my project
It's a fingerprint vehicle starter with gsm alert.
Presently the fingerprint take in valid finger but of invalid finger it thoses not take and also will like it to send SMS message after three attempt of failed finger
What do you need help with?
You might consider posting the code, a schematic and a image or two of the setup as ways to help us help you?
Below is the code am working on I.
Will want the fingerprint module to be able to detect invalid fingerprint on an attempt of three then send message to sender
finger.begin(57600);
Serial.begin(9600);
if (finger.verifyPassword()) {
Serial.println("Found fingerprint sensor!");
} else {
lcd.print("Did not find fingerprint sensor :(");
while (1);
}
lcd.clear();
lcd.print("Waiting for valid finger...");
}
void loop() { // run over and over again
lcd.clear();
lcd.print("Waiting for valid finger...");
getFingerprintIDez();
delay(50);
// returns -1 if failed, otherwise returns ID#
}
// 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;
Serial.println(finger.fingerID);
fingerprint(finger.fingerID);
}
void fingerprint(int ID)
{
if (ID == 7 || ID == 8 || ID == 9)
{
lcd.clear();
digitalWrite(relay,HIGH);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Access Granted ");
lcd.setCursor(0, 1);
lcd.print("Vehicle Started ");
delay (5000);
//SendTextMessage();
//while(1);
}
else
{
lcd.setCursor(0, 0);
lcd.clear();
lcd.print("Invalid Finger Print");
//SendTextMessage()
delay(5000);
}
}
void SendTextMessage()
{
lcd.print("Sending Text...");
sim800l.print("AT+CMGF=1\r"); // Set the shield to SMS mode
delay(100);
sim800l.print("AT+CMGS="+2348029941195"\r");
delay(200);
sim800l.print("Engine Starts "); //the content of the message
digitalWrite (relay,HIGH);
lcd.clear();
// lcd.print("Engine Starts... !");
sim800l.print((char)26);//the ASCII code of the ctrl+z is 26 (required according to the datasheet)
delay(100);
}
Code tags?
and this is not complete
finger.begin(57600);
Serial.begin(9600);
if (finger.verifyPassword()) {
Serial.println(“Found fingerprint sensor!”);
} else {
lcd.print(“Did not find fingerprint sensor :(”);
while (1);
}
lcd.clear();
lcd.print(“Waiting for valid finger…”);
}
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Adafruit_Fingerprint.h>
#include <SoftwareSerial.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
int getFingerprintIDez();
int relay = 7;
SoftwareSerial mySerial(10, 11);
SoftwareSerial sim800l(2, 3); // create a constructor of SoftwareSerial
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
void setup()
{
pinMode(relay,OUTPUT);
lcd.begin(16,2);//Defining 16 columns and 2 rows of lcd display
lcd.backlight();//To Power ON the back light
sim800l.begin(9600); // Setting the baud rate of GSM Module
// Serial.begin(9600); // Setting the baud rate of Serial Monitor (Arduino)
delay(100);
sim800l.println("AT");
delay(1000);
sim800l.println("AT+CFUN=?");
delay(5000);
//sim800l.println("AT+CFUN?");
//delay(5000);
sim800l.println("AT+CFUN=1");
delay(5000);
// Print a message to the LCD.
lcd.setCursor(4,0);
lcd.print("WELCOME");
lcd.setCursor(1,1);
lcd.print("PROJECT");
delay(3000);
lcd.clear();
//delay(500);
lcd.setCursor(3, 0);
// print the number of seconds since reset:
lcd.print("FINGERPRINT");
lcd.setCursor(1, 1);
lcd.print("VEHICLE STARTER");
delay(3000);
lcd.clear();
lcd.setCursor(4,0);
lcd.print("WITH SMS");
lcd.setCursor(6,1);
lcd.print("ALERT");
delay(2000);
lcd.clear();
lcd.begin(16,2);
lcd.print("fingertest");
// set the data rate for the sensor serial port
finger.begin(57600);
Serial.begin(9600);
if (finger.verifyPassword()) {
Serial.println("Found fingerprint sensor!");
} else {
lcd.print("Did not find fingerprint sensor :(");
while (1);
}
lcd.clear();
lcd.print("Waiting for valid finger...");
}
void loop() { // run over and over again
lcd.clear();
lcd.print("Waiting for valid finger...");
getFingerprintIDez();
delay(50);
// returns -1 if failed, otherwise returns ID#
}
// 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;
Serial.println(finger.fingerID);
fingerprint(finger.fingerID);
}
void fingerprint(int ID)
{
if (ID == 7 || ID == 8 || ID == 9)
{
lcd.clear();
digitalWrite(relay,HIGH);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Access Granted ");
lcd.setCursor(0, 1);
lcd.print("Vehicle Started ");
delay (5000);
//
}
else
{
lcd.setCursor(0, 0);
lcd.clear();
lcd.print("Invalid Finger Print");
SendTextMessage()
delay(5000);
}
}
void SendTextMessage()
{
lcd.print("Sending Text...");
sim800l.print("AT+CMGF=1\r"); // Set the shield to SMS mode
delay(100);
sim800l.print("AT+CMGS="+2348029941195"\r");
delay(200);
sim800l.print("Engine Starts "); //the content of the message
digitalWrite (relay,HIGH);
lcd.clear();
// lcd.print("Engine Starts... !");
sim800l.print((char)26);//the ASCII code of the ctrl+z is 26 (required according to the datasheet)
delay(100);
}
Code tags?
SoftwareSerial mySerial(10, 11);
What does that do? Where is it used?
Try posting your code, again, in code tags.
Please edit your posts with code. Select the code, click < / > in the toolbar of the edit box and save the post.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Adafruit_Fingerprint.h>
#include <SoftwareSerial.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
int getFingerprintIDez();
int relay = 7;
SoftwareSerial mySerial(10, 11);
SoftwareSerial sim800l(2, 3); // create a constructor of SoftwareSerial
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
void setup()
{
pinMode(relay,OUTPUT);
lcd.begin(16,2);//Defining 16 columns and 2 rows of lcd display
lcd.backlight();//To Power ON the back light
sim800l.begin(9600); // Setting the baud rate of GSM Module
// Serial.begin(9600); // Setting the baud rate of Serial Monitor (Arduino)
delay(100);
sim800l.println("AT");
delay(1000);
sim800l.println("AT+CFUN=?");
delay(5000);
//sim800l.println("AT+CFUN?");
//delay(5000);
sim800l.println("AT+CFUN=1");
delay(5000);
// Print a message to the LCD.
lcd.setCursor(4,0);
lcd.print("WELCOME");
lcd.setCursor(1,1);
lcd.print("PROJECT");
delay(3000);
lcd.clear();
//delay(500);
lcd.setCursor(3, 0);
// print the number of seconds since reset:
lcd.print("FINGERPRINT");
lcd.setCursor(1, 1);
lcd.print("VEHICLE STARTER");
delay(3000);
lcd.clear();
lcd.setCursor(4,0);
lcd.print("WITH SMS");
lcd.setCursor(6,1);
lcd.print("ALERT");
delay(2000);
lcd.clear();
lcd.begin(16,2);
lcd.print("fingertest");
// set the data rate for the sensor serial port
finger.begin(57600);
Serial.begin(9600);
if (finger.verifyPassword()) {
Serial.println("Found fingerprint sensor!");
} else {
lcd.print("Did not find fingerprint sensor :(");
while (1);
}
lcd.clear();
lcd.print("Waiting for valid finger...");
}
void loop() { // run over and over again
lcd.clear();
lcd.print("Waiting for valid finger...");
getFingerprintIDez();
delay(50);
// returns -1 if failed, otherwise returns ID#
}
// 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;
Serial.println(finger.fingerID);
fingerprint(finger.fingerID);
}
void fingerprint(int ID)
{
if (ID == 7 || ID == 8 || ID == 9)
{
lcd.clear();
digitalWrite(relay,HIGH);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Access Granted ");
lcd.setCursor(0, 1);
lcd.print("Vehicle Started ");
delay (5000);
//
}
else
{
lcd.setCursor(0, 0);
lcd.clear();
lcd.print("Invalid Finger Print");
SendTextMessage()
delay(5000);
}
}
void SendTextMessage()
{
lcd.print("Sending Text...");
sim800l.print("AT+CMGF=1\r"); // Set the shield to SMS mode
delay(100);
sim800l.print("AT+CMGS=\"+2348029941195\"\r");
delay(200);
sim800l.print("Engine Starts "); //the content of the message
digitalWrite (relay,HIGH);
lcd.clear();
// lcd.print("Engine Starts... !");
sim800l.print((char)26);//the ASCII code of the ctrl+z is 26 (required according to the datasheet)
delay(100);
}
i use this to connect the gsm module to the arduino uno .. which was tested and responding
finger.begin(57600);
Softwareserial does not work very well at speeds above 9600, is my understanding, as a note.
You can create an int to hold scan counts. If the scan fails increment the count and allow the user to try again. On the 3rd try you would do the thing.
This doesn't look right:
Perhaps the original got mangled in the formatting and the backslashes required to embed quote marks in a string were deleted by accident:
sim800l.print("AT+CMGS=\"+2348029941195\"\r");
// returns -1 if failed, otherwise returns ID#
int getFingerprintIDez()
{
But there is no 'return' statement to return the ID.
ok sir will give it a try. thanks
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.