SlideShare a Scribd company logo
1 of 63
Download to read offline
ARM BASED 4 – BIT CODED LOCKER WITH ELECTRIC SHIELD
A project report submitted in partial fulfilment of the requirements for
the award of the degree of
BACHELOR OF TECHNOLOGY
In
ELECTRONICS & COMMUNICATION ENGINEERING
By
B.V.S.ALEKHYA 10521A04A1
SHUBHAM KUMAR 10521A0487
D.V.Y.V.SUBBA RAO 11525A0403
ROHIT SOURABH 10521A0484
V.BHANU CHAITANYA 10521A04A4
Under the guidance of
Asst. Prof.
Depatment of Electronics & Communication Engineering
VITAM College of Engineering
(Affiliated to JNTU, Kakinada, A.P)
Visakhapatnam – 531173
2010 - 2014
VISWANADHA INSTITUTE OF TECHNOLOGYAND MANAGEMENT
(Affiliated to JNTU-Kakinada)
MINDIVANIPALEM, VISAKHAPATNAM - 531173
BONAFIDE CERTIFICATE
This is to certify that this project work entitled: “ARM BASED 4-BIT CODED LOCKER
WITH ELECTRIC SHIELD” is the bonafide work of B.V.S.ALEKHYA (10521A04A1),
SHUBHAM KUMAR(10521A0487), D.V.Y.V.SUBBA RAO (11525A0403), ROHIT
SOURABH(10521A0484) and V.BHANU CHAITANYA (10521A04A4) of final year B.Tech.
ECE which they have submitted in partial fulfilment of the requirements for the award of
Bachelor of Technology in ELECTRONICS AND COMMUNICATION ENGINEERING
during the academic period of 2013-2014.
PROJECT GUIDE HEAD OF THE DEPARTMENT
A.V.N.CHANDRA SEKHAR
Assistant professor Associative professor B.E, M.Tech.,(Ph.D )
INTERNAL EXMINER EXTERNAL EXAMINER
DECLARATION
I declare that this project entitled “ARM BASED 4-BIT CODED LOCKER
WITH ELECTRIC SHIELD” has been carried out by me and contents have been
presented in the form of dissertation in partial fulfilment of the requirements for the award of the
degree of Bachelor of Technology in ELECTRONICS AND COMMUNICATION
ENGINEERING.
Submitted By
B.V.S. ALEKHYA (10521A04A1)
SHUBHAM KUMAR (10521A0487)
D.V.Y.V. SUBBA RAO (11525A0403)
ROHIT SOURABH (10521A0484)
V. BHANU CHAITANYA (10521A04A4)
ACKNOWLEDGEMENT
We express our deep sense of gratitude to Smt. K. RAJA RAJESWARI madam, B.E,
M.E., Ph.D., Principal of VISWANADHA INSTITUTE OF TECHNOLOGY AND
MANAGEMENT, Visakhapatnam for permitting us to carry out this project work.
It is a pleasure to thank Sri. A.V.N.Chandra Shekhar, HOD, Associative Professor,
Viswanadha Institute of Technology and Management for permitting us to carry out this project
work and for guiding us throughout this endeavour and also helping us to take crucial decisions
at various stages.
We express our sincere thanks to Sri ravi , Assistant professor, VITAM
College, for his intelligent advices and his perpetual encouragement.
We pay homage to our parents, for the financial support and also for the moral support
they have given us throughout this project.
Finally, we are thankful to all the teaching and non – teaching staff of Department of ECE
for their constant co-operation throughout the project.
B.V.S. ALEKHYA (10521A04A1)
SHUBHAM KUMAR (10521A0487)
D.V.Y.V. SUBBA RAO (11525A0403)
ROHIT SOURABH (10521A0484)
V. BHANU CHAITANYA (10521A04A4)
CONTENTS
1. INTRODUCTION
LIST OF FIGURES
CHAPTER-1
INTRODUCTION
The aim of this project is to provide effective security measures for the users. Here the
users can open their respective lockers by the specified user id and password. The main
disadvantage of bulky, mechanical systems is their cost. This disadvantage of conventional
lockers can be overcome by using electronic locker with electric shield. This locker is mainly
designed for use in banks where the requirement of security for customer’s valuables is
prominent.
If the user wants to access their locker, they should enter the valid 4 digit alphanumeric
code. If the entered code matches the actual code, the lock opens resulting in the slow opening of
the drawer. If the entered password is wrong, buzzer buzzes alerting the user for retyping the
password.If the user is not able to type the correct password in their 3rd
attempt,then an Audio
Signal will be generated which can be obtained on a speaker.This audio signal will last for
around 15 seconds , thus alerting the security personnel at a distance.The Locker will remain
inactive for 30 more seconds after the Audio Signal stops, thus adding a high level of security in
the whole system. After this period, the user can again try to enter their password, and the whole
process repeats.If the burglar goes a step forward in breaking the locker then he will be subjected
to shock.
The basic units for this locker are:
1. Controlling unit
2. Locking unit
Controlling unit:
The controlling unit of the locker system plays the most important role in the operation of the
locker system. It is heart and brain of the system. The control unit consists of ARM processor,
crystal oscillator circuit, LCD display, PS2 connector and Audio Output Jack. All these
components are available on a single board, “Blue Board-LPC2148”.
Blue board:
BlueBoard-LPC214X is an evaluation board for LPC2148 ARM7TMDI(-S) based
microcontroller. The LPC2148 microcontroller has 512KB of internal flash and
32+8K RAM. Following are the salient features of the board:
Power:
On-board linear regulators generate +3.3V/500mA and +5v/500mA from power
supply.
USB connector ( as alternate power source).
Connectors:
Extension headers for all microcontroller pins.
RS232 (2 ports),VGA ,PS/2,Audio Jack,JTAG,
SD/MMC,USB B-type with Link-LED,
All peripheral configurable via jumpers.
Other Peripherals:
Audio power amplifier.
2 line X 16 character LCD with back light control(using 10K POT).
Configurable for manual and automatic program download(ISP) via serial port.
8 controllable LEDs on SPI using 74HC595,Buzzer,10K POT connected to ADC line
1 user input button connected to interrupt line.
The LPC2141/2/4/6/8 microcontrollers are based on a 32/16 bit ARM7TDMI-S CPU with
real-time emulation and embedded trace support, that combines the microcontroller with
embedded high speed flash memory ranging from 32 kB to 512 kB. A 128-bit wide
memory interface and a unique accelerator architecture enable 32-bit code execution at
the maximum clock rate. For critical code size applications, the alternative 16-bit Thumb
mode reduces code by more than 30 % with minimal performance penalty.
BlueBoard-LPC2148 Visual Overview
Microcontroller NXP LPC 2148 Pin diagram:
The complete IC Layout with other peripherals involved in the project:
ARM7TDMI(-S) Registers Involved in the Project:
DACR
-(Digital-Analog Conversion)
IODIR
-(Data Direction Register for various Pins)
IOSET
-(Register to set Pin HIGH)
IOCLR
-(Register to set Pin LOW)
IOPIN
-(Register to check the status of the Pin)
PINSEL
-(To define the function of a Pin for a relevant task)
EXTMODE
-(The External Interrupt Mode Register controls whether each pin is edge- or level sensitive)
EXTPOLAR
-(The External Interrupt Polarity Register controls which level or edge on each pin will cause an
Interrupt)
EXTINT
-(The External Interrupt Flag Register contains interrupt flags for EINT0, EINT1, EINT2 and EINT3)
VICIntSelect
-(Interrupt Select Register. This register classifies each of the 32 interrupt requests as contributing to FIQ
or IRQ)
VICVectAddr
-(Vector Address Register. When an IRQ interrupt occurs, the IRQ service routine can read this register
and jump to the value read)
VICVectCntl
-(vectorControl Registers 0-15 each control one of the 16 vectoredIRQ slots. Slot 0 has the highest priority
and slot 15 the lowest)
Pins Involved:
There are 48 GPIO (General Purpose Input Output) Pins available in this microcontroller.
There are 2 ports in ARM7TDMI(-S) core viz., Port 0 and Port 1.
There are 32 GPIO pins in Port 0 from P0.0 to P0.31 and 16 pins in Port 1 from P1.16 to P1.31.
These pins can be used for various input and output functions like Keyboard interfacing, LCD interfacing,
Buzzer Connectivity, LED Connectivity, driving Relay, etc.
Due to the availability of large number of pins, various Lockers can be connected to a single Blueboard
NXP LPC 2148 microcontroller module like this.
Locking unit:
Locking unit of the locker controls the closing and opening of the drawer. The locking unit
consists of a geared motor, relay circuit, and shock circuit (whose terminals are further connected
to an LED circuit which indicates the safety of usage for the locker).
The geared motor is used in locking system to push the drawer open at the mention of valid
password and it also pulls the drawer inward to lock state also after the mention of correct
password. The geared motor gets the supply from the supply circuit connected against it.
The relay circuit is used as a switch between shock mode and open/close mode of locker. The
relay circuit is driven from one of the GPIO pins of the microcontroller. The relay used in this
case also has SPDT switch which ensures the opening and closing of drawer.
The shock circuit is also connected to relay and it is placed inside the walls of the drawer and it
is insulated. The shock circuit’s main purpose is to subject anyone,who tries to break into the
locker without giving the valid password, to shock. The shock circuit typically can subject a man
to a shock of 230volts. However, due to the potential damage it causes, we have used only 12
volts shock.
Operation Of the Microcontroller Module:
Peripherals Needed:
•An External QWERTY Keyboard attached to the PS2 port of the microcontroller
•A 2X 16 character LCD pre-attached with the BlueBoard
•A speaker connected to the Audio Jack of the BlueBoard
Operation:
There is a pre-stored 4-bit alphanumeric password in the ROM of the
microcontroller. This password is used to open/close the Lock in this project. When
the user enters a password using the Keyboard attached to the Blueboard, then the
logic built in the Embedded C program checks it with the pre-stored password.
If both the passwords match, then the LCD displays the “ Correct Password”
message and after 2 seconds instructs the user to toggle up/down the Red Switch
connected to the relay by displaying a message “Toggle Red Switch”. The Up
toggling ensures the Locker comes out and the Down toggling ensures that it goes
in. After toggling the Red Switch ,the Pin 0.8 gives a HIGH voltage of 3.3 V for
the next 50 seconds. The Locker requires this much amount of time for
opening/closing. After 50 seconds, the LCD displays the message as “Operation
Over”.The user needs to do the same set of actions for the reverse operation also.
If the password entered by the user is wrong, then the LCD will display the
message as “Password Wrong, Try Again” by alarming with a buzzer attached to
the Blueboard and gives the user 2 more chances of entering the correct password.
If the user still fails to type the correct password in their 3rd
attempt,then the LCD
displays the message as “Security Alarm” and the microcontroller will send a
Security alarm signal by generating an audio signal for 15 seconds which will be
played on the speaker. This audio signal will be of very high volume and can be
heard from a very long distance, thus enabling the Security Personnel to take some
actions and check the Locker for security measures. After the security alarm, the
LCD displays the message as “Maximum Attempts Made, Try after 30 seconds”
and the Buzzer sounds repeatedly for the next 30 seconds and the Microcontroller
deactivates the Keyboard Peripheral for this much amount of time. After 30
seconds the Keyboard console gets reactivated, the user can try to enter the
Password again, and the whole process goes on like this.
Visual Outputs:
1.Keyboard attached with the BlueBoard-LPC2148
2. The Normal display on the LCD when no password has been entered
3. When the user enters the correct password, the LCD diplays the following message
After 2 seconds, the message on the LCD appears as
After 3 seconds, the Locker starts opening and the LCD displays the following
message
4. If the user enters wrong password in their 3rd
attempt, then LCD displays the
following message
Then a security alert message on the LCD appears with audio signal on the
speaker
Block diagram:
RELAY CIRCUIT:
A relay is an electrically operated switch. Current flowing through the coil of the relay
creates a magnetic field which attracts a lever and changes the switch contacts. The coil current
can be on or off so relays have two switch positions and they are double throw (changeover)
switches.
There are 5 Pins in a relay. Two pins A and B are two ends of a coil that are kept inside the relay.
The coil is wound on a small rod that gets magnetized whenever current passes through it.
COM/POLE is always connected to NC(Normally connected) pin. As current is passed through
the coil A, B, the pole gets connected to NO(Normally Open) pin of the relay.
Electronic lock:
The electronic lock is made by using a geared motor.We have used the actuator technology for
improvising the locking system and designed a special structure. As per the correct password, the
locking system will work. If the correct password is entered the drawer will get automatically
opened. In case of wrong password, it will give 2 more chances.If the user is not able to type the
correct password in the next 2 chances,then an alarming audio signal will be generated which
lasts for 15 seconds and the system will be deactivated for the next 30 seconds after the
completion of the Alarm Audio signal . After this time is elapsed, the whole process begins
again.
Geared motor:
Geared motors are complete motive force systems consisting of an electric motor and a reduction
gear train integrated into one easy-to-mount and –configure package. This greatly reduces the
complexity and cost of designing and constructing power tools, machines and appliances calling
for high torque at relatively low shaft speed or RPM. The gear assembly helps in increasing the
torque and reducing the speed. Using the correct combination of gears in a gear motor, its speed
can be reduced to any desirable figure. This concept where gears reduce the speed of the vehicle
but increase its torque is known as gear reduction.
Operation principle:
Most synchronous AC electric motors have output ranges of from 1,200 to 3,600 revolutions per
minute. They also have both normal speed and stall-speed torque specifications. The reduction
gear trains used in gear motors are designed to reduce the output speed while increasing the
torque. The increase in torque is inversely proportional to the reduction in speed. Reduction
gearing allows small electric motors to move large driven loads, although more slowly than
larger electric motors. Reduction gears consist of a small gear driving a larger gear. There may be
several sets of these reduction gear sets in a reduction gear box.
Applications of gear motors:
Garage door openers, stair lifts, timer cycle knobs on washing machines, power drills,
electromechanical clocks. These all use various integrations of gear motors to drive a large force
from a relatively small electric motor at a manageable speed. In industry, gear motor
applications in jacks, cranes, lifts, clamping, robotics, conveyance and mixing are too numerous
to count.
Dpdt switch:
we used this dpdt switch for opening and closing of the locker, if we want the drawer to come
out it should be toggled to upwards for going inside it should be toggled downwards. The
internal connections will be shown as given below:
The model view of dpdt toggle switch
Electric shield:
The most exciting feature that which we are adding in this locking system is
electric shield which protects the valuables in the locker, the electric field will be passed in the
conductor which is placed inside the walls of the drawer, this will be on all the time but during
the correct password is given the shock will goes off and drawer gets opened automatically, the
danger light indication will be shown by using LED light indication circuit which is in red color.
Power supply:
The total system works under 12v dc supply so we have attained the subsequent voltage by using
following circuit
Circuit:
Components required: Quantity
ď‚· Transformer(230 to12)v step down 1
ď‚· Bridge rectifier 1A 1
ď‚· IC1 7812 1
ď‚· IC2 7805 1
ď‚· Resistor 4.7k 1
ď‚· Capacitor0.1uf 3
ď‚· Electrolyte capacitor2200uf 1
ď‚· Electrolyte capacitor10uf 1
ď‚· LED 1
ď‚· Buzzer 1
ď‚· Speaker 1
Softwares Required:
1. Keil uVision 4.6 IDE (For writing and compiling the program in Embedded C)
2. Flash Magic (For flashing the microcontroller with Bootloader)
Programs in Embedded C:
(main.c)
#include "lcd.h"
#include "ps2kbd.h"
#include <lpc21xx.h>
int main (void)
{
init_lcd();
init_keyboard();
while (1)
{
if(keyhit())
{
init3_lcd();
init_keyboard();
}
}
}
(LCD_DAC.C)
// This program is for LCD display and Digital-Analog Conversion for
Audio Output
#include <LPC214x.H> /* LPC214x definitions */
#include "lcd.h"
#include "utils.h"
#define LCD_BACK_LIGHT_TIMEOUT 1000
#define LCD_BACKLIGHT (1 << 21)
#define LCD_BACK_LIGHT_DIR IO1DIR
#define LCD_BACK_LIGHT_SET IO1SET
#define LCD_BACK_LIGHT_CLR IO1CLR
#define LCD_DATA_DIR IO0DIR
#define LCD_DATA_SET IO0SET
#define LCD_DATA_CLR IO0CLR
#define LCD_CTRL_DIR IO1DIR
#define LCD_CTRL_SET IO1SET
#define LCD_CTRL_CLR IO1CLR
#define LCDRS (1 << 24)
#define LCDRW (1 << 23)
#define LCDEN (1 << 22)
#define LCD_D4 (1 << 10)
#define LCD_D5 (1 << 11)
#define LCD_D6 (1 << 12)
#define LCD_D7 (1 << 13)
#define LCD_DATA_MASK (LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7)
#define LCD_BUSY_FLAG LCD_D7
#define LCD_CONTROL_MASK 0x01C00000
extern int flag=0;
extern int i=0;
void lcd_putstring( unsigned char line,unsigned char string[10] );
void lcd_putchar(unsigned char c[10]);
#define DAC_BIAS 0x00000000
void DAC_test(void)
{
int i=0,j=0;
int k=0;
for(k=0;k<80000;k++)
{
DACR = (i << 8) | DAC_BIAS;
i++;
for(j = 5000; j > 1; j--);
if ( i == 1024 )
{
i = 0;
}
}
}
void DACInit( void )
{
/* setup the related pin to DAC output */
PINSEL1 |= 0x00080000; /* set p0.225 to DAC output */
return;
}
/**
**************************************************************************************
******
Function Name : wait_lcd()
Output : Void
Note :
**************************************************************************************
******
*/
void wait_lcd( void )
{
IO1CLR |= (1 << 24); //LCDRS
IO1SET |= (1 << 23) |(1 << 22); //LCDRW |LCDEN
while(IO1PIN & LCD_BUSY_FLAG); /* wait for busy flag to become low */
IO1CLR |= (1 << 22) |(1 << 23); // LCDEN | LCDRW;
IO0DIR |= LCD_DATA_MASK;
delay(100);
}
/**
**************************************************************************************
******
Function Name : lcd_command_write()
Output : Void
Note :
**************************************************************************************
******
*/
void lcd_command_write( unsigned char command )
{
unsigned char temp=0;
unsigned int temp1=0;
temp=command;
temp=(temp>>4)&0x0F;
temp1=(temp<<10)&LCD_DATA_MASK;
IO1CLR = (1 << 24); //LCDRS
IO1SET = (1 << 22); //LCDEN
IO0CLR = LCD_DATA_MASK; //(LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7)
IO0SET = temp1;
delay(10000);
IO1CLR = (1 << 22); //LCDEN
temp=command;
temp&=0x0F;
temp1=(temp<<10)&LCD_DATA_MASK; // (LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7)
delay(100*2);
IO1CLR |=(1<<24); // LCDRS
IO1SET |=(1<<22); // LCDEN
IO0CLR = LCD_DATA_MASK; //(LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7)
IO0SET = temp1;
delay(10000);
IO1CLR |= (1<<22); //LCDEN
wait_lcd();
}
/**
**************************************************************************************
******
Function Name : set_lcd_port_output()
Output : Void
Note :
**************************************************************************************
******
*/
void set_lcd_port_output( void )
{
IO1DIR |= ((1<<22)|(1<<24)|(1<<23));
IO1CLR |= ((1<<22)|(1<<24)|(1<<23));
IO0DIR |= LCD_DATA_MASK;
}
/* *
**************************************************************************************
******
Function Name : lcd_clear()
Output : Void
**************************************************************************************
******
*/
void lcd_clear( void)
{
lcd_command_write( 0x01 );
}
/**
**************************************************************************************
******
Function Name : lcd_gotoxy()
Output : Void
Note :
**************************************************************************************
******
*/
int lcd_gotoxy( unsigned int x, unsigned int y)
{
int retval = 0;
if( (x > 1) && (y > 15) )
{
retval = -1;
} else {
if( x == 0 )
{
lcd_command_write( 0x80 + y ); /* command - position cursor at 0x00 (0x80 + 0x00 ) */
} else if( x==1 ){
lcd_command_write( 0xC0 + y ); /* command - position cursor at 0x40 (0x80 + 0x00 ) */
}
}
return retval;
}
/**
**************************************************************************************
******
Function Name : lcd_data_write()
Output : Void
Note :
**************************************************************************************
******
*/
void lcd_data_write(unsigned char data)
{
char temp=0;
int temp1=0;
temp=data;
temp=(temp>>4)&0x0F;
temp1=(temp<<10)&LCD_DATA_MASK;
IO1SET |= (1<<22)|(1<<24); //LCDEN|LCDRS
IO0CLR = LCD_DATA_MASK;
IO0SET = temp1;
IO1CLR |= (1<<22); //LCDEN
temp=data;
temp&=0x0F;
temp1=(temp<<10)&LCD_DATA_MASK;
IO1SET |= (1<<22)|(1<<24);
IO0CLR = LCD_DATA_MASK;
IO0SET = temp1;
IO1CLR |= (1<<22); //LCDEN
wait_lcd();
}
/**
**************************************************************************************
******
Function Name : lcd_putchar()
Output : Void
Note :
**************************************************************************************
******
*/
void lcd_putchar(unsigned char * c)
{
int i=0;
lcd_data_write(c[i]);
}
/**
**************************************************************************************
******
Function Name : lcd_putstring()
Output : Void
Note :
**************************************************************************************
******
*/
void lcd_putstring( unsigned char line,unsigned char *string )
{
unsigned char len = 16; //MAX_CHAR_IN_ONE_LINE
lcd_gotoxy( line, 0 );
while(*string!= '0' && len--)
{
lcd_putchar((unsigned char*)string);
string++;
}
}
/**
**************************************************************************************
******
Function Name : lcd_backlight_on()
Output : Void
**************************************************************************************
******
*/
void lcd_backlight_on()
{
IO1DIR |= (1 << 21); //LCD_BACKLIGHT
IO1SET |= (1 << 21); //LCD_BACKLIGHT
}
/**
**************************************************************************************
******
Function Name : turn_off_lcd_back_light()
Output : Void
**************************************************************************************
******
*/
void turn_off_lcd_back_light_cb(void)
{
IO1DIR |= (1 << 21); //LCD_BACKLIGHT
IO1CLR |= (1 << 21); //LCD_BACKLIGHT
}
/**
**************************************************************************************
******
Function Name : init_lcd()
Output : Void
Note :
**************************************************************************************
******
*/
void init_lcd( void )
{
set_lcd_port_output();
delay(100*100);
lcd_command_write(0x28); /* 4-bit interface, two line, 5X7 dots. */
lcd_clear() ; /* LCD clear */
lcd_command_write(0x02); /* cursor home */
lcd_command_write(0x06); /* cursor move direction */
lcd_command_write(0x0C) ; /* display on */
lcd_gotoxy(0, 0);
lcd_clear();
lcd_putstring(0,"Enter Password");
}
void init2_lcd( void )
{
IO0DIR|=(1<<31);
IO0DIR|=(1<<8);
set_lcd_port_output();
delay(100*100);
lcd_command_write(0x28); /* 4-bit interface, two line, 5X7 dots. */
lcd_clear() ; /* LCD clear */
lcd_command_write(0x02); /* cursor home */
lcd_command_write(0x06); /* cursor move direction */
lcd_command_write(0x0C) ; /* display on */
lcd_gotoxy(0, 0);
lcd_clear();
lcd_putstring(0,"Correct Password");
delayy(450);
lcd_gotoxy(0, 0);
lcd_clear();
lcd_putstring(0," Toggle ");
lcd_putstring(1," Red Switch ");
delayy(300);
lcd_gotoxy(0, 0);
lcd_clear();
lcd_putstring(0,"Please Wait...");
IO0CLR|=(1<<31);
IO0SET|=(1<<8);
delayy(7500);
IO0SET|=(1<<31);
IO0CLR|=(1<<8);
}
void init4_lcd( void )
{
lcd_gotoxy(0, 0);
lcd_clear();
lcd_putstring(0," Operation Over ");
delayy(200);
init_lcd();
init_keyboard();
}
void init5_lcd( void )
{
lcd_gotoxy(0, 0);
lcd_clear();
lcd_putstring(0,"please wait...");
}
void init6_lcd( void )
{
lcd_gotoxy(0, 0);
lcd_clear();
lcd_putstring(0," Operation Over");
lcd_putstring(1," Press Reset");
}
void init3_lcd( void )
{
DACInit();
IO1DIR|=(1<<25);
flag+=1;
if(flag==3)
{
lcd_gotoxy(0, 0);
lcd_clear();
lcd_putstring(0,"maximum attempts ");
lcd_putstring(1," made ");
delayy(300);
lcd_gotoxy(0, 0);
lcd_clear();
lcd_putstring(0,"Security Alert");
DAC_test();
delayy(300);
lcd_gotoxy(0, 0);
lcd_clear();
lcd_putstring(0," try after 30 ");
lcd_putstring(1," seconds ");
while(i!=30)
{
IO1CLR|=(1<<25);
delayy(100);
IO1SET|=(1<<25);
delayy(70);
i++;
}
i=0;
flag=0;
goto a;
}
lcd_gotoxy(0, 0);
lcd_clear();
lcd_putstring(0," Wrong Password ");
lcd_putstring(1," Try again ");
IO1CLR|=(1<<25);
delayy(100);
IO1SET|=(1<<25);
a:init_lcd();
init_keyboard();
while (1)
{
if(keyhit())
{
init3_lcd();
init_keyboard();
}
}
}
(Keyboard.c)
//This Program is for connecting the PS2 Keyboard and contains logic for the operation of work to be
done when the password is right/wrong
#include "ps2kbd.h"
#include "lpc_vic.h"
#include "scancodes.h"
#include <LPC214x.H> /* LPC214x definitions */
#include "utils.h"
/**
*****************************************************************************
Function Name : extISR1()
******************************************************************************
*/
void extISR0(void) __irq;
U8 keyBuf[KBUFFSIZE]; //KBUFFSIZE=4.....PS2 Keyboard buffer, the register to store
characters key in
U8 keyIn; //Index into PS/2 key buf where next scan code will be inserted
U8 keyOut; //Index into PS/2 key buf where next scan code will be removed
U8 keyRead; //Number of keys read from the PS/2 keyboard
U8 bitcount; // 0 = neg. 1 = pos.
unsigned char key[11];
/**
*****************************************************************************
Function Name : init_keyboard()
******************************************************************************
*/
U8 init_keyboard(void)
{
IO0CLR = KB_CLK; //KB_CLK=BIT16=0x00010000..P0.4=1.....hold keyboard clock line untill
ready
EXTMODE |= 0x01; /* EINT0_EDGE..... INT0 edge trigger */
EXTPOLAR |= 0x0; /* INT0 is falling edge by default */
PINSEL1 |= 0x00000001; //KBD_PINSEL=1.16=PS2 data
/* initialize the interrupt vector */
VICIntSelect &= ~ (1<<14); //VIC_BIT(VIC_EINT0)..... pg.56 datasheet..EINT0 selected as IRQ
VICVectAddr2 = (unsigned int)extISR0; // address of the ISR
VICVectCntl2 = (1<<5|14); //VIC_ENABLE | VIC_EINT0..pg.57 datasheet
VICIntEnable = (1<<14); //VIC_BIT(VIC_EINT0)..... EINT0 interrupt enabled
bitcount = 0;
keyIn =0;
keyOut=0;
keyRead=0;
EXTINT = EINT0;
/* clear interrupt */
return(1); //1=TRUE
}
/**
*****************************************************************************
Function Name : decode()
******************************************************************************
*/
void decode(U8 sc)
{
static unsigned char is_up=0, shift = 0; //, mode = 0;
unsigned char i;
if (!is_up) /* Last data received was the up-key identifier */
{
switch (sc)
{
case BREAKCHAR : /* The up-key identifier */
is_up = 1;
break;
case NONUMCODE :
break;
case LEFTSHIFT :
shift = 1;
break;
case RIGHTSHIFT:
shift = 1;
break;
default:
if (!shift) /* If shift not pressed */
{
// do a table look-up
for (i = 0; unshifted[i][0]!=sc && unshifted[i][0]; i++);
if (unshifted[i][0] == sc)
{
putkeybuf((unshifted[i][1]));
}
}
else
{
/* look-up */
for (i = 0; shifted[i][0]!=sc && shifted[i][0]; i++);
if (shifted[i][0] == sc)
{
putkeybuf((shifted[i][1]));
}
}
break;
}
}
else
{
is_up = 0;
switch (sc)
{
case LEFTSHIFT :
case RIGHTSHIFT:
shift = 0;
break;
}
}
}
/**
*****************************************************************************
Function Name : putkeybuf()
******************************************************************************
*/
void putkeybuf (U8 key)
{
if (keyRead <8) //KBUFFSIZE=4..make sure that we don't overflow the buffer
{
keyRead++; //Increment the number of keys read
keyBuf[keyIn++] = key; //Store the scan code into the buffer
if (keyIn >=8) //KBUFFSIZE..Adjust index to the next scan code to put
in buffer
{
keyIn = 0;
}
}
if(keyBuf[0]=='a' && keyBuf[1]=='b' && keyBuf[2]=='1' && keyBuf[3]=='2')
{
init2_lcd();
init4_lcd();
}
}
/*
*****************************************************************************
Function Name : keyhit()
******************************************************************************
*/
U8 keyhit(void)
{
unsigned char hit;
hit = (unsigned char)(keyRead >4)? 1 : 0;
return(hit);
}
/**
*****************************************************************************
Function Name : xgetkey()
******************************************************************************
*/
char xgetkey(void)
{
unsigned char key=0;
if (keyRead > 0)
{
keyRead--; /* Decrement the number of keys in the buffer */
key = keyBuf[keyOut]; /* Get scan code from the buffer */
keyOut++;
if (keyOut >= 4) //KBUFFSIZE
{
keyOut = 0;
}
}
return (key); /* return the scan code of
the key pressed */
}
(utils.c)
//This program contains all the important functions required for the keyboard connectivity along
with different delay functions used in other programs.
/*
USB Firmware Upgrader
Copyright © 2006 Yuri Tiomkin
All rights reserved.
Permission to use, copy, modify, and distribute this software in source
and binary forms and its documentation for any purpose and without fee
is hereby granted, provided that the above copyright notice appear
in all copies and that both that copyright notice and this permission
notice appear in supporting documentation.
THIS SOFTWARE IS PROVIDED BY THE YURI TIOMKIN AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL YURI TIOMKIN OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
#include <LPC214x.H> /* LPC214x definitions */
#include "type.h"
#include "string.h"
typedef void (*IAP)(unsigned int [],unsigned int[]);
//----------------------------------------------------------------------------
void * s_memset(void * dst, int ch, int length)
{
register char *ptr = (char *)dst - 1;
while(length--)
*++ptr = ch;
return dst;
}
//----------------------------------------------------------------------------
void * s_memcpy(void * s1, const void *s2, int n)
{
register int mask = (int)s1 | (int)s2 | n;
if(n == 0)
return s1;
if(mask & 0x1)
{
register const char *src = s2;
register char *dst = s1;
do
{
*dst++ = *src++;
}while(--n);
return s1;
}
if(mask & 0x2)
{
register const short *src = s2;
register short *dst = s1;
do
{
*dst++ = *src++;
}while( n -= 2);
return s1;
}
else
{
register const int *src = s2;
register int *dst = s1;
do
{
*dst++ = *src++;
}while (n -= 4);
return s1;
}
}
U8 s_strncmp(U8 *s1,U8 *s2, U32 num)
{
U8 retval=0;
U32 i=0;
for(i=0;i<num;i++)
{
if(*(s1+i) != *(s2+i))
{
retval = 1;
break;
}
}
return retval;
}
int divide(int a, int b)
{
int result = 0;
int temp = b;
while (temp >= b)
{
temp = a - b * result++;
}
return result-1;
}
void reverse(char s[])
{
int c, i, j;
for (i = 0, j = strlen(s)-1; i<j; i++, j--) {
c = s[i];
s[i] = s[j];
s[j] = c;
}
}
void u_itoa( int n, char s[] )
{
int i, sign;
if(( sign = n ) < 0 )
n = -n;
i = 0;
do
{
s[i++] = n % 10 + '0';
} while(( n /= 10 ) > 0 );
if( sign < 0 )
s[i++] = '-';
s[i] = '0';
reverse( s );
}
/**
**************************************************************************
****1111
Function Name : delay()
Description :This function suspends the tasks for specified ticks.
Input : ticks:no of ticks in multiple of 1 usec
task: task to be suspended
Output : void
*******************************************************************************
*/
void delay(int count)
{
int j=0,i=0;
for(j=0;j<count;j++)
{
/* At 60Mhz, the below loop introduces
delay of 10 us */
for(i=0;i<35;i++);
}
}
void delayy(unsigned int t)
{
int i,j;
for(j=0;j<t;j++)
for(i=0;i<50000;i++);
}
(extISR.C)
//This program contains the instruction sets for the hardware
interrupts required when a keyhit is made from the keyboard.
#include <LPC214x.H> /* LPC214x definitions */
#include "ps2kbd.h"
#include "utils.h"
#define kbDAT (IO1PIN & (KB_DAT))
#define kbCLK (IO0PIN & (KB_CLK))
#define K_STARTBIT 1
#define K_PARITYBIT 10
#define K_STOPBIT 11
extern unsigned char bitcount;
/**
*****************************************************************************
Function Name : extISR0()
******************************************************************************
*/
void extISR0(void) __irq
{
static U8 key_data; // Holds the received scan code
U32 clkstat;
U32 datstat;
U32 paritystat;
clkstat = IO0PIN & (IO0PIN & 0x00010000); //kbCLK=(IO0PIN &
BIT16=0x00010000)=>P0.4=1.....check CLK pin state;
datstat = kbDAT; //kbDAT=(IO1PIN & (KB_DAT))...P1.16=>PS2 data..check DAT pin state;
bitcount++;
if (bitcount==1) //K_STARTBIT
{
if (datstat || clkstat) bitcount=0;
key_data=0;
paritystat=0;
}
else if (bitcount==10) //K_PARITYBIT
{
paritystat = datstat;
}
else if (bitcount==11) //K_STOPBIT
{
decode (key_data);
bitcount=0;
}
else
{
// For all bits from 2, 3...9 (total 8-bit)
key_data= key_data >> 1;
if (datstat)
{
key_data = key_data | 0x80;
}
}
EXTINT = 0x01; //clear interrupt
VICVectAddr = 0;
}//extISR
Steps to be performed for typing the complete program in Keil uVision 4.6
IDE:
1. Go to Project-> New uVision Project.
2. Save the project in some folder with the extension *.uVproj
3. Then Select the Microcontroller being used. In our Project, we have selected
NXP LPC 2148.
4. Add all the files to the Project after writing programs in separate files.
5. Now go to Flash->Configure Flash Tools,then go to the Target tab and
select the on-chip I-ROM 1 area address from 0x2000. It has been done so
because the flashed Bootloader program occupies the area upto 0x2000
address.
6. Under the User tab tick the check box Run #1 and type in the box the
following: fromelf --bin .ObjPS2KBD_LCD.axf -o .Obja.bin
This is done in order to create a .Bin Object file from .C file.
AXF refers to Arm Executable Format. It changes the format from .axf to
.bin which can then be saved into the ROM of the microcontroller using the
Bootloader functionality where the microcontroller can just behave like a
removable mass storage device and we can copy and paste the generated .bin
file into the mass storage device.
7. Now click on Project->Rebuild All Target Files. The Program will get
compiled and .bin file will be created inside the Obj folder as mentioned
above. .Bin file will be created only when there are no errors in the program.
Advantages involved in the project:
• Highly Secure due to the presence of multilevel security
• The development board requires just 3.3 V of power supply and hence
power consumption and dissipation are very low.
• Security alarm with the help of DAC is possible,thus alerting the
security personnel if any unauthorized repeated access is made more
than thrice.
• Inability for any unauthorized user to access the locker due to the
presence of all-time electric shock.
• One-minute blocking of the whole system if any unauthorized access
is made more than thrice.
• Made on a low budget of Rs. 4200 which is quite low as compared to
the similar type of system available in the market ranging from Rs.
15,000- Rs. 20,000.
ARM BASED 4bit coded locker

