Overview

In this project, we’ll learn how to start a vehicle using a fingerprint sensor and how to prevent vehicle theft.

We use a fingerprint-based bike start mechanism in this system to address the problem that many people have of leaving their keys somewhere after leaving their home but forgetting where they went until they have an urgent need to leave.

We use a fingerprint-based sensor to start the vehicle when you’ve forgotten your bike key. We can start the vehicle by using an authorized fingerprint. and we can deactivate any other unauthorized users who attempt to access it.

Fingerprint recognition is the system’s initial line of security and is used to open the locks. The minutiae-based fingerprint recognition scheme is used to perform the fingerprint matching.

The minutiae-based fingerprint recognition scheme is used to perform the fingerprint matching.

Only the bike key works to start the vehicle. The user should retain their finger on the fingerprint sensor if they have forgotten their keys somewhere. The solenoid is opened for petrol supply if the finger ridges line correctly.

If the finger matches are unsuccessful, the vehicle will be immobilised and the owner’s mobile phone will receive a warning message using the GSM module.

Components Required Table

S.NoComponent  
1Arduino UNOAmazon
2Fingerprint Sensor R305 Amazon
3Sim900A Gsm ModemAmazon
412V Solenoid LockAmazon
5Relay ModuleAmazon
6Ignition Key SwitchAmazon
7BuzzerAmazon
8SwitchAmazon
99V BATTERYAmazon
10Jumper wiresAmazon

R305 Fingerprint Scanner Sensor Module

This is a fingerprint sensor module with a TTL UART interface for direct connections to microcontroller UART or to PC through MAX232 / USB-Serial adapter. The user can store the fingerprint data in the module and can configure it in 1:1 or 1: N mode for identifying the person.

The Fingerprint module can be directly interfaced with any microcontroller as well as Arduino Board. This optical biometric fingerprint reader with great features and can be embedded into a variety of end products like access control systems, attendance systems, safety deposit boxes, and Vehicle door locking systems.

Source Code/program for Enrolling Fingerprint

First, you need to register the desired finger. The registration is done by enrolling in the fingerprint. The enrolling is done by placing the finger on the top of the glass on the basis of the command shown in the serial monitor. Follow the video guide below to enrol in your fingerprint.

Circuit Diagram of fingerprint sensor connection

#include <Adafruit_Fingerprint.h>
 
SoftwareSerial mySerial(2, 3);
 
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
 
uint8_t id;
 
void setup()
{
Serial.begin(9600);
while (!Serial); // For Yun/Leo/Micro/Zero/...
delay(100);
Serial.println("\n\nAdafruit Fingerprint sensor enrollment");
 
// 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) { delay(1); }
}
}
 
uint8_t readnumber(void) {
uint8_t num = 0;
 
while (num == 0) {
while (! Serial.available());
num = Serial.parseInt();
}
return num;
}
 
void loop() // run over and over again
{
Serial.println("Ready to enroll a fingerprint!");
Serial.println("Please type in the ID # (from 1 to 127) you want to save this finger as...");
id = readnumber();
if (id == 0) {// ID #0 not allowed, try again!
return;
}
Serial.print("Enrolling ID #");
Serial.println(id);
 
while (! getFingerprintEnroll() );
}
 
uint8_t getFingerprintEnroll() {
 
int p = -1;
Serial.print("Waiting for valid finger to enroll as #"); Serial.println(id);
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();
}
Serial.print("ID "); Serial.println(id);
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!
Serial.print("Creating model for #"); Serial.println(id);
 
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;
}
 
Serial.print("ID "); Serial.println(id);
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;
}
}

Circuit Diagram & Connections for Bike Starting Using Fingerprint

How to Start a Bike

This code needs to be uploaded to your Arduino board after the appropriate finger’s fingerprint has been registered or enrolled. When a right finger is detected, this code can start the bike on its own. When you still need to set the bike key by myself this situation will still hold. The fingerprint sensor will not function if the key is placed on the bike. This project primarily aims to enable a fingerprint-based vehicle without a key.  The bike won’t start if an unregistered finger is placed, and it will send a message to a designated person and buzzer alert you as well.

This code needs to be uploaded to your Arduino board after the appropriate finger’s fingerprint has been registered or enrolled. When a right finger is detected, this code can start the bike on its own. When you still need to set the bike key by myself this situation will still hold. The fingerprint sensor will not function if the key is placed on the bike. This project primarily aims to enable a fingerprint-based vehicle without a key.  The bike won’t start if an unregistered finger is placed, and it will send a message to a designated person and buzzer alert you as well.

Technique for Registering Fingerprints

If you want to register a new fingerprint for this project, you can do so by utilising the slide switch. Only you can register when the slide switch is on. You can disable the sliding switch after registering the fingerprint.

Source Code/program for Bike Starting Using Fingerprint

#include <Adafruit_Fingerprint.h>
#include <SoftwareSerial.h>
#include<LiquidCrystal.h>
LiquidCrystal lcd(A4,A5,A0,A1,A2,A3);
SoftwareSerial mySerial(2, 3); // rx tx

