Smartphone Fingerprint lock System

Circuit Diagram for Fingerprint Lock System


 Arduino sketch for Fingerprint Lock System

// Use the smartphone Fingerprint scanner to open the lock.

//Bluetooth App Fingerprint Lock


String readString;

#define lock 3    //Initialized pin 3 to Variable name "lock"



void setup()

{

  Serial.begin(9600);           //Set serial monitor baud rate 9600 for communicating with phone

  pinMode(lock, OUTPUT);      //Declare variable "lock"(pin3) as an output

  digitalWrite(lock, LOW);     //Assign the Default status of lock is De-energize.

}

void loop()

{

  while(Serial.available())    //Check if there are available bytes to read

  {

    delay(10);                 //Delay to make it stable

    char c = Serial.read();    //Conduct a serial read

    if (c == '#'){

      break;                   //Stop the loop once # is detected after a word

    }

    readString += c;                //Means readString = readString + c

  }

    if (readString.length() >0)

    {

      Serial.println(readString);

                  

     if(readString == "f success"){

        digitalWrite(lock, HIGH);

        delay(3000);

        digitalWrite(lock, LOW);

      }

      readString="";

    }

}

Comments

Popular posts from this blog

4 Stage Timer With DS3231RTC Module.

Interfacing KY038 sound sensor with Raspberry pi Pico

Interfacing MQ2 Gas & Smoke Sensor With Raspberry Pi Pico