More Related Content

What's hot

Report on Embedded Based Home security system
Report on Embedded Based Home security systemReport on Embedded Based Home security system
Report on Embedded Based Home security systemNIT srinagar
 
Home automation ppt-kamal lamichhane
Home automation ppt-kamal lamichhaneHome automation ppt-kamal lamichhane
Home automation ppt-kamal lamichhaneKamal Lamichhane
 
Embedded based home security system
Embedded based home security systemEmbedded based home security system
Embedded based home security systemNIT srinagar
 
Role of easy vr in Arduino Speech Processing
Role of easy vr in Arduino Speech ProcessingRole of easy vr in Arduino Speech Processing
Role of easy vr in Arduino Speech ProcessingMohammad Rehan Khan
 
8 sem final report print copy (1)
8 sem final report print copy (1)8 sem final report print copy (1)
8 sem final report print copy (1)Jha Bhargav
 
gsm based security system
gsm based security systemgsm based security system
gsm based security systemnayandey
 
Presentation acs-03
Presentation acs-03Presentation acs-03
Presentation acs-03shreenath12393
 
home automaton using pc ppt
home automaton using pc ppthome automaton using pc ppt
home automaton using pc pptRajesh Kumar
 
Cellphone based home automation
Cellphone based home automationCellphone based home automation
Cellphone based home automationPROJECTRONICS
 
