You are on page 1of 12

DESIGN AND CONSTRUCTION OF BURGLAR ALARM SYSTEM

ABSTRACT
Applications of digital electronics were widely used in almost all areas of life: computers,
automated machine control, robots, energy monitoring and control, inventory management,
medical science and technology, transportation, entertainment and space exploration. The burglar
alarm system would be designed to cover and monitor the whole perimeter of a building to ensure
that any movement made within the protected area would be sensed and a burglar alarm would be
activated. The burglar alarm system was built around a microcontroller programmed to accept a
known security code with which the security system is either enabled or disabled. The
microcontroller accepts the entered code and digital compares it with the registered code. The
motion detection stages are implemented through the use of infra red transceivers. The infra red
transmitter emits infra red rays which are detected by the photo diode placed within the line of
sight of the transmitters. When motion is detected by any of the four transceivers employed to
monitor the perimeter of the building, an alarm comes on to alert of a possible presence of an
intruder.
Keywords: Burglar Alarm System, Microcontroller, Motion Detection, Infrared Transmitter

1. Introduction
Digital electronics applications were for many years confined to computer systems. In todays
world, the term digital has become part of our everyday vocabulary because of the dramatic
way that digital circuits and digital techniques have become so widely used in almost all areas of
life: computers, automated machine control, robots, energy monitoring and control, inventory
management, medical science and technology, transportation, entertainment and space
exploration. In modern homes, digital circuitry controls the appliances, alarm system and heating/
cooling systems. In corporate organization, digital circuitry is employed is almost every activity
including employees resumption timing, cash counting, processing payrolls, and communication.
This project involves the design and construction of a burglar alarm system. The burglar alarm
system would be designed to cover and monitor the whole perimeter of a building to ensure that
any movement made within the protected area would be sensed and a burglar alarm would be
activated. The burglar alarm system would also feature a keypad user interface with which the
owner of the protected building can enter a pass code to either enable or disable the security
system. The pass code would be a six digit code which can always be changed by the user. On
entering the correct six (6) digit code on a keypad into the system, the burglar alarm system
comes alive. The system incorporates an anti-fiddle protection that ensures that only four
trials of code entry are allowed. When the code has been incorrectly entered four times in a
row, system would switch to alarm mode. In this state, all keys pressed are ignored for one
minute and at the same time the buzzer will sound the alarm signal. This function thwarts any
attempt by
hackers, to quickly try large numbers of codes in sequence.
In designing this project, a microcontroller would be programmed to activate an output that
enables or disables the security system when the correct access code has been entered on a
keypad. A buzzer would be added to provide input feedback, the number of beeps indicates
whether the input has been correctly entered or not. The burglar alarm system would employ
four infra red transceiver units to cover the whole perimeter of the building and when motion
is sensed, a burglar alarm is enabled to alert the security agents around of the presence of a
possible burglar.
I am majorly interested in this project solely because of the increasing crime rate in this
country and a way of stopping the situation. Furthermore, there was a need to protect home so
that users can take advantage of technological advancement even when the person concerned
is not around.

Development of a Simple Sound Activated


Burglar Alarm System

According to Ahmed M. S, Mohammed A. S. & Agbo G. A. (2008) explained how the amplifier
stage was built around an LM386 CMOS operational amplifier. The circuit arrangement is such
that it can amplify an input signal up to 200 times its original value.
Once a sound that exceeds certain intensity is produced, it is picked by the microphone, amplified
and sent to the latch, the latch keeps the alarm still ringing until the reset button is pressed.

Figure 1: Block diagram of sound activated burglar alarm


After testing the alarm system the following results were obtained for distances and sound
intensities for which the alarm was triggered. When the microphone was also tapped the alarm
was triggered.
3. System Overview
The main role of a microcontroller unit in an embedded system is to provide inexpensive,
programmable logic control and interfacing to eternal devices.
According to Julio Sanchez and Maria P. Canton, in their book microcontroller programming
(2007), explained microcontroller is a computer control system on a single chip. It has many
electronic circuits built into it, which can decode written instruction instructions and convert them
into electrical signals. The microcontroller will then step through the instructions and execute
them one by one.
Programs written into the microcontroller are stored in the EPROM (Electrically Programmable
Read Only Memory). This memory is non volatile and is remember when the power is switched
off. The memory is electrically programmed by a piece of hardware called a programmer.
The instructions written into the microcontroller work by moving and manipulating data in
memory locations known as user files and registers. This memory is called RAM, Random Access
Memory. The overall stages involves in the design of burglar alarm system can be divided into
subunits include the power supply, infrared sensors, digital logic control, timing circuitry and
alarm. Figure 2 shows the block diagram of the overall system. For implementation of burglar
alarm system there were some materials that was used, this includes: Programmable IC, AT89S52
this served as brain, the remain materials are photodiode, LED, Resistor, Capacitor, IC Socket,
5volt Regulator (7805), Vero-board, List of tools used are: soldering iron, cutter, nose pliers,

