Bank Account Security System.

By Dhruv Manoj Bhatt and Varun Rajiv Gatne

Purpose

The project was implemented in order to have a higher level of security while accessing Bank Accounts and detect the unauthorized personnel if the security is breached.

Abstract

The system will furnish the bank account details of only the authorized person,authenticity being determined by means of an RFID card and an I2C keypad. If an unauthorized user is detected,a photograph is taken and stored on to an SD card.

/media/uploads/Dhruv_Varun/projbd.png

Description

The system basically involves an RFID card reader, an I2C touch keypad, a camera which will take pictures and store them on to the SD card. An LCD display is used to display details of the bank account and to guide the user during the process of authentication. There are two layers of security being implemented. The first layer consists of an RFID card reader. If the correct RFID card has been read then the user progresses to the next level. In the next level, a four digit pin code is required to be entered by the user via the I2C touch keypad. If the correct pin code is entered the second level of security is cleared and the account details are displayed on the LCD. However if an incorrect pin code is entered, the details are not furnished and a picture of the person is taken and stored in the SD card so as to have a record of the unauthorized user.

Equipment

  • Mbed NXP LPC1768
  • 16x2 LCD Text Display HD44780
  • Camera LS Y201
  • SD card
  • MPR121 I2C touch keypad
  • RFID card reader
  • RFID tags

Description of Keypad keys

  • Keypad 0-9 keys - Number Keys 0-9.
  • Keypad key 10 - Enter Key.
  • Keypad key 11 - Clear Key.

Connections

mbedCamera LS Y201
p28RxD
p27TxD
mbedID12 RFID READER
p14D0
VuVCC
VuNRST
GndGND
GndFS
mbedTOUCH KEYPAD
p9SDA
VoutVCC
p10SCL
GndGND
p26IRQ
mbedMICRO SD
p8CS
VoutVCC
p5DI
GndGND
p6DO
P7SCK

Images

  • Circuit Connection

/media/uploads/Dhruv_Varun/_scaled_project_connections.jpg

  • SD_CARD Image

/media/uploads/Dhruv_Varun/_scaled_sd_card_image.jpg

Demos

  • For Access Granted
  • For Unauthorized Access

Import Code

  • Here is the link in order to import the code.

Import programfinal_proj1

Bank Account Security System

Code

# include <mbed.h>
#include <mpr121.h>
#include <string>
#include <list>
#include <mpr121.h>
#include "TextLCD.h"
#include <stdio.h>
#include <stdlib.h>
#include <sstream>
#include <iostream>
#include "ID12RFID.h"
#include "Camera_LS_Y201.h"
#include "SDFileSystem.h"



TextLCD lcd(p15, p16, p17, p18, p19, p20);
//ID12RFID rfid(p14);
DigitalOut led1(LED1);
DigitalOut led2(LED2);
DigitalOut led3(LED3);
DigitalOut led4(LED4);
bool test1 = false;
bool test2 = false;
//int a=0;
int counter1=0;
int Code[4]= {0,0,0,0};
int Code2[4];
int flag=0;
int a=0;
int b=0;
int enter=0;
int end=0;
int c=0;
int chk1=0;
int a1=0;
int r=0;
InterruptIn interrupt(p26);
// Setup the i2c bus on pins 9 and 10
I2C i2c(p9, p10);
// Setup the Mpr121:
// constructor(i2c object, i2c address of the mpr121)
Mpr121 mpr121(&i2c, Mpr121::ADD_VSS);
ID12RFID rfid(p14); // uart rx



 
#define USE_SDCARD 1
 
#if USE_SDCARD
#define FILENAME    "/sd/IMG_%04d.jpg"
SDFileSystem fs(p5, p6, p7, p8, "sd");
#else
#define FILENAME    "/local/IMG_%04d.jpg"
LocalFileSystem fs("local");
#endif
Camera_LS_Y201 cam1(p28, p27);
typedef struct work {
    FILE *fp;
} work_t;
 
work_t work;
 
/**
 * Callback function for readJpegFileContent.
 *
 * @param buf A pointer to a buffer.
 * @param siz A size of the buffer.
 */
void callback_func(int done, int total, uint8_t *buf, size_t siz) {
    fwrite(buf, siz, 1, work.fp);
 
    static int n = 0;
    int tmp = done * 100 / total;
    if (n != tmp) {
        n = tmp;
        lcd.cls();
        lcd.printf("Writing...: %3d%%", n);
        //wait(3);
 //       ////newline();
    }
}
 
/**
 * Capture.
 *
 * @param cam A pointer to a camera object.
 * @param filename The file name.
 *
 * @return Return 0 if it succeed.
 */