Presentation on home automation system
Presentation on  home automation systemPresentation on  home automation system
Presentation on home automation systemNamit Sood
 
Home automation
Home automationHome automation
Home automationHemang Patel
 
ALCOHOL DETC
ALCOHOL DETCALCOHOL DETC
ALCOHOL DETCJha Bhargav
 
Keypad locking system using 8051
Keypad locking system using 8051Keypad locking system using 8051
Keypad locking system using 8051manu anand
 
Alcohol Sensing Alert with Engine Locking Project
Alcohol Sensing Alert with Engine Locking Project Alcohol Sensing Alert with Engine Locking Project
Alcohol Sensing Alert with Engine Locking Project DINKAR MALI
 
Home automation using dtmf
Home automation using dtmfHome automation using dtmf
Home automation using dtmfPratik Gupta
 
Alcohol Detection System in Vehicle using Arduino
Alcohol Detection System in Vehicle using ArduinoAlcohol Detection System in Vehicle using Arduino
Alcohol Detection System in Vehicle using ArduinoIRJET Journal
 
Interfacing Bluetooth Modules with 8051 Microcontroller
Interfacing Bluetooth Modules with 8051 MicrocontrollerInterfacing Bluetooth Modules with 8051 Microcontroller
Interfacing Bluetooth Modules with 8051 MicrocontrollerPantech ProLabs India Pvt Ltd
 