multimeter, IC programmer.

DIGITAL
TIMING
Power
INFRARED

ALARM

LOGIC

Supply

CIRCUITRY
SENSORS

CONTROL
STAGE
STAGE

MICROCON TROLLER
STAGE

CODE
ENTRY
STAGE (KEYPAD)
Figure 2: Generalized block diagram for the burglar alarm

STAGE

Figure 3: Circuit diagram for the burglar alarm


system

4. Hardware Design Consideration


Power Supply Unit
The whole design is powered with a 5V dc supply. Herein, a regulated dc voltage is obtained from
the mains 220VAC. A step down transformer is used to step down the 220VAC to 18VAC. The
18VAC is rectified to obtain a dc voltage require to power the digital circuitry. Since the
microcontroller requires a 5-volt supply, a voltage regulator (78L05) is used to regulate the
rectified, filtered 18VDC to 5VDC desired. Figure 8 shows the power supply stage for this design.
Microcontroller Unit
The microcontroller stage is implemented by using the popular and versatile PIC16F84A.
PIC16F84 belongs to a class of 8-bit microcontrollers of RISC architecture. It is an 18 pin dual inline package chip. The PIC is a tiny but complete computer. It has a CPU (central processing
unit), program memory (PROM), working memory (RAM), and two input-ports. it can store and
retrieve data in working memory (RAM).
The program memory of the F84A consists of flash EPROM; it can be recorded and erased
electrically, and it retains its contents when powered off. Program memory (FLASH)-for storing a
written program.
Working memory holds the data when it's working on. There are also several special
function registers each of which controls the operation of the PIC in some way.
There are two input- output ports, port A and port B, and each pin of each port can be
set individually as an input or an output. The bits of each port are numbered, starting at 0. In
output mode, bit 4 of port A has an open collector (or rather open drain); the rest of the
outputs are regular CMOS. The CPU treats each port as one 8-bit byte of data even though
only five bits of port A are actually brought out as pins of the IC. PIC inputs are CMOScompatible; PIC outputs can drive TTL or CMOS logic chips: Each output pin can source or
sink 20mA as long as only one pin is doing so at a time.
Toggle Unit
This stage takes care of the switching either OFF or ON of the security system. This stage is
implemented by employing the 4013BM dual d flip-flop. The 4013 dual flip-flop is a
monolithic complementary MOS (CMOS) integrated circuit constructed with N-channel and
P -channel enhancement transistors . Each flip -flop has independent data, set, reset and clock
inputs and
5
Q and Q outputss . These devices can be used for shift register applications , and by connecting Q s

output to the data input, for counter and toggle applications. The logic level present at the D input
is transferred to the Q output during the positive-going transition of the clock pulse. Setting or
resetting is independent of the clock and is accomplished by a high level on the set or reset line
respectively.
Motion Detection Unit
This stage is implemented through the use of the infra red break beam approach wherein any
break in the infra red beam transmitted to the photo diode is detected as motion. It is subdivided
in two stages:
Transmitter stage
The Transmitter Stage involves an infrared diode and a limiting resistor. The infrared diode is
forward biased to meet the electrical conditions at which it is manufactured to operate.
Receiver Stage
The circuit employs the use of a photodiode receiver and an amplifier to give a HIGH or LOW
output when the beam is broken.
The circuit diagrams that make up the whole of burglar alarm system are analyzed as shown in
figure 3 above.
5. Software Design Consideration
The PIC was programmed by using Assembly Language Programming for speed optimization.
Coding in assembly language represents half-way position between machine code and a high level
language. A programmer unit was used to enable the program to be loaded into microcontrollers
memory which allows it to run,

After overall planning, the principle of burglar alarm system is in the first priority to work on and
follow to instruct the microcontroller to accept and execute a known security code with which the
security system is either enabled or disabled. As discussed above, the overall thread for the
programming worked out, and shown as the following flowchart in figure 5 above.
7. System construction
The physical realization of the project is very vital. This is where the fantasy of the whole idea
meets reality. Here the paper work is transformed into a finished hardware. After carrying out all
the paper design and analysis, the project was implemented, constructed and tested to ensure its
working ability. The construction of this project was done in three different stages.

The implementation of the whole project on a solder-less experiment board (bread


board).

The soldering of the circuits on Vero-boards.

The coupling of the entire project to the casing.


