Adding Power to ID Cards

Using RFID to lock/unlock hostel room doors, using them for cashless payments in shops

AdvancedFull instructions provided14 hours1,205
Adding Power to ID Cards

Things used in this project

Hardware components

MSP-EXP430G2 MSP430 LaunchPad
Texas Instruments MSP-EXP430G2 MSP430 LaunchPad
×1
Breadboard (generic)
Breadboard (generic)
×2
Buzzer
Buzzer
×1
Jumper wires (generic)
Jumper wires (generic)
×30
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1
RFID Module (Generic)
×1

Software apps and online services

Energia
Texas Instruments Energia
Android Studio
Android Studio

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Schematics

Pin diagram of MSP430 Microcontroller

Pin Diagram of MFRC522 RFID Module

Final project (along with prototype door)

Code

Untitled file

CSS
#include "Mfrc522.h"
#include <SPI.h>
#include<driverlib.h>
#include <Servo.h> 

int CS = 8;                                 
int NRSTDP = 5;
Mfrc522 Mfrc522(CS,NRSTDP);
unsigned char serNum[5];
Servo myservo;  
int pos = 0;
static int flag=0;
int attempt = 1;

void setup() 
{            
 
  pinMode(2,OUTPUT) ;
 
   myservo.attach(P2_4);
  Serial.begin(9600);                        
  Serial.println("please scan your card");
  myservo.write(0);
  SPI.begin();
  digitalWrite(CS, LOW);                 
  pinMode(RED_LED, OUTPUT);                 
  Mfrc522.Init();  
  digitalWrite(2, LOW);  
}
void runUnlockDoor()
{
  if(flag==1)
       { digitalWrite(2,LOW);
       Serial.println("Unlocked");
        for( pos =0 ; pos < 90; pos += 1)  
  {                                   
    myservo.write(pos);              
    delay(5);                      
  } 
       flag=0;
       }
    
      else if(flag==0){
       Serial.println("Locked");
        digitalWrite(2,LOW);
        for( pos = 90; pos > 0; pos -= 1) 
  {                                  
    myservo.write(pos);             
    delay(5);                      
  } 
       flag=1;
       }
}
void loop()
{
  Serial.println(attempt);
  
  unsigned char status;
  unsigned char str[MAX_LEN];
    
  status = Mfrc522.Request(PICC_REQIDL, str);
  if (status == MI_OK)
  {
    Serial.print("Card detected: ");
   
  }

  status = Mfrc522.Anticoll(str);
  memcpy(serNum, str, 5);
  if (status == MI_OK)
  {
    digitalWrite(RED_LED, HIGH);              

 
    if (serNum[0] == 220 && serNum[1] == 122 && serNum[2] == 246 && serNum[3] == 198 && serNum[4] == 150)
    {
      Serial.println("YOU USED MASTER CARD\n");
      delay(500);
      digitalWrite(2,HIGH);
       delay(300);
       digitalWrite(2,LOW);
       delay(300);
      digitalWrite(2,HIGH);
       delay(300);
        digitalWrite(2,LOW);
       delay(300);
      digitalWrite(2,HIGH);
      delay(300);
       runUnlockDoor();
      attempt=1;
      
      
    }
    else if(serNum[0] == 182 && serNum[1] == 72 && serNum[2] == 122 && serNum[3] == 248 && serNum[4] == 124 && attempt<=5) 
    {
      Serial.println("Hello 007\n");
       runUnlockDoor();
       attempt=1;

    }
   else if(serNum[0] == 8&&attempt<=5 )
    {
      Serial.println("mobile used to unlock");
       runUnlockDoor();
    }
   else if(attempt<=5) 
    {
      Serial.println("unauthorised entry\n"); 
      digitalWrite(2,HIGH);
      delay(1000);
      digitalWrite(2,LOW);
      attempt++;   
    }  
    delay(1000);
    digitalWrite(RED_LED, LOW);
  }
  if(attempt==6)
  {
     digitalWrite(2,HIGH);
       delay(100);
       digitalWrite(2,LOW);
       delay(100);
        digitalWrite(2,HIGH);
       delay(100);
       digitalWrite(2,LOW);
       delay(100);
        digitalWrite(2,HIGH);
       delay(100);
       digitalWrite(2,LOW);
       delay(100);
        digitalWrite(2,HIGH);
       delay(100);
       digitalWrite(2,LOW);
       delay(100);
      digitalWrite(2,HIGH);
       delay(100);
       digitalWrite(2,LOW);
       delay(100);
        digitalWrite(2,HIGH);
       delay(100);
       digitalWrite(2,LOW);
       delay(100);
       attempt++;
     }
 
  
  Mfrc522.Halt();                         
}

Adding Power to ID Card

This is the link to the repository having the files of the android application developed with android studio

Credits

Palash Agrawal

Palash Agrawal

1 project • 3 followers
Pranav Srinath

Pranav Srinath

1 project • 8 followers
VIKRAM MAGENDAR

VIKRAM MAGENDAR

1 project • 3 followers
Saurabh Dewangan

Saurabh Dewangan

1 project • 2 followers
Texas Instruments University Program

Texas Instruments University Program

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

Atreya Majumdar

1 project • 3 followers
Hemanth Umashankar

Hemanth Umashankar

0 projects • 0 followers

Comments