int FingerPrint_Initializing  =   11; // fingar print enable
const int RELAY_SWITCH        =   4;     // the number of the pushbutton pin
int Buzzer_Alert              =   10;   // Alart for Unauthorized Access
int Ignition_key              =   7;    // int Ignition_key to Start the Bike


Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
uint8_t getFingerprintEnroll();
int getFingerprintIDez();

int Ignition_key_Status;
uint8_t id;
int inc=0;

void setup()  
{
  pinMode(FingerPrint_Initializing,INPUT);
  pinMode(Ignition_key,INPUT);
  pinMode(Buzzer_Alert,OUTPUT);
  pinMode(RELAY_SWITCH,OUTPUT);

  digitalWrite(Buzzer_Alert,LOW);

  lcd.begin(16,2);
  lcd.setCursor(0,0);
  lcd.print("Welcome to      ");
  lcd.setCursor(0,1);
  lcd.print("BIKE STAND SYS.. ");
  
  while (!Serial);  // For Yun/Leo/Micro/Zero/...
  Serial.begin(9600);
  finger.begin(9600);
  
  if (finger.verifyPassword()) 
  {
    Serial.println("Found fingerprint sensor!");
  } 
  else 
  {
    Serial.println("Did not find fingerprint sensor :(");
    while (1);
  }
  Serial.println("Waiting for valid finger...");
  delay(2000);
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Please Place ");
  lcd.setCursor(0,1);
  lcd.print("Finger... ");
}

uint8_t readnumber(void) {
  uint8_t num = 0;
  boolean validnum = false; 
  while (1) {
    while (! Serial.available());
    char c = Serial.read();
    if (isdigit(c)) {
       num *= 10;
       num += c - '0';
       validnum = true;
    } else if (validnum) {
      return num;
    }
  }
}

void loop()                     // run over and over again
{
  int k=0;
Ignition_key_Status=digitalRead(Ignition_key);
Serial.println(Ignition_key_Status);
  if(digitalRead(FingerPrint_Initializing)==HIGH)
  {
    
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Enrolling...");
    Serial.println("Ready to enroll a fingerprint! Please Type in the ID # you want to save this finger as...");
    id = readnumber();
    Serial.print("Enrolling ID #");
    Serial.println(id);
    
    while (!  getFingerprintEnroll() );
  }
   
  if(digitalRead(FingerPrint_Initializing)==LOW)
  {
    
    k=get_finger();
    delay(50);            //don't ned to run this at full speed.
    
    if(k==-1)
    {
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Waiting ");
      lcd.setCursor(0,1);
      lcd.print("For Finger ... ");
     
    }
    
    else if((k==2)&&(Ignition_key_Status==0))
    {
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Un-Authorised  ");
      lcd.setCursor(0,1);
      lcd.print("Accessed ... ");
     digitalWrite(RELAY_SWITCH,LOW);
     init_sms();
      digitalWrite(Buzzer_Alert,HIGH);
      delay(2000);
      digitalWrite(Buzzer_Alert,LOW); 
        delay(2000);
    }
    else
    {
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Bike started  ");
      lcd.setCursor(0,1);
      lcd.print(".............. ... ");
      delay(2000);
      digitalWrite(RELAY_SWITCH,HIGH);
     
    }
    if(Ignition_key_Status==1)
    {
  lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Bike started  ");
      lcd.setCursor(0,1);
      lcd.print(".............. ... ");
      delay(2000);
      digitalWrite(RELAY_SWITCH,HIGH);
    } 

     
  }
  inc=0;
}

int get_finger() 
{
  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 2;
  
  // found a match!
  Serial.print("Found ID #"); Serial.print(finger.fingerID); 
  Serial.print(" with confidence of "); Serial.println(finger.confidence);
  return finger.fingerID; 
}


uint8_t getFingerprintEnroll() {

  int p = -1;
  Serial.print("Waiting for valid finger to enroll as #"); Serial.println(id);
  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();
  }
  Serial.print("ID "); Serial.println(id);
  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!
  Serial.print("Creating model for #");  Serial.println(id);
  
  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;
  }   
  
  Serial.print("ID "); Serial.println(id);
  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;
  }  
 
}
void init_sms()
{
  Serial.println("AT+CMGF=1");
  delay(400);
  Serial.println("AT+CMGS=\"9966982326\"");   // use your 10 digit cell no. here
  delay(400); 
  Serial.print("Un-Authorised person acesses bike pls action");
  Serial.write(26);
  delay(2000);
  
  Serial.println("AT+CMGF=1");
  delay(400);
  Serial.println("AT+CMGS=\"996698xxxx\"");   // use your 10 digit cell no. here
  delay(400);
  
  Serial.print("Un-Authorised person acesses bike pls action");
  Serial.write(26);
  delay(2000);
}

By Devilal

Leave a Reply

Your email address will not be published. Required fields are marked *