Fingerprint-Based Door Unlock

People who forget their keys before leaving their homes will never again face face a situation of waiting for someone else to open the door.

IntermediateWork in progress4 hours1,736
Fingerprint-Based Door Unlock

Things used in this project

Hardware components

MSP-EXP430G2 MSP430 LaunchPad
Texas Instruments MSP-EXP430G2 MSP430 LaunchPad
×1
SparkFun Fingerprint Scanner - TTL (GT-511C3)
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Jumper wires (generic)
Jumper wires (generic)
×10
CP2102 USB 2.0 to TTL UART Serial convertor Module
×1

Software apps and online services

Energia
Texas Instruments Energia

Story

Read more

Schematics

Schematic of FPS and Servo interfaced with MSP430

Code

FingerPrint Scanner Code

C/C++
This code scans the fingerprint and if it is recognized, turns the servo. For the purpose of this sample code, once the moment the finger is removed, the servo resets to its original position. Note the servo is connected to pin 11
#include <SoftwareSerial.h>
#include <FPS_GT511C3.h>


FPS_GT511C3 fps(P2_5,P2_4 ); // (TX pin of fps<-->msp pin P2.5, RX pin of fps<-->msp pin P2.4)

int servo = 11; // Servo pin <--> Pin P2.6

int angle;
int pwm;

void setup()
{
  Serial.begin(9600); //set up Arduino's hardware serial UART
   pinMode(servo, OUTPUT);
 
   fps.Open();         //send serial command to initialize fps
   fps.SetLED(true);   //turn on LED so fps can see fingerprint
 
 }

void loop()
{
  
  if (fps.IsPressFinger())
   recogniseFingerprint();
 
  
    }


void recogniseFingerprint()
{    
    Serial.print(".......");
   if (fps.IsPressFinger())
    {  fps.CaptureFinger(false);
       int id = fps.Identify1_N();
    

    // GT-511C3 can hold 200 fingerprint templates. 
                
    if (id <200) //<- change id value depending model you are using
    {//if the fingerprint matches, provide the matching template ID
      Serial.print("Verified ID:");
      Serial.println(id);
      rotateServo();
    }
    else
        {//if unable to recognize
         Serial.println("Finger not found");}
     }
  else
  {
    Serial.println("Please press finger");
  }
  delay(50);
} 
  
void rotateServo()
{
  for (angle = 0; angle <= 180; angle += 10)  {
   servoPulse(servo, angle);  }
   while(fps.IsPressFinger());
   for (angle = 180; angle >= 0; angle -= 10)  {
   servoPulse(servo, angle);  }
   delay(1000);
 }



void servoPulse (int servo, int angle)
{
 pwm = (angle*11) + 500;      // Convert angle to microseconds
 digitalWrite(servo, HIGH);
 delayMicroseconds(pwm);
 digitalWrite(servo, LOW);
 delay(50);                   // Refresh cycle of servo
}

Credits

Aaron Sequeira

Aaron Sequeira

1 project • 4 followers
Sumit Kanu

Sumit Kanu

1 project • 6 followers
Aditya Manjunath

Aditya Manjunath

1 project • 5 followers
Shravan Premraj

Shravan Premraj

1 project • 2 followers
Shravan Bhat

Shravan Bhat

1 project • 1 follower
Subham Mohapatra

Subham Mohapatra

1 project • 3 followers
B.Tech. EEE ,NITK Suratkal.
Yash Khivasara

Yash Khivasara

1 project • 5 followers
Texas Instruments University Program

Texas Instruments University Program

91 projects • 119 followers
TI helps students discover what's possible to engineer their future.

Comments