int capture(Camera_LS_Y201 *cam, char *filename) {
    /*
     * Take a picture.
     */
    if (cam->takePicture() != 0) {
        return -1;
    }
    lcd.cls();
    lcd.printf("Captured.");
    wait(3);
   // //newline();
 
    /*
     * Open file.
     */
    
    work.fp = fopen(filename, "wb");
    if (work.fp == NULL) {
        return -2;
    }
 
    /*
     * Read the content.
     */
    lcd.printf("%s", filename);
    wait(3);
    ////newline();
    if (cam->readJpegFileContent(callback_func) != 0) {
        fclose(work.fp);
        return -3;
    }
    fclose(work.fp);
 
    /*
     * Stop taking pictures.
     */
    cam->stopTakingPictures();
 
    return 0;
}
//DigitalOut led1(LED1);

//TextLCD lcd(p15, p16, p17, p18, p19, p20); // rs, e, d4-d7
// Key hit/release interrupt routine
void fallInterrupt() {
  int key_code=0;
  int i=0;
  int value=mpr121.read(0x00);
  value +=mpr121.read(0x01)<<8;
  // LED demo mod
  i=0;
  // puts key number out to LEDs for demo
  for (i=0; i<12; i++) {
  if (((value>>i)&0x01)==1) 
  {
//  led4=0;
  b=1;
  
  key_code=i+1;
  if(key_code==12)
  {
  end=1;
  c=0;
  }
  else if(key_code==11)
  {
  enter=1;
  c=0;
  }
  else
  {
  //a=i;
  if(counter1 < 4)
            {
                Code[counter1] = i;
                counter1++;
            }
            if(counter1==4)
            {
            Code2[0]=Code[0];
            Code2[1]=Code[1];
            Code2[2]=Code[2];
            Code2[3]=Code[3];
            Code[0]=0;
            Code[1]=0;
            Code[2]=0;
            Code[3]=0;
            counter1=0;            }
  c++;
  }
  
 /* led4=key_code & 0x01;
  led3=(key_code>>1) & 0x01;
  led2=(key_code>>2) & 0x01;
  led1=(key_code>>3) & 0x01;*/
  led4=1;
  
}
//if(led4)
//led4=0;
}
}
int main()
{
  interrupt.fall(&fallInterrupt);
  interrupt.mode(PullUp);

    while(1) {
        //Code[4]={0,0,0,0};
        lcd.cls();
        lcd.printf("Welcome to Chase Bank");
        wait(4);
        lcd.cls();
        lcd.printf("Please tap your card");
        wait(3);
        if(rfid.readable()) {
            lcd.cls();
            a=rfid.read();
            a1=a;
            lcd.printf("RFID Tag number : %d\n", a);
            wait(3);
            led1=1;
        } else {
            lcd.cls();
            lcd.printf("card not read properly");
            wait(3);
            a=0;
        }
        if(a==36905538 || a==36910393) {
            test1=true;
            lcd.cls();
            lcd.printf("Valid Card detected\n");
            wait(3);
            lcd.printf("Card ID:- %d",a);
            wait(3);
            lcd.cls();
            lcd.printf("Level 1 cleared");
            wait(2);
            lcd.cls();
            lcd.printf("test1--%d",test1);
            wait(2);
        }
        if(test1 && a!=0) {
            lcd.cls();
            lcd.printf("Enter 4 digit pin code");
            wait(10);
            if(b==1) {
            //lcd.cls();
            if(c==1)
            {
            lcd.cls();
            lcd.printf("one key pressed"); 
            wait(2);        
            }
            else if(c==2)
            {
            lcd.cls();
            lcd.printf("second key pressed"); 
            wait(2);        
            }
            else if(c==3)
            {
            lcd.cls();
            lcd.printf("third key pressed"); 
            wait(2);        
            }
            else if(c==4)
            {
            lcd.cls();
            lcd.printf("fourth key pressed"); 
            wait(2);
            lcd.cls();
            lcd.printf("press enter to submit"); 
            wait(3); 
            }  
            if(enter)
            {
            lcd.cls();
            lcd.printf("checking");
            wait(2);
            /*lcd.printf("%d",Code2[3]);
            wait(3);
            lcd.printf("a=",a1);
            wait(2);*/
            if(a1==36905538)
            chk1=40;
            else if (a1==36910393)
            chk1=41;
            
            if(chk1==40)
             {
            
                    if(Code2[0]==1 && Code2[1]==2 && Code2[2]==3 && Code2[3]==4) {
                        lcd.cls();
                        lcd.printf("PINCODE ACCEPTED");
                        wait(5);
                        test2=true;
                        lcd.cls();
                        lcd.printf("LEVEL 2 Cleared");
                        wait(3);
                        lcd.cls();
                        lcd.printf("Welcome MR. Db");
                        wait(4);
                        lcd.cls();
                        lcd.printf("your amount is 125$");
                        wait(3);
                        //break;
                    } else {
                        lcd.cls();
                        lcd.printf("Intruder Alert");
                        wait(5);
                        ////////////////////start of capture
                        lcd.cls();
                         lcd.printf("Camera module");
                         wait(1);
    //newline();
    lcd.cls();
    lcd.printf("Resetting...");
    wait(1);
    //newline();
    wait(1);
 
    if (cam1.reset() == 0) {
        lcd.cls();
        lcd.printf("Reset OK.");
        wait(1);
        //////newline();
    } else {
        lcd.cls();
        lcd.printf("Reset fail.");
        wait(2);
        ////////newline();
        error("Reset fail.");
    }
    wait(1);
 
    int cnt = 0;
   
        char fname[64];
        snprintf(fname, sizeof(fname) - 1, FILENAME, cnt);
        int r = capture(&cam1, fname);
        if (r == 0) {
        lcd.cls();
            lcd.printf("[%04d]:OK.", cnt);
            ////newline();
            led1=1;
        } else {
        lcd.cls();
            lcd.printf("[%04d]:NG. (code=%d)", cnt, r);
            ////newline();
            error("Failure.");
            led2=1;
        }
        cnt++;
    ////////////////end of capture
                       while(r!=10)
                       { 
                         if(r%2!=0)
                         {
                        led1=1;
                        led2=0;
                        led3=1;
                        led4=0;
                        }
                        if(r%2==0)
                        {
                        led1=0;
                        led2=1;
                        led3=0;
                        led4=1;
                        }
                        
                        r++;
                        wait(1);
                        }
                        if(r==10)
                        r=0;
            //          }  break;
                    }
               }
               else if(chk1==41)
                    {
                    if(Code2[0]==5 && Code2[1]==6 && Code2[2]==7 && Code2[3]==8) {
                        lcd.cls();
                        lcd.printf("PINCODE ACCEPTED");
                        wait(5);
                        test2=true;
                        lcd.printf("LEVEL 2 Cleared");
                        wait(3);
                        lcd.cls();
                        lcd.printf("Welcome MR. Vg");
                        wait(4);
                        lcd.printf("your amount is 125$");
                        wait(3);
                        //break;
                    } else {
                        lcd.cls();
                        lcd.printf("Intruder Alert");
                        wait(5);
                        ////////start of capture
                        lcd.cls();
                        lcd.printf("Camera module");
    //newline();
    lcd.cls();
    lcd.printf("Resetting...");
    //newline();
    wait(1);
 
    if (cam1.reset() == 0) {
        
        lcd.cls();
        lcd.printf("Reset OK.");
        wait(2);////newline();
    } else {
        lcd.cls();
        lcd.printf("Reset fail.");
        wait(2);////newline();
        error("Reset fail.");
    }
    wait(1);
 
    int cnt = 0;
            char fname[64];
        snprintf(fname, sizeof(fname) - 1, FILENAME, cnt);
        int r = capture(&cam1, fname);
        if (r == 0) {
        lcd.cls();
            lcd.printf("[%04d]:OK.", cnt);
            wait(2);////newline();
            led1=1;
        } else {
            lcd.cls();
            lcd.printf("[%04d]:NG. (code=%d)", cnt, r);
            wait(2);////newline();
            error("Failure.");
            led2=1;
        }
        cnt++;
    /////////////end of capture
                        
                        while(r!=10)
                       { 
                         if(r%2!=0)
                         {
                        led1=1;
                        led2=0;
                        led3=1;
                        led4=0;
                        }
                        if(r%2==0)
                        {
                        led1=0;
                        led2=1;
                        led3=0;
                        led4=1;
                        }
                        
                        r++;
                        wait(1);
                        }
                        if(r==10)
                        r=0;
                        //break;
                    }
                    }
            
            enter=0;
            } //end of enter
            else if(end)
            {  
            lcd.cls();
            lcd.printf("ending");
            wait(3);
            end=0;
            } //end of end
  }//end of b==1
            
            
            }
        }


    }

Note

The I2C pullups on SDA and SCL are not provided on the touch keypad board, so add two 4.7K ohm pullups to 3.3V to the circuit. The other breakout board with the MPR121 only, has the pullups on the board.

Uses(Future Steps)

With slight modifications, the system can also be used in ATM machines, wherein if an unauthorized person tries to withdraw money from another person's account, then the unauthorized user's image will be captured and saved on an SD card or sent via the internet to the Police Department.

References


Please log in to post comments.