microcontroller and embedded system
microcontroller and embedded systemmicrocontroller and embedded system
microcontroller and embedded systempradeep rana
 

What's hot (18)

Report on Embedded Based Home security system
Report on Embedded Based Home security systemReport on Embedded Based Home security system
Report on Embedded Based Home security system
 
Home automation ppt-kamal lamichhane
Home automation ppt-kamal lamichhaneHome automation ppt-kamal lamichhane
Home automation ppt-kamal lamichhane
 
Embedded based home security system
Embedded based home security systemEmbedded based home security system
Embedded based home security system
 
Role of easy vr in Arduino Speech Processing
Role of easy vr in Arduino Speech ProcessingRole of easy vr in Arduino Speech Processing
Role of easy vr in Arduino Speech Processing
 
8 sem final report print copy (1)
8 sem final report print copy (1)8 sem final report print copy (1)
8 sem final report print copy (1)
 
gsm based security system
gsm based security systemgsm based security system
gsm based security system
 
Presentation acs-03
Presentation acs-03Presentation acs-03
Presentation acs-03
 
home automaton using pc ppt
home automaton using pc ppthome automaton using pc ppt
home automaton using pc ppt
 
Cellphone based home automation
Cellphone based home automationCellphone based home automation
Cellphone based home automation
 
Presentation on home automation system
Presentation on  home automation systemPresentation on  home automation system
Presentation on home automation system
 
Home automation
Home automationHome automation
Home automation
 
ALCOHOL DETC
ALCOHOL DETCALCOHOL DETC
ALCOHOL DETC
 
Keypad locking system using 8051
Keypad locking system using 8051Keypad locking system using 8051
Keypad locking system using 8051
 
Alcohol Sensing Alert with Engine Locking Project
Alcohol Sensing Alert with Engine Locking Project Alcohol Sensing Alert with Engine Locking Project
Alcohol Sensing Alert with Engine Locking Project
 
Home automation using dtmf
Home automation using dtmfHome automation using dtmf
Home automation using dtmf
 
Alcohol Detection System in Vehicle using Arduino
Alcohol Detection System in Vehicle using ArduinoAlcohol Detection System in Vehicle using Arduino
Alcohol Detection System in Vehicle using Arduino
 
Interfacing Bluetooth Modules with 8051 Microcontroller
Interfacing Bluetooth Modules with 8051 MicrocontrollerInterfacing Bluetooth Modules with 8051 Microcontroller
Interfacing Bluetooth Modules with 8051 Microcontroller
 
microcontroller and embedded system
microcontroller and embedded systemmicrocontroller and embedded system
microcontroller and embedded system
 

Similar to ARM BASED 4bit coded locker

Wireless appliances control report
Wireless appliances control reportWireless appliances control report
Wireless appliances control reportengineerssolution
 
Minor Project Report on - short range personal 'RADAR'.
Minor Project Report on - short range personal 'RADAR'.Minor Project Report on - short range personal 'RADAR'.
Minor Project Report on - short range personal 'RADAR'.Sarvesh Kushwaha
 
Ijeee 33-36-surveillance system for coal mines based on wireless sensor network
Ijeee 33-36-surveillance system for coal mines based on wireless sensor networkIjeee 33-36-surveillance system for coal mines based on wireless sensor network
Ijeee 33-36-surveillance system for coal mines based on wireless sensor networkKumar Goud
 
Report 171115175724
Report 171115175724Report 171115175724
Report 171115175724PAVINRAJ5
 
