DESIGN AND CONSTRUCTION OF BURGLAR ALARM SYSTEM ABSTRACT
Applica Applicatio tions ns of digital digital electro electronic nicss were were widely widely used used in almost almost all areas areas of life: life: comput computers, ers, automa automated ted machin machinee contro control, l, robots robots,, energy energy monito monitorin ring g and contro control, l, invent inventory ory managem management ent,, 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 know known n secur security ity code code with with whic which h the the secur security ity syste system m is eith either er enab enable led d or disa disabl bled ed.. The 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 ystem, !icrocontroller, !otion "etection, # nfrared Transmitter
1. Introd!t"on
"igital electronics applications were for many years confined to computer systems. #n today‟s world, the term $digital% has become part of our everyday vocabulary because of the dramatic way that digital circuits and digital techni&ues 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. #n modern homes, digital circuitry controls the appliances, alarm system and heating' cooling systems. #n corporate organi(ation, digital circuitry is employed is almost every activity including employee‟s resumption timing, cash counting, processing payrolls, and communication. This pro)ect 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. *n entering the correct six +- digit code on a keypad into the system, the burglar alarm system comes alive. The system incorporates an antifiddle 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. #n this state, all keys pressed are ignored for one minute and at the same time the bu((er will sound the alarm signal. This function thwarts any attempt by /hackers, to &uickly try large numbers of codes in se&uence. #n designing this pro)ect, 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 bu((er 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. # am ma)orly interested in this pro)ect solely because of the increasing crime rate in this country and a way of stopping the situation. 0urthermore, there was a need to protect home so that users can take advantage of technological advancement even when the person concerned is not around.
De#e$o%&ent o' ( S"&%$e Sond A!t"#(ted Br)$(r A$(r& Syste&
According to Ahmed !. , !ohammed A. . 1 Agbo 2. A. +3445- explained how the amplifier stage was built around an 6!75 8!* operational amplifier. The circuit arrangement is such that it can amplify an input signal up to 344 times its original value. *nce 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.
0igure 9: 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.
*. Syste& O#er#"ew
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 ulio anche( and !aria ;. 8anton, in their book microcontroller programming +344<-, explained microcontroller is a computer control system on a single chip. #t 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. ;rograms written into the microcontroller are stored in the =;>*! +=lectrically ;rogrammable >ead *nly !emory-. 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 >A!, >andom Access !emory. 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. 0igure 3 shows the block diagram of the overall system. 0or implementation of burglar alarm system there were some materials that was used, this includes: ;rogrammable #8, AT5?@3 this served as brain, the remain materials are photodiode, 6=", >esistor, 8apacitor, #8 ocket, @volt >egulator +<54@-, eroboard, 6ist of tools used are: soldering iron, cutter, nose pliers,
multimeter, #8 programmer.
DIGITAL TIMING
+ower INFRARED
S%%$y
SENSORS
ALARM
LOGIC CONTROL
CIRCUITRY STAGE
STAGE
MICROCON , TROLLER STAGE
CODE ENTRY STAGE -KEY+AD
0igure 3: 2enerali(ed block diagram for the burglar alarm
7
STAGE
0igure 7: 8ircuit diagram for the burglar alarm system
/. 0(rdw(re Des")n Cons"der(t"on +ower S%%$y Un"t
The whole design is powered with a @ dc supply. Cerein, a regulated dc voltage is obtained from the mains‟ 334A8. A step down transformer is used to step down the 334A8 to 95A8. The 95A8 is rectified to obtain a dc voltage re&uire to power the digital circuitry. ince the microcontroller re&uires a @volt supply, a voltage regulator +<564@- is used to regulate the rectified, filtered 95"8 to @"8 desired. 0igure 5 shows the power supply stage for this design. M"!ro!ontro$$er Un"t
The microcontroller stage is implemented by using the popular and versatile ;#8905DA. ;#8905D belongs to a class of 5bit microcontrollers of >#8 architecture. #t is an 95 pin dual in line package chip. The ;#8 is a tiny but complete computer. #t has a 8;E +central processing unit-, program memory +;>*!-, working memory +>A!-, and two inputports. it can store and retrieve data in working memory +>A!-. The program memory of the 05DA consists of flash =;>*!F it can be recorded and er ased electrically, and it retains its contents when powered off. ;rogram memory +06AC-for storing a written program. Working memory holds the data when itGs working on. There are also several special function registers each of which controls the operation of the ;#8 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 4. #n output mode, bit D of port A has an open collector +or rather open drain-F the rest of the outputs are regular 8!*. The 8;E treats each port as one 5bit byte of data even though only five bits of port A are actually brought out as pins of the #8. ;#8 inputs are 8!* compatibleF ;#8 outputs can drive TT6 or 8!* logic chips: =ach output pin can source or sink 34mA as long as only one pin is doing so at a time. To))$e Un"t
This stage takes care of the switching either *00 or *H of the security system. This stage is implemented by employing the D497B! dual d flipflop. The D497 dual flipflop is a monolithic complementary !* +8!*- integrated circuit constructed with Hchannel and ; channel enhancement transistors . =ach flip flop has independent data, set, reset and clock inputs and
@ I and I output s . These devices can be used for shift register applications , and by connecting I
output to the data input, for counter and toggle applications. The logic level present at the " input is transferred to the I output during the positivegoing transition of the clock pulse. etting or resetting is independent of the clock and is accomplished by a high level on the set or reset line respectively. Mot"on Dete!t"on Un"t
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. #t is subdivided in two stages: Tr(ns&"tter st()e
The Transmitter tage 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. Re!e"#er St()e
The circuit employs the use of a photodiode receiver and an amplifier to give a C#2C or 6*W output when the beam is broken. The circuit diagrams that make up the whole of burglar alarm system are analy(ed as shown in figure 7 above.
. So'tw(re Des")n Cons"der(t"on
The ;#8 was programmed by using Assembly 6anguage ;rogramming for speed optimi(ation. 8oding in assembly language represents halfway position between machine code and a high level language. A programmer unit was used to enable the program to be loaded into microcontroller‟s 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 @ above. 2. Syste& !onstr!t"on
The physical reali(ation of the pro)ect is very vital. This is where the fantasy of the whole idea meets reality. Cere the paper work is transformed into a finished hardware. After carrying out all the paper design and analysis, the pro)ect was implemented, constructed and tested to ensure its working ability. The construction of this pro)ect was done in three different stages.
The implementation of the whole pro)ect on a solderless experiment board +bread board-.
The soldering of the circuits on eroboards.
The coupling of the entire pro)ect to the casing. +r"n!"%$e o' O%er(t"on
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 TT6 logic signal that is used to clock a timer stage. The timer stage is implemented by using a timer' oscillator #8 +H=@@@;- which outputs a clock that toggles the "flip flop. The flipflop 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 analy(ed in the figure below 3. Test"n)
tage by stage testing was done according to the block representation on the breadboard, before soldering of circuit commenced on ero board. The process of testing and implementation involved the use of some test and measuring e&uipments 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 pro)ect was soldered. Also during the soldering of the pro)ect 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 fre&uencies accurate. Digital Multi-meter: The digital multimeter basically measures voltage, resistance,
continuity, current, fre&uency, temperature and transistor J . The process of implementation of the design on the board re&uired the measurement of parameters like, voltage, continuity, current and resistance values of the components and in some cases fre&uency measurement. The digital multimeter was used to check the output of the voltage regulators used in this pro)ect. +ro4$e&s En!ontered
6ike every research and practical engineering work, diverse kinds of problems are often encountered. The problems encountered in this pro)ect and how the were solved and maneuvered are listed below. "ifficulties in running the programme effectively until after several troubleshooting.
8omponents are very scarce, thereby going extra length before getting them.
#8s getting burnt due to power fluctuation.
Code: Kinclude L>
[email protected] sbit rsO;7P3F sbit rwO;7P7F sbit enO;7PDF sfr datasO4xA4F void lcdinit+void-F void lcdcmd+unsigned char -F void delay+unsigned int del-F void lcddata+unsigned char ldat-F void del9+-F void sms9+-F void sendd+-F void #H#T68"+Q lcdinit+-F R void 8*!!AH"+unsigned char valQ lcdcmd+val-F R void "#;6AS+unsigned char valQ lcddata+val-F R void lcdinit+void Q lcdcmd+4x75-F lcdcmd+4x75-F lcdcmd+4x75-F lcdcmd+4x4-F lcdcmd+4x4e-F lcdcmd+4x49-F lcdcmd+4x48-F lcdcmd+4x54-F R
void lcdcmd+unsigned char lcmdQ datasOlcmdF rsO4F rwO4F enO9F delay+944-F
enO4F R void delay+unsigned int delQ while+del-F R
void lcddata+unsigned char ldatQ datasOldatF rsO9F rwO4F enO9F delay+944-F enO4F R
char flagsO4F char flagtO4F char kvalO4F char flagrO4F int rechargeO4F char flagtickO4F unsigned char keypad+-F void disp+unsigned char datQ R
"#;6AS+dat-F
void cls+Q R
8*!!AH"+4x49-F 8*!!AH"+4x43-F 8*!!AH"+4x54-F
void putchar+unsigned char val9U,char lenQ char iF for+iO4FiLlenFiVVQ disp+valiU-F R R void txs+unsigned char valQ int iF T#O4F BE0OvalF for+iO4FiL44FiVV-F ''while+T#OO4-F R unsigned char val5U,value,ct,fg,iO4,)F int psF void serint+- interrupt D using 9 Q if+>#OO9Q
else
R
R
val)UOBE0F )VVF >#O4F
Q T#O4F R
void main+Q ;9O4M44F ;34O9F while+9Q
if+;34OO9Q ;9@O4F ;9O9F ;9
R R R
R
5. Con!$s"on
The pro)ect 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 pro)ect after test met design specifications. Cowever, the general operation of the pro)ect and performance is dependent on the user who is prone to human error such as entering wrong timing.
16. Re!o&&end(t"ons
0or the purpose of the future research, the pro)ect 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.