Principle of Operation
The burglar alarm system is built around a microcontroller programmed to accept a known
security code with which the security system is either enabled or disabled.
The security code is a six digit code that is entered via the keypad interfaced to the
microcontroller. The microcontroller accepts the entered code and digital compares it with the
registered code. When the code is found to be correct, the microcontroller outputs a TTL logic
signal that is used to clock a timer stage. The timer stage is implemented by using a timer/
oscillator IC (NE555P) which outputs a clock that toggles the D-flip flop. The flip-flop changes
states on every clock it receives and with this the security system is either enabled or disabled.
The motion detection stages are implemented through the use of infra red transceivers. The infra
red transmitter emits infra red rays which are detected by the photo diode placed within the line of
sight of the transmitters. Any break detected in the line of communication between the transmitter
and receiver is sensed and processed fro motion detection. When motion is detected by any of the
four transceivers employed to monitor the perimeter of the building, an alarm comes on to alert of
a possible presence of an intruder.
The electronic modules that make up the whole of this burglar alarm system are analyzed in the
figure 6 below
8. Testing
Stage by stage testing was done according to the block representation on the breadboard,
before soldering of circuit commenced on Vero board.
The process of testing and implementation involved the use of some test and measuring
equipments stated below.
Bench Power Supply: This was used to supply voltage to the various stages of the circuit
during the breadboard test before the power supply in the project was soldered. Also during
the soldering of the project the power supply was still used to test various stages before they
were finally soldered.
Oscilloscope: The oscilloscope was used to observe the ripples in the power supply waveform
and to ensure that all waveforms were correct and their frequencies accurate.
Digital Multi-meter: The digital multi-meter basically measures voltage, resistance,
continuity, current, frequency, temperature and transistor . The process of implementation
of the design on the board required the measurement of parameters like, voltage, continuity,
current and resistance values of the components and in some cases frequency measurement.
The digital multimeter was used to check the output of the voltage regulators used in this
project.
Problems Encountered

Like every research and practical engineering work, diverse kinds of problems are often
encountered. The problems encountered in this project and how the were solved and
maneuvered are listed below. Difficulties in running the programme effectively until after
several troubleshooting.

Components are very scarce, thereby going extra length before getting
them.

ICs getting burnt due to power fluctuation.

Code:
#include <REGX51.H>
sbit rs=P3^2;
sbit rw=P3^3;
sbit en=P3^4;
sfr datas=0xA0;
void lcdinit(void);
void lcdcmd(unsigned char );
void delay(unsigned int del);
void lcddata(unsigned char ldat);
void del1();
void sms1();
void sendd();
void INITLCD()
{
lcdinit();
}
void COMMAND(unsigned char val)
{
lcdcmd(val);
}
void DISPLAY(unsigned char val)
{
lcddata(val);
}
void lcdinit(void)
{
lcdcmd(0x38);
lcdcmd(0x38);
lcdcmd(0x38);
lcdcmd(0x06);
lcdcmd(0x0e);
lcdcmd(0x01);
lcdcmd(0x0C);
lcdcmd(0x80);
}
void lcdcmd(unsigned char lcmd)
{
datas=lcmd;
rs=0;
rw=0;
en=1;
delay(100);

en=0;
}
void delay(unsigned int del)
{
while(del--);
}
void lcddata(unsigned char ldat)
{
datas=ldat;
rs=1;
rw=0;
en=1;
delay(100);
en=0;
}
char flags=0;
char flagt=0;
char kval=0;
char flagr=0;
int recharge=0;
char flagtick=0;
unsigned char keypad();
void disp(unsigned char dat)
{
}

DISPLAY(dat);

void cls()
{

COMMAND(0x01);
COMMAND(0x02);
COMMAND(0x80);

void putchar(unsigned char val[16],char len)


{
char i;
for(i=0;i<len;i++)
{
disp(val[i]);
}
}
void txs(unsigned char val)
{
int i;
TI=0;
SBUF=val;
for(i=0;i<600;i++);
//while(TI==0);
}
unsigned char val[8],value,ct,fg,i=0,j;
int ps;
void serint() interrupt 4 using 1
{
if(RI==1)
{

else

val[j]=SBUF;
j++;
RI=0;

{
TI=0;
}

void main()
{
P1=0X00;
P2_0=1;
while(1)
{

if(P2_0==1)
{
P1_5=0;
P1_6=1;
P1_7=1;
}
else if(P2_0==0)
{
P1_5=1;
P1_6=0;
P1_7=0;
}

}
}
}

9. Conclusion
The project which is the design and construction of digital head counter was designed
considering some factors such as economic application, design economy, availability of
components and research materials, efficiency, compatibility and portability and also durability.
The performance of the project after test met design specifications. However, the general
operation of the project and performance is dependent on the user who is prone to human error
such as entering wrong timing.

10. Recommendations
For the purpose of the future research, the project work can be improved upon in the following
ways:

The whole system may be implemented by using remote control to enable or


disable the security code.

The system can be designed to send security alert to the nearest police station.

You might also like