Project report on home automation using Arduino
Project report on home automation using Arduino Project report on home automation using Arduino
Project report on home automation using Arduino AMIT SANPUI
 
Tracking police man using rf proximity card
Tracking police man using rf proximity cardTracking police man using rf proximity card
Tracking police man using rf proximity cardAlbert Jose
 
Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397Editor IJARCET
 
Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397Editor IJARCET
 
SMART HOME AUTOMATION USING MOBILE APPLICATION
SMART HOME AUTOMATION USING MOBILE APPLICATIONSMART HOME AUTOMATION USING MOBILE APPLICATION
SMART HOME AUTOMATION USING MOBILE APPLICATIONEklavya Sharma
 
Technical seminar project stalin babu m 116_f1a0471
Technical seminar project stalin babu m 116_f1a0471Technical seminar project stalin babu m 116_f1a0471
Technical seminar project stalin babu m 116_f1a0471STALIN BABU
 
Automatic Control of Instruments Using Efficient Speech Recognition Algorithm
Automatic Control of Instruments Using Efficient Speech Recognition AlgorithmAutomatic Control of Instruments Using Efficient Speech Recognition Algorithm
Automatic Control of Instruments Using Efficient Speech Recognition AlgorithmIJEEE
 
Design Efficient Wireless Monitoring Platform for Recycling Point Spots
Design Efficient Wireless Monitoring Platform for Recycling Point SpotsDesign Efficient Wireless Monitoring Platform for Recycling Point Spots
Design Efficient Wireless Monitoring Platform for Recycling Point SpotsIJMTST Journal
 
Paper id 36201529
Paper id 36201529Paper id 36201529
Paper id 36201529IJRAT
 
IRJET- Android based Home Automation System with Power Optimization Modes
IRJET-  	  Android based Home Automation System with Power Optimization ModesIRJET-  	  Android based Home Automation System with Power Optimization Modes
IRJET- Android based Home Automation System with Power Optimization ModesIRJET Journal
 
Home automatin
Home automatinHome automatin
Home automatinEngrNirob
 
Iot based garbage monitoring system
Iot based garbage monitoring systemIot based garbage monitoring system
Iot based garbage monitoring systemankitguptakishu
 
Home Automation Using Arduino Uno and HC-05
Home Automation Using Arduino Uno and HC-05Home Automation Using Arduino Uno and HC-05
Home Automation Using Arduino Uno and HC-05Vidhi Shah
 
Home Appliances Controlling using Android Mobile via Bluetooth
Home Appliances Controlling using Android Mobile via BluetoothHome Appliances Controlling using Android Mobile via Bluetooth
Home Appliances Controlling using Android Mobile via BluetoothMOKTARI MOSTOFA
 

Similar to ARM BASED 4bit coded locker (20)

Wireless appliances control report
Wireless appliances control reportWireless appliances control report
Wireless appliances control report
 
Minor Project Report on - short range personal 'RADAR'.
Minor Project Report on - short range personal 'RADAR'.Minor Project Report on - short range personal 'RADAR'.
Minor Project Report on - short range personal 'RADAR'.
 
Ijeee 33-36-surveillance system for coal mines based on wireless sensor network
Ijeee 33-36-surveillance system for coal mines based on wireless sensor networkIjeee 33-36-surveillance system for coal mines based on wireless sensor network
Ijeee 33-36-surveillance system for coal mines based on wireless sensor network
 
Report 171115175724
Report 171115175724Report 171115175724
Report 171115175724
 
Project report on home automation using Arduino
Project report on home automation using Arduino Project report on home automation using Arduino
Project report on home automation using Arduino
 
Tracking police man using rf proximity card
Tracking police man using rf proximity cardTracking police man using rf proximity card
Tracking police man using rf proximity card
 
Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397
 
Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397
 
SMART HOME AUTOMATION USING MOBILE APPLICATION
SMART HOME AUTOMATION USING MOBILE APPLICATIONSMART HOME AUTOMATION USING MOBILE APPLICATION
SMART HOME AUTOMATION USING MOBILE APPLICATION
 
Technical seminar project stalin babu m 116_f1a0471
Technical seminar project stalin babu m 116_f1a0471Technical seminar project stalin babu m 116_f1a0471
Technical seminar project stalin babu m 116_f1a0471
 
Automatic Control of Instruments Using Efficient Speech Recognition Algorithm
Automatic Control of Instruments Using Efficient Speech Recognition AlgorithmAutomatic Control of Instruments Using Efficient Speech Recognition Algorithm
Automatic Control of Instruments Using Efficient Speech Recognition Algorithm
 
Motion_ppt_final[1].pptx
Motion_ppt_final[1].pptxMotion_ppt_final[1].pptx
Motion_ppt_final[1].pptx
 
Design Efficient Wireless Monitoring Platform for Recycling Point Spots
Design Efficient Wireless Monitoring Platform for Recycling Point SpotsDesign Efficient Wireless Monitoring Platform for Recycling Point Spots
Design Efficient Wireless Monitoring Platform for Recycling Point Spots
 
Paper id 36201529
Paper id 36201529Paper id 36201529
Paper id 36201529
 
IRJET- Android based Home Automation System with Power Optimization Modes
IRJET-  	  Android based Home Automation System with Power Optimization ModesIRJET-  	  Android based Home Automation System with Power Optimization Modes
IRJET- Android based Home Automation System with Power Optimization Modes
 
ADAELS .docx
ADAELS .docxADAELS .docx
ADAELS .docx
 
Home automatin
Home automatinHome automatin
Home automatin
 
Iot based garbage monitoring system
Iot based garbage monitoring systemIot based garbage monitoring system
Iot based garbage monitoring system
 
Home Automation Using Arduino Uno and HC-05
Home Automation Using Arduino Uno and HC-05Home Automation Using Arduino Uno and HC-05
Home Automation Using Arduino Uno and HC-05
 
Home Appliances Controlling using Android Mobile via Bluetooth
Home Appliances Controlling using Android Mobile via BluetoothHome Appliances Controlling using Android Mobile via Bluetooth
Home Appliances Controlling using Android Mobile via Bluetooth
 

More from Shubham Kumar

Smart Refrigerator
Smart RefrigeratorSmart Refrigerator
Smart RefrigeratorShubham Kumar
 
Intel Quark HSUART
Intel Quark HSUARTIntel Quark HSUART
Intel Quark HSUARTShubham Kumar
 
Multifunctional usb firmware
Multifunctional usb firmwareMultifunctional usb firmware
Multifunctional usb firmwareShubham Kumar
 
Direct Memory Access (DMA)-Working and Implementation
Direct Memory Access (DMA)-Working and ImplementationDirect Memory Access (DMA)-Working and Implementation
Direct Memory Access (DMA)-Working and ImplementationShubham Kumar
 

More from Shubham Kumar (7)

Smart Refrigerator
Smart RefrigeratorSmart Refrigerator
Smart Refrigerator
 
Intel Quark HSUART
Intel Quark HSUARTIntel Quark HSUART
Intel Quark HSUART
 
Take_On_IOT
Take_On_IOTTake_On_IOT
Take_On_IOT
 
Multifunctional usb firmware
Multifunctional usb firmwareMultifunctional usb firmware
Multifunctional usb firmware
 
Direct Memory Access (DMA)-Working and Implementation
Direct Memory Access (DMA)-Working and ImplementationDirect Memory Access (DMA)-Working and Implementation
Direct Memory Access (DMA)-Working and Implementation
 
LUMOS
LUMOSLUMOS
LUMOS
 
Lumos
LumosLumos
Lumos
 

Recently uploaded

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

ARM BASED 4bit coded locker

  • 1. ARM BASED 4 – BIT CODED LOCKER WITH ELECTRIC SHIELD A project report submitted in partial fulfilment of the requirements for the award of the degree of BACHELOR OF TECHNOLOGY In ELECTRONICS & COMMUNICATION ENGINEERING By B.V.S.ALEKHYA 10521A04A1 SHUBHAM KUMAR 10521A0487 D.V.Y.V.SUBBA RAO 11525A0403 ROHIT SOURABH 10521A0484 V.BHANU CHAITANYA 10521A04A4 Under the guidance of Asst. Prof. Depatment of Electronics & Communication Engineering VITAM College of Engineering (Affiliated to JNTU, Kakinada, A.P) Visakhapatnam – 531173 2010 - 2014
  • 2. VISWANADHA INSTITUTE OF TECHNOLOGYAND MANAGEMENT (Affiliated to JNTU-Kakinada) MINDIVANIPALEM, VISAKHAPATNAM - 531173 BONAFIDE CERTIFICATE This is to certify that this project work entitled: “ARM BASED 4-BIT CODED LOCKER WITH ELECTRIC SHIELD” is the bonafide work of B.V.S.ALEKHYA (10521A04A1), SHUBHAM KUMAR(10521A0487), D.V.Y.V.SUBBA RAO (11525A0403), ROHIT SOURABH(10521A0484) and V.BHANU CHAITANYA (10521A04A4) of final year B.Tech. ECE which they have submitted in partial fulfilment of the requirements for the award of Bachelor of Technology in ELECTRONICS AND COMMUNICATION ENGINEERING during the academic period of 2013-2014. PROJECT GUIDE HEAD OF THE DEPARTMENT A.V.N.CHANDRA SEKHAR Assistant professor Associative professor B.E, M.Tech.,(Ph.D ) INTERNAL EXMINER EXTERNAL EXAMINER
  • 3. DECLARATION I declare that this project entitled “ARM BASED 4-BIT CODED LOCKER WITH ELECTRIC SHIELD” has been carried out by me and contents have been presented in the form of dissertation in partial fulfilment of the requirements for the award of the degree of Bachelor of Technology in ELECTRONICS AND COMMUNICATION ENGINEERING. Submitted By B.V.S. ALEKHYA (10521A04A1) SHUBHAM KUMAR (10521A0487) D.V.Y.V. SUBBA RAO (11525A0403) ROHIT SOURABH (10521A0484) V. BHANU CHAITANYA (10521A04A4)
  • 4. ACKNOWLEDGEMENT We express our deep sense of gratitude to Smt. K. RAJA RAJESWARI madam, B.E, M.E., Ph.D., Principal of VISWANADHA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, Visakhapatnam for permitting us to carry out this project work. It is a pleasure to thank Sri. A.V.N.Chandra Shekhar, HOD, Associative Professor, Viswanadha Institute of Technology and Management for permitting us to carry out this project work and for guiding us throughout this endeavour and also helping us to take crucial decisions at various stages. We express our sincere thanks to Sri ravi , Assistant professor, VITAM College, for his intelligent advices and his perpetual encouragement. We pay homage to our parents, for the financial support and also for the moral support they have given us throughout this project. Finally, we are thankful to all the teaching and non – teaching staff of Department of ECE for their constant co-operation throughout the project. B.V.S. ALEKHYA (10521A04A1) SHUBHAM KUMAR (10521A0487) D.V.Y.V. SUBBA RAO (11525A0403) ROHIT SOURABH (10521A0484) V. BHANU CHAITANYA (10521A04A4)
  • 7. CHAPTER-1 INTRODUCTION The aim of this project is to provide effective security measures for the users. Here the users can open their respective lockers by the specified user id and password. The main disadvantage of bulky, mechanical systems is their cost. This disadvantage of conventional lockers can be overcome by using electronic locker with electric shield. This locker is mainly designed for use in banks where the requirement of security for customer’s valuables is prominent. If the user wants to access their locker, they should enter the valid 4 digit alphanumeric code. If the entered code matches the actual code, the lock opens resulting in the slow opening of the drawer. If the entered password is wrong, buzzer buzzes alerting the user for retyping the password.If the user is not able to type the correct password in their 3rd attempt,then an Audio Signal will be generated which can be obtained on a speaker.This audio signal will last for around 15 seconds , thus alerting the security personnel at a distance.The Locker will remain inactive for 30 more seconds after the Audio Signal stops, thus adding a high level of security in the whole system. After this period, the user can again try to enter their password, and the whole process repeats.If the burglar goes a step forward in breaking the locker then he will be subjected to shock. The basic units for this locker are: 1. Controlling unit 2. Locking unit Controlling unit: The controlling unit of the locker system plays the most important role in the operation of the locker system. It is heart and brain of the system. The control unit consists of ARM processor, crystal oscillator circuit, LCD display, PS2 connector and Audio Output Jack. All these components are available on a single board, “Blue Board-LPC2148”. Blue board: BlueBoard-LPC214X is an evaluation board for LPC2148 ARM7TMDI(-S) based microcontroller. The LPC2148 microcontroller has 512KB of internal flash and 32+8K RAM. Following are the salient features of the board:
  • 8. Power: On-board linear regulators generate +3.3V/500mA and +5v/500mA from power supply. USB connector ( as alternate power source). Connectors: Extension headers for all microcontroller pins. RS232 (2 ports),VGA ,PS/2,Audio Jack,JTAG, SD/MMC,USB B-type with Link-LED, All peripheral configurable via jumpers. Other Peripherals: Audio power amplifier. 2 line X 16 character LCD with back light control(using 10K POT). Configurable for manual and automatic program download(ISP) via serial port. 8 controllable LEDs on SPI using 74HC595,Buzzer,10K POT connected to ADC line 1 user input button connected to interrupt line. The LPC2141/2/4/6/8 microcontrollers are based on a 32/16 bit ARM7TDMI-S CPU with real-time emulation and embedded trace support, that combines the microcontroller with embedded high speed flash memory ranging from 32 kB to 512 kB. A 128-bit wide memory interface and a unique accelerator architecture enable 32-bit code execution at the maximum clock rate. For critical code size applications, the alternative 16-bit Thumb mode reduces code by more than 30 % with minimal performance penalty.
  • 10. Microcontroller NXP LPC 2148 Pin diagram: The complete IC Layout with other peripherals involved in the project:
  • 11.
  • 12.
  • 13. ARM7TDMI(-S) Registers Involved in the Project: DACR -(Digital-Analog Conversion) IODIR -(Data Direction Register for various Pins) IOSET -(Register to set Pin HIGH) IOCLR -(Register to set Pin LOW) IOPIN -(Register to check the status of the Pin) PINSEL -(To define the function of a Pin for a relevant task)
  • 14. EXTMODE -(The External Interrupt Mode Register controls whether each pin is edge- or level sensitive) EXTPOLAR -(The External Interrupt Polarity Register controls which level or edge on each pin will cause an Interrupt) EXTINT -(The External Interrupt Flag Register contains interrupt flags for EINT0, EINT1, EINT2 and EINT3) VICIntSelect -(Interrupt Select Register. This register classifies each of the 32 interrupt requests as contributing to FIQ or IRQ) VICVectAddr -(Vector Address Register. When an IRQ interrupt occurs, the IRQ service routine can read this register and jump to the value read) VICVectCntl -(vectorControl Registers 0-15 each control one of the 16 vectoredIRQ slots. Slot 0 has the highest priority and slot 15 the lowest) Pins Involved: There are 48 GPIO (General Purpose Input Output) Pins available in this microcontroller. There are 2 ports in ARM7TDMI(-S) core viz., Port 0 and Port 1. There are 32 GPIO pins in Port 0 from P0.0 to P0.31 and 16 pins in Port 1 from P1.16 to P1.31. These pins can be used for various input and output functions like Keyboard interfacing, LCD interfacing, Buzzer Connectivity, LED Connectivity, driving Relay, etc. Due to the availability of large number of pins, various Lockers can be connected to a single Blueboard NXP LPC 2148 microcontroller module like this.
  • 15. Locking unit: Locking unit of the locker controls the closing and opening of the drawer. The locking unit consists of a geared motor, relay circuit, and shock circuit (whose terminals are further connected to an LED circuit which indicates the safety of usage for the locker). The geared motor is used in locking system to push the drawer open at the mention of valid password and it also pulls the drawer inward to lock state also after the mention of correct password. The geared motor gets the supply from the supply circuit connected against it. The relay circuit is used as a switch between shock mode and open/close mode of locker. The relay circuit is driven from one of the GPIO pins of the microcontroller. The relay used in this case also has SPDT switch which ensures the opening and closing of drawer. The shock circuit is also connected to relay and it is placed inside the walls of the drawer and it is insulated. The shock circuit’s main purpose is to subject anyone,who tries to break into the locker without giving the valid password, to shock. The shock circuit typically can subject a man to a shock of 230volts. However, due to the potential damage it causes, we have used only 12 volts shock. Operation Of the Microcontroller Module: Peripherals Needed: •An External QWERTY Keyboard attached to the PS2 port of the microcontroller •A 2X 16 character LCD pre-attached with the BlueBoard •A speaker connected to the Audio Jack of the BlueBoard
  • 16. Operation: There is a pre-stored 4-bit alphanumeric password in the ROM of the microcontroller. This password is used to open/close the Lock in this project. When the user enters a password using the Keyboard attached to the Blueboard, then the logic built in the Embedded C program checks it with the pre-stored password. If both the passwords match, then the LCD displays the “ Correct Password” message and after 2 seconds instructs the user to toggle up/down the Red Switch connected to the relay by displaying a message “Toggle Red Switch”. The Up toggling ensures the Locker comes out and the Down toggling ensures that it goes in. After toggling the Red Switch ,the Pin 0.8 gives a HIGH voltage of 3.3 V for the next 50 seconds. The Locker requires this much amount of time for opening/closing. After 50 seconds, the LCD displays the message as “Operation Over”.The user needs to do the same set of actions for the reverse operation also. If the password entered by the user is wrong, then the LCD will display the message as “Password Wrong, Try Again” by alarming with a buzzer attached to the Blueboard and gives the user 2 more chances of entering the correct password. If the user still fails to type the correct password in their 3rd attempt,then the LCD displays the message as “Security Alarm” and the microcontroller will send a Security alarm signal by generating an audio signal for 15 seconds which will be played on the speaker. This audio signal will be of very high volume and can be heard from a very long distance, thus enabling the Security Personnel to take some actions and check the Locker for security measures. After the security alarm, the LCD displays the message as “Maximum Attempts Made, Try after 30 seconds” and the Buzzer sounds repeatedly for the next 30 seconds and the Microcontroller deactivates the Keyboard Peripheral for this much amount of time. After 30 seconds the Keyboard console gets reactivated, the user can try to enter the Password again, and the whole process goes on like this. Visual Outputs:
  • 17. 1.Keyboard attached with the BlueBoard-LPC2148
  • 18. 2. The Normal display on the LCD when no password has been entered
  • 19. 3. When the user enters the correct password, the LCD diplays the following message
  • 20. After 2 seconds, the message on the LCD appears as
  • 21. After 3 seconds, the Locker starts opening and the LCD displays the following message
  • 22. 4. If the user enters wrong password in their 3rd attempt, then LCD displays the following message
  • 23. Then a security alert message on the LCD appears with audio signal on the speaker
  • 25. RELAY CIRCUIT: A relay is an electrically operated switch. Current flowing through the coil of the relay creates a magnetic field which attracts a lever and changes the switch contacts. The coil current can be on or off so relays have two switch positions and they are double throw (changeover) switches. There are 5 Pins in a relay. Two pins A and B are two ends of a coil that are kept inside the relay. The coil is wound on a small rod that gets magnetized whenever current passes through it. COM/POLE is always connected to NC(Normally connected) pin. As current is passed through the coil A, B, the pole gets connected to NO(Normally Open) pin of the relay. Electronic lock:
  • 26. The electronic lock is made by using a geared motor.We have used the actuator technology for improvising the locking system and designed a special structure. As per the correct password, the locking system will work. If the correct password is entered the drawer will get automatically opened. In case of wrong password, it will give 2 more chances.If the user is not able to type the correct password in the next 2 chances,then an alarming audio signal will be generated which lasts for 15 seconds and the system will be deactivated for the next 30 seconds after the completion of the Alarm Audio signal . After this time is elapsed, the whole process begins again.
  • 27. Geared motor: Geared motors are complete motive force systems consisting of an electric motor and a reduction gear train integrated into one easy-to-mount and –configure package. This greatly reduces the complexity and cost of designing and constructing power tools, machines and appliances calling for high torque at relatively low shaft speed or RPM. The gear assembly helps in increasing the torque and reducing the speed. Using the correct combination of gears in a gear motor, its speed
  • 28. can be reduced to any desirable figure. This concept where gears reduce the speed of the vehicle but increase its torque is known as gear reduction. Operation principle: Most synchronous AC electric motors have output ranges of from 1,200 to 3,600 revolutions per minute. They also have both normal speed and stall-speed torque specifications. The reduction gear trains used in gear motors are designed to reduce the output speed while increasing the torque. The increase in torque is inversely proportional to the reduction in speed. Reduction gearing allows small electric motors to move large driven loads, although more slowly than larger electric motors. Reduction gears consist of a small gear driving a larger gear. There may be several sets of these reduction gear sets in a reduction gear box. Applications of gear motors: Garage door openers, stair lifts, timer cycle knobs on washing machines, power drills, electromechanical clocks. These all use various integrations of gear motors to drive a large force from a relatively small electric motor at a manageable speed. In industry, gear motor applications in jacks, cranes, lifts, clamping, robotics, conveyance and mixing are too numerous to count. Dpdt switch: we used this dpdt switch for opening and closing of the locker, if we want the drawer to come out it should be toggled to upwards for going inside it should be toggled downwards. The
  • 29. internal connections will be shown as given below: The model view of dpdt toggle switch Electric shield: The most exciting feature that which we are adding in this locking system is electric shield which protects the valuables in the locker, the electric field will be passed in the conductor which is placed inside the walls of the drawer, this will be on all the time but during the correct password is given the shock will goes off and drawer gets opened automatically, the danger light indication will be shown by using LED light indication circuit which is in red color.
  • 30. Power supply: The total system works under 12v dc supply so we have attained the subsequent voltage by using following circuit Circuit: Components required: Quantity ď‚· Transformer(230 to12)v step down 1 ď‚· Bridge rectifier 1A 1 ď‚· IC1 7812 1 ď‚· IC2 7805 1 ď‚· Resistor 4.7k 1 ď‚· Capacitor0.1uf 3 ď‚· Electrolyte capacitor2200uf 1 ď‚· Electrolyte capacitor10uf 1 ď‚· LED 1
  • 31. ď‚· Buzzer 1 ď‚· Speaker 1 Softwares Required: 1. Keil uVision 4.6 IDE (For writing and compiling the program in Embedded C) 2. Flash Magic (For flashing the microcontroller with Bootloader) Programs in Embedded C: (main.c) #include "lcd.h" #include "ps2kbd.h" #include <lpc21xx.h> int main (void) { init_lcd(); init_keyboard(); while (1) { if(keyhit()) { init3_lcd(); init_keyboard(); } } }
  • 32. (LCD_DAC.C) // This program is for LCD display and Digital-Analog Conversion for Audio Output #include <LPC214x.H> /* LPC214x definitions */ #include "lcd.h" #include "utils.h" #define LCD_BACK_LIGHT_TIMEOUT 1000 #define LCD_BACKLIGHT (1 << 21) #define LCD_BACK_LIGHT_DIR IO1DIR #define LCD_BACK_LIGHT_SET IO1SET #define LCD_BACK_LIGHT_CLR IO1CLR #define LCD_DATA_DIR IO0DIR #define LCD_DATA_SET IO0SET #define LCD_DATA_CLR IO0CLR #define LCD_CTRL_DIR IO1DIR #define LCD_CTRL_SET IO1SET #define LCD_CTRL_CLR IO1CLR #define LCDRS (1 << 24) #define LCDRW (1 << 23) #define LCDEN (1 << 22) #define LCD_D4 (1 << 10) #define LCD_D5 (1 << 11) #define LCD_D6 (1 << 12) #define LCD_D7 (1 << 13) #define LCD_DATA_MASK (LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7) #define LCD_BUSY_FLAG LCD_D7 #define LCD_CONTROL_MASK 0x01C00000
  • 33. extern int flag=0; extern int i=0; void lcd_putstring( unsigned char line,unsigned char string[10] ); void lcd_putchar(unsigned char c[10]); #define DAC_BIAS 0x00000000 void DAC_test(void) { int i=0,j=0; int k=0; for(k=0;k<80000;k++) { DACR = (i << 8) | DAC_BIAS; i++; for(j = 5000; j > 1; j--); if ( i == 1024 ) { i = 0; } } } void DACInit( void ) { /* setup the related pin to DAC output */ PINSEL1 |= 0x00080000; /* set p0.225 to DAC output */ return; } /**
  • 34. ************************************************************************************** ****** Function Name : wait_lcd() Output : Void Note : ************************************************************************************** ****** */ void wait_lcd( void ) { IO1CLR |= (1 << 24); //LCDRS IO1SET |= (1 << 23) |(1 << 22); //LCDRW |LCDEN while(IO1PIN & LCD_BUSY_FLAG); /* wait for busy flag to become low */ IO1CLR |= (1 << 22) |(1 << 23); // LCDEN | LCDRW; IO0DIR |= LCD_DATA_MASK; delay(100); } /** ************************************************************************************** ****** Function Name : lcd_command_write() Output : Void Note : ************************************************************************************** ****** */
  • 35. void lcd_command_write( unsigned char command ) { unsigned char temp=0; unsigned int temp1=0; temp=command; temp=(temp>>4)&0x0F; temp1=(temp<<10)&LCD_DATA_MASK; IO1CLR = (1 << 24); //LCDRS IO1SET = (1 << 22); //LCDEN IO0CLR = LCD_DATA_MASK; //(LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7) IO0SET = temp1; delay(10000); IO1CLR = (1 << 22); //LCDEN temp=command; temp&=0x0F; temp1=(temp<<10)&LCD_DATA_MASK; // (LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7) delay(100*2); IO1CLR |=(1<<24); // LCDRS IO1SET |=(1<<22); // LCDEN IO0CLR = LCD_DATA_MASK; //(LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7) IO0SET = temp1; delay(10000); IO1CLR |= (1<<22); //LCDEN wait_lcd();
  • 36. } /** ************************************************************************************** ****** Function Name : set_lcd_port_output() Output : Void Note : ************************************************************************************** ****** */ void set_lcd_port_output( void ) { IO1DIR |= ((1<<22)|(1<<24)|(1<<23)); IO1CLR |= ((1<<22)|(1<<24)|(1<<23)); IO0DIR |= LCD_DATA_MASK; } /* * ************************************************************************************** ****** Function Name : lcd_clear() Output : Void ************************************************************************************** ****** */ void lcd_clear( void) { lcd_command_write( 0x01 ); } /**
  • 37. ************************************************************************************** ****** Function Name : lcd_gotoxy() Output : Void Note : ************************************************************************************** ****** */ int lcd_gotoxy( unsigned int x, unsigned int y) { int retval = 0; if( (x > 1) && (y > 15) ) { retval = -1; } else { if( x == 0 ) { lcd_command_write( 0x80 + y ); /* command - position cursor at 0x00 (0x80 + 0x00 ) */ } else if( x==1 ){ lcd_command_write( 0xC0 + y ); /* command - position cursor at 0x40 (0x80 + 0x00 ) */ } } return retval; } /**
  • 38. ************************************************************************************** ****** Function Name : lcd_data_write() Output : Void Note : ************************************************************************************** ****** */ void lcd_data_write(unsigned char data) { char temp=0; int temp1=0; temp=data; temp=(temp>>4)&0x0F; temp1=(temp<<10)&LCD_DATA_MASK; IO1SET |= (1<<22)|(1<<24); //LCDEN|LCDRS IO0CLR = LCD_DATA_MASK; IO0SET = temp1; IO1CLR |= (1<<22); //LCDEN temp=data; temp&=0x0F; temp1=(temp<<10)&LCD_DATA_MASK; IO1SET |= (1<<22)|(1<<24); IO0CLR = LCD_DATA_MASK; IO0SET = temp1;
  • 39. IO1CLR |= (1<<22); //LCDEN wait_lcd(); } /** ************************************************************************************** ****** Function Name : lcd_putchar() Output : Void Note : ************************************************************************************** ****** */ void lcd_putchar(unsigned char * c) { int i=0; lcd_data_write(c[i]); } /** ************************************************************************************** ****** Function Name : lcd_putstring() Output : Void Note : ************************************************************************************** ******
  • 40. */ void lcd_putstring( unsigned char line,unsigned char *string ) { unsigned char len = 16; //MAX_CHAR_IN_ONE_LINE lcd_gotoxy( line, 0 ); while(*string!= '0' && len--) { lcd_putchar((unsigned char*)string); string++; } } /** ************************************************************************************** ****** Function Name : lcd_backlight_on() Output : Void ************************************************************************************** ****** */ void lcd_backlight_on() { IO1DIR |= (1 << 21); //LCD_BACKLIGHT IO1SET |= (1 << 21); //LCD_BACKLIGHT } /**
  • 41. ************************************************************************************** ****** Function Name : turn_off_lcd_back_light() Output : Void ************************************************************************************** ****** */ void turn_off_lcd_back_light_cb(void) { IO1DIR |= (1 << 21); //LCD_BACKLIGHT IO1CLR |= (1 << 21); //LCD_BACKLIGHT } /** ************************************************************************************** ****** Function Name : init_lcd() Output : Void Note : ************************************************************************************** ****** */ void init_lcd( void ) { set_lcd_port_output(); delay(100*100); lcd_command_write(0x28); /* 4-bit interface, two line, 5X7 dots. */ lcd_clear() ; /* LCD clear */
  • 42. lcd_command_write(0x02); /* cursor home */ lcd_command_write(0x06); /* cursor move direction */ lcd_command_write(0x0C) ; /* display on */ lcd_gotoxy(0, 0); lcd_clear(); lcd_putstring(0,"Enter Password"); } void init2_lcd( void ) { IO0DIR|=(1<<31); IO0DIR|=(1<<8); set_lcd_port_output(); delay(100*100); lcd_command_write(0x28); /* 4-bit interface, two line, 5X7 dots. */ lcd_clear() ; /* LCD clear */ lcd_command_write(0x02); /* cursor home */ lcd_command_write(0x06); /* cursor move direction */ lcd_command_write(0x0C) ; /* display on */ lcd_gotoxy(0, 0); lcd_clear(); lcd_putstring(0,"Correct Password"); delayy(450); lcd_gotoxy(0, 0); lcd_clear(); lcd_putstring(0," Toggle "); lcd_putstring(1," Red Switch "); delayy(300); lcd_gotoxy(0, 0);
  • 43. lcd_clear(); lcd_putstring(0,"Please Wait..."); IO0CLR|=(1<<31); IO0SET|=(1<<8); delayy(7500); IO0SET|=(1<<31); IO0CLR|=(1<<8); } void init4_lcd( void ) { lcd_gotoxy(0, 0); lcd_clear(); lcd_putstring(0," Operation Over "); delayy(200); init_lcd(); init_keyboard(); } void init5_lcd( void ) { lcd_gotoxy(0, 0); lcd_clear(); lcd_putstring(0,"please wait..."); } void init6_lcd( void ) { lcd_gotoxy(0, 0); lcd_clear(); lcd_putstring(0," Operation Over");
  • 44. lcd_putstring(1," Press Reset"); } void init3_lcd( void ) { DACInit(); IO1DIR|=(1<<25); flag+=1; if(flag==3) { lcd_gotoxy(0, 0); lcd_clear(); lcd_putstring(0,"maximum attempts "); lcd_putstring(1," made "); delayy(300); lcd_gotoxy(0, 0); lcd_clear(); lcd_putstring(0,"Security Alert"); DAC_test(); delayy(300); lcd_gotoxy(0, 0); lcd_clear(); lcd_putstring(0," try after 30 "); lcd_putstring(1," seconds "); while(i!=30) { IO1CLR|=(1<<25); delayy(100);
  • 45. IO1SET|=(1<<25); delayy(70); i++; } i=0; flag=0; goto a; } lcd_gotoxy(0, 0); lcd_clear(); lcd_putstring(0," Wrong Password "); lcd_putstring(1," Try again "); IO1CLR|=(1<<25); delayy(100); IO1SET|=(1<<25); a:init_lcd(); init_keyboard(); while (1) { if(keyhit()) { init3_lcd(); init_keyboard(); } } }
  • 46. (Keyboard.c) //This Program is for connecting the PS2 Keyboard and contains logic for the operation of work to be done when the password is right/wrong #include "ps2kbd.h" #include "lpc_vic.h" #include "scancodes.h" #include <LPC214x.H> /* LPC214x definitions */ #include "utils.h" /** ***************************************************************************** Function Name : extISR1() ****************************************************************************** */ void extISR0(void) __irq; U8 keyBuf[KBUFFSIZE]; //KBUFFSIZE=4.....PS2 Keyboard buffer, the register to store characters key in U8 keyIn; //Index into PS/2 key buf where next scan code will be inserted U8 keyOut; //Index into PS/2 key buf where next scan code will be removed U8 keyRead; //Number of keys read from the PS/2 keyboard U8 bitcount; // 0 = neg. 1 = pos. unsigned char key[11]; /** ***************************************************************************** Function Name : init_keyboard()
  • 47. ****************************************************************************** */ U8 init_keyboard(void) { IO0CLR = KB_CLK; //KB_CLK=BIT16=0x00010000..P0.4=1.....hold keyboard clock line untill ready EXTMODE |= 0x01; /* EINT0_EDGE..... INT0 edge trigger */ EXTPOLAR |= 0x0; /* INT0 is falling edge by default */ PINSEL1 |= 0x00000001; //KBD_PINSEL=1.16=PS2 data /* initialize the interrupt vector */ VICIntSelect &= ~ (1<<14); //VIC_BIT(VIC_EINT0)..... pg.56 datasheet..EINT0 selected as IRQ VICVectAddr2 = (unsigned int)extISR0; // address of the ISR VICVectCntl2 = (1<<5|14); //VIC_ENABLE | VIC_EINT0..pg.57 datasheet VICIntEnable = (1<<14); //VIC_BIT(VIC_EINT0)..... EINT0 interrupt enabled bitcount = 0; keyIn =0; keyOut=0; keyRead=0; EXTINT = EINT0; /* clear interrupt */ return(1); //1=TRUE }
  • 48. /** ***************************************************************************** Function Name : decode() ****************************************************************************** */ void decode(U8 sc) { static unsigned char is_up=0, shift = 0; //, mode = 0; unsigned char i; if (!is_up) /* Last data received was the up-key identifier */ { switch (sc) { case BREAKCHAR : /* The up-key identifier */ is_up = 1; break; case NONUMCODE : break; case LEFTSHIFT : shift = 1; break; case RIGHTSHIFT: shift = 1; break; default: if (!shift) /* If shift not pressed */
  • 49. { // do a table look-up for (i = 0; unshifted[i][0]!=sc && unshifted[i][0]; i++); if (unshifted[i][0] == sc) { putkeybuf((unshifted[i][1])); } } else { /* look-up */ for (i = 0; shifted[i][0]!=sc && shifted[i][0]; i++); if (shifted[i][0] == sc) { putkeybuf((shifted[i][1])); } } break; } } else { is_up = 0; switch (sc) { case LEFTSHIFT : case RIGHTSHIFT: shift = 0;
  • 50. break; } } } /** ***************************************************************************** Function Name : putkeybuf() ****************************************************************************** */ void putkeybuf (U8 key) { if (keyRead <8) //KBUFFSIZE=4..make sure that we don't overflow the buffer { keyRead++; //Increment the number of keys read keyBuf[keyIn++] = key; //Store the scan code into the buffer if (keyIn >=8) //KBUFFSIZE..Adjust index to the next scan code to put in buffer { keyIn = 0; } } if(keyBuf[0]=='a' && keyBuf[1]=='b' && keyBuf[2]=='1' && keyBuf[3]=='2') { init2_lcd(); init4_lcd(); } }
  • 51. /* ***************************************************************************** Function Name : keyhit() ****************************************************************************** */ U8 keyhit(void) { unsigned char hit; hit = (unsigned char)(keyRead >4)? 1 : 0; return(hit); } /** ***************************************************************************** Function Name : xgetkey() ****************************************************************************** */ char xgetkey(void) { unsigned char key=0; if (keyRead > 0) { keyRead--; /* Decrement the number of keys in the buffer */ key = keyBuf[keyOut]; /* Get scan code from the buffer */ keyOut++;
  • 52. if (keyOut >= 4) //KBUFFSIZE { keyOut = 0; } } return (key); /* return the scan code of the key pressed */ } (utils.c) //This program contains all the important functions required for the keyboard connectivity along with different delay functions used in other programs. /* USB Firmware Upgrader Copyright © 2006 Yuri Tiomkin All rights reserved. Permission to use, copy, modify, and distribute this software in source and binary forms and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. THIS SOFTWARE IS PROVIDED BY THE YURI TIOMKIN AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL YURI TIOMKIN OR CONTRIBUTORS BE LIABLE
  • 53. FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <LPC214x.H> /* LPC214x definitions */ #include "type.h" #include "string.h" typedef void (*IAP)(unsigned int [],unsigned int[]); //---------------------------------------------------------------------------- void * s_memset(void * dst, int ch, int length) { register char *ptr = (char *)dst - 1; while(length--) *++ptr = ch; return dst; } //---------------------------------------------------------------------------- void * s_memcpy(void * s1, const void *s2, int n)
  • 54. { register int mask = (int)s1 | (int)s2 | n; if(n == 0) return s1; if(mask & 0x1) { register const char *src = s2; register char *dst = s1; do { *dst++ = *src++; }while(--n); return s1; } if(mask & 0x2) { register const short *src = s2; register short *dst = s1; do { *dst++ = *src++; }while( n -= 2);
  • 55. return s1; } else { register const int *src = s2; register int *dst = s1; do { *dst++ = *src++; }while (n -= 4); return s1; } } U8 s_strncmp(U8 *s1,U8 *s2, U32 num) { U8 retval=0; U32 i=0; for(i=0;i<num;i++) { if(*(s1+i) != *(s2+i)) { retval = 1;
  • 56. break; } } return retval; } int divide(int a, int b) { int result = 0; int temp = b; while (temp >= b) { temp = a - b * result++; } return result-1; } void reverse(char s[]) { int c, i, j; for (i = 0, j = strlen(s)-1; i<j; i++, j--) { c = s[i];
  • 57. s[i] = s[j]; s[j] = c; } } void u_itoa( int n, char s[] ) { int i, sign; if(( sign = n ) < 0 ) n = -n; i = 0; do { s[i++] = n % 10 + '0'; } while(( n /= 10 ) > 0 ); if( sign < 0 ) s[i++] = '-'; s[i] = '0'; reverse( s ); } /** ************************************************************************** ****1111
  • 58. Function Name : delay() Description :This function suspends the tasks for specified ticks. Input : ticks:no of ticks in multiple of 1 usec task: task to be suspended Output : void ******************************************************************************* */ void delay(int count) { int j=0,i=0; for(j=0;j<count;j++) { /* At 60Mhz, the below loop introduces delay of 10 us */ for(i=0;i<35;i++); } } void delayy(unsigned int t) { int i,j; for(j=0;j<t;j++) for(i=0;i<50000;i++); }
  • 59. (extISR.C) //This program contains the instruction sets for the hardware interrupts required when a keyhit is made from the keyboard. #include <LPC214x.H> /* LPC214x definitions */ #include "ps2kbd.h" #include "utils.h" #define kbDAT (IO1PIN & (KB_DAT)) #define kbCLK (IO0PIN & (KB_CLK)) #define K_STARTBIT 1 #define K_PARITYBIT 10 #define K_STOPBIT 11 extern unsigned char bitcount; /** ***************************************************************************** Function Name : extISR0() ****************************************************************************** */ void extISR0(void) __irq { static U8 key_data; // Holds the received scan code U32 clkstat;
  • 60. U32 datstat; U32 paritystat; clkstat = IO0PIN & (IO0PIN & 0x00010000); //kbCLK=(IO0PIN & BIT16=0x00010000)=>P0.4=1.....check CLK pin state; datstat = kbDAT; //kbDAT=(IO1PIN & (KB_DAT))...P1.16=>PS2 data..check DAT pin state; bitcount++; if (bitcount==1) //K_STARTBIT { if (datstat || clkstat) bitcount=0; key_data=0; paritystat=0; } else if (bitcount==10) //K_PARITYBIT { paritystat = datstat; } else if (bitcount==11) //K_STOPBIT { decode (key_data); bitcount=0; } else { // For all bits from 2, 3...9 (total 8-bit) key_data= key_data >> 1;
  • 61. if (datstat) { key_data = key_data | 0x80; } } EXTINT = 0x01; //clear interrupt VICVectAddr = 0; }//extISR Steps to be performed for typing the complete program in Keil uVision 4.6 IDE: 1. Go to Project-> New uVision Project. 2. Save the project in some folder with the extension *.uVproj 3. Then Select the Microcontroller being used. In our Project, we have selected NXP LPC 2148. 4. Add all the files to the Project after writing programs in separate files. 5. Now go to Flash->Configure Flash Tools,then go to the Target tab and select the on-chip I-ROM 1 area address from 0x2000. It has been done so because the flashed Bootloader program occupies the area upto 0x2000 address. 6. Under the User tab tick the check box Run #1 and type in the box the following: fromelf --bin .ObjPS2KBD_LCD.axf -o .Obja.bin This is done in order to create a .Bin Object file from .C file. AXF refers to Arm Executable Format. It changes the format from .axf to .bin which can then be saved into the ROM of the microcontroller using the Bootloader functionality where the microcontroller can just behave like a
  • 62. removable mass storage device and we can copy and paste the generated .bin file into the mass storage device. 7. Now click on Project->Rebuild All Target Files. The Program will get compiled and .bin file will be created inside the Obj folder as mentioned above. .Bin file will be created only when there are no errors in the program. Advantages involved in the project: • Highly Secure due to the presence of multilevel security • The development board requires just 3.3 V of power supply and hence power consumption and dissipation are very low. • Security alarm with the help of DAC is possible,thus alerting the security personnel if any unauthorized repeated access is made more than thrice. • Inability for any unauthorized user to access the locker due to the presence of all-time electric shock. • One-minute blocking of the whole system if any unauthorized access is made more than thrice. • Made on a low budget of Rs. 4200 which is quite low as compared to the similar type of system available in the market ranging from Rs. 15,000- Rs. 20,000.