B.B. Manohar
D
on’t take the chance of becoming a victim of burglary, which is of ten accompanied by violence.Protect your family and valuables with this microprocessor-based home secu-rity system that will let you rest your head knowing that should any one try to break into your home, an alarm will go off and the police will be alerted im-mediately.
The 8085 microprocessor-based home security system, as shown in Fig.
1, consists of transmitter, receiver, phase-locked loop (PLL) and processing sections.
The transmitter section continuously transmits infrared (IR) rays, which are received by the receiver section. The received signal is further amplified and given to the PLL section, where its frequency is locked to the transmitted frequency.
When the IR signal is interrupted, the microprocessor starts working as per the program burnt into the erasable program-mable read-only memory (EPROM) and controls the siren, telephone (via cradle and redial switches) and cassette player
(in which the alert message is recorded already) via the respective relays.
Circuit description
Fig. 2 shows the complete circuit of the 8085 microprocessor-based home security system.
In the transmitter section, NE555 (IC1) is wired as an astable multivibrator whose oscillating frequency is decided by resistors R1 and R2, preset VR1 and capacitor C1. Capacitor C3 bypasses the noise to ground, preventing any change in the calculated pulse-width.
The output of IC1 is fed to the base of transistor T1, which drives an infrared light-emitting diode (IR LED) to transmit the modulated IR signal. Resistor R4 limits the current flowing through the IR LED. Preset VR1 is used to vary the modulating frequency.
The transmitter and the receiver are arranged such that the transmitted IR rays fall directly onto phototransistor L14G1 (T2) of the receiver. The signal received by T2 is amplified by transistor T3 and operational amplifier µA741 (IC2).
Series input resistor Fig. 1: Block diagram of the 8085 microprocessor-based home
security system
ParTs lIsT Semiconductors:
IC1 - NE555 timer
IC2 - µA741 operational amplifier IC3 - LM567 phase-locked loop IC4 - 8085 microprocessor IC5 - 2732A EPROM (4k)
IC6 - 74LS373 octal transparent latch
IC7 - 8255A programmable periph-eral interface
IC8, IC9 - MCT2E optocoupler IC10 - 7805 5V regulator IC11 - 7809 9V regulator IC12 - 74LS00 NAND gate T1, T3-T9 - BC548 npn transistor T2 - L14G1 phototransistor D1 - 1N4148 switching diode D2-D10 - 1N4007 rectifier diode LED1-LED3 - Red LED
IR LED1 - Infrared LED Resistors (all ¼-watt, ±5% carbon, unless stated otherwise): C9 - 10µF,10V electrolytic C10, C11 - 10pF ceramic disk C12 - 1000µF, 50V electrolytic Miscellaneous:
Fig. 2: Circuit of the 8085 microprocessor-based home security system
falling within its detection band is present in its self-biased input. The centre fre-quency of the detection band and output delay are independently determined by the external components.
In the absence of any input signal, the centre frequency of the PLL’s internal free-running, current-controlled oscillator is determined by resistor R12 and capacitor C8. Preset VR2 is used for tuning IC3 to the desired centre frequency in the 6-10kHz range, which should match the modulating frequency of the transmitter. Capacitors C6 and C7 are used as low-pass filter (LPF) and output filter, respectively.
When the received signal is locked to the frequency of the transmitted signal, pin 8 of IC3 goes low and LED1 glows. Since pin 8 is connected to the base of transistor T4 through resistor R13, it is cut off and its collector voltage rises. As a result, transis-tor T5 is forward biased to energise relay RL5. The pole and normally-closed (N/C) contact of relay RL5 are connected to +5V and pin 4 (PA0) of IC7, respectively.
Normally, the transmitted IR signal falls on phototransistor T2, so relay RL5 is energised and there is no input to the processor via IC7. When the IR signal is interrupted, relay RL5 de-energises to provide a high (TTL-level) signal to the processor via port A of the programmable peripheral interface (PPI).
The processing section consists of an 8-bit 8085 microprocessor (IC4), EPROM IC 2732A (IC5), octal transparent latch IC 74LS373 (IC6) and programmable periph-eral interface IC 8255A (IC7).
When the microprocessor gets a high signal from port A of IC7, it starts working as per the code loaded in the EPROM (IC5).
EPROM IC 2732A is a UV erasable and electrically programmable memory.
It is organised as 4096 words×8 bits. The transparent window allows the user to expose the chip to ultraviolet light to erase the chip. After erasing the chip, a new program can be burnt into it.
IC 8085 (IC4) is an 8-bit, general-pur-pose microprocessor capable of addressing 64k of memory. It includes most of the logic circuitry required for performing computing tasks and communicating with the peripherals.
The low-order multiplexed address and data lines AD0 through AD7 of IC4 are connected to the EPROM (IC5) through the octal latch (IC6), while its high-order address lines A8 through A10 are directly connected to the EPROM. Ad-dress lines A0 through A7 are separated
from data lines D0 through D7 by latch-enable signal (ALE).
Address latch-enable (ALE) pin 30 of the microprocessor is connected to
latch-enable pin 11 of IC6. When ALE is high, the latch is transparent, i.e. the output changes according to the input data. When ALE goes low, the low-order address is latched at the output of IC6.
Data lines D0 through D7 of the micro-processor are connected to the data lines of IC5 and IC7 each. Chip-select signal (CS) for IC5 is generated by RD and IO/M lines with the help of a NAND gate. The inverted IO/M signal provides CS signal to IC7.
IC 8255A (IC7) is a general-purpose programmable device compatible with most microprocessors. It has three pro-grammable ports, any of which can be used for bidirectional data transfer. The 24 I/O pins can be grouped in two 8-bit ports (ports A and B) and the remaining eight bits as port C. The eight bits of port C can be used as individual bits or grouped in two 4-bit ports, namely, CUPPER and CLOWER. Ports A and C are configured as the input ports, and port B is configured as the output port. Port A is used for intruder detection, port B for activating the siren, cassette player, telephone cradle switch and redial button, and port C for polarity-reversal detection.
PB0 (pin 18), PB1 (pin 19), PB2 (pin 20) and PB7 (pin 25) of IC7 are connected to the bases of transistors T6 through T9 via resistors R19 through R22, respective-ly. A high signal on these pins energises relays RL1 through RL4. Switch S1 is used to reset IC4.
As you may be aware, telephone exchanges provide DC voltage reversal facility to PCOs (and other subscribers for a fee) to indicate call maturity. The same is assumed to have been incorporated in our telephone.
The circuit for detecting the polar-ity reversal in the telephone line is built around optocouplers IC8 and IC9. Nor-mally, TIP is positive with respect to the RING lead of the telephone line. With the handset in off-hook position, a nominal loop current of 10 mA is assumed to flow through the telephone lines. Resistor R23 Fig. 3: power supply circuit
Fig. 4: Flow-chart of the program
is selected as 120 ohms to develop a volt-age of 1.2V (which is adequate for an LED to turn on fully). When DC line voltage polarity reversal occurs, optocoupler IC8’s internal LED conducts and LED3 glows to indicate polarity reversal. Simultaneously, optocoupler IC9’s internal LED goes off and its pin 5 (collector) goes high to
pro-Fig. 5: Actual-size, solder-side pCB layout for the home security system
Fig. 6: Actual-size, component-side pCB layout for the home security system
vide line-reversal sense signal to 8085 via pin 14 of 8255 PPI.
Fig. 3 shows the power supply circuit.
The AC mains is stepped down by trans-former X1 to deliver a secondary output of 12V AC at 300 mA. The transformer out-put is rectified by a full-wave bridge recti-fier comprising diodes D7 through D10.
Capacitor C12 acts as a filter to eliminate ripples. IC10 and IC11 provide regulated 5V and 9V power supplies, respectively.
Capacitors C13 and C14 bypass any ripple present in the regulated outputs. Switch S2 acts as an ‘on’/‘off’ switch.
Relay connections. The cradle switch in the telephone instrument is a
double-pole, two-way switch. Replace this cradle switch with the contacts of DPDT relay RL3 as shown in Fig. 2. Now relay RL3 is used to implement the action of lifting the telephone handset.
There are four pads on the PCB of the telephone instrument where cradle switch is connected. The two pads which are shorted when the telephone handset is placed on the cradle are connected to the normally closed (N/C) contacts of relay RL3, while the other two pads which are shorted when the handset is off-hook are connected to the normally open (N/O) contacts of relay RL3.
Relay RL2 is connected in parallel to the redial button of the telephone in-strument. When relay RL3 energises to emulate lifting of the handset, relay RL2 is energised to switch on the redial button and the already loaded telephone number of the police station or any other help provider is automatically dialled.
Relay RL4 activates the siren when-ever the IR signal being received is inter-rupted. The siren sounds continuously until the user presses the reset button.
Relay RL1 is used to switch on the audio cassette player, in which the user’s residential address and alert message to be conveyed to the police station are prere-corded. The speaker output of the cassette player is connected to the telephone’s microphone to convey the alert message
to the police station. The player gets switched off when the message is over.
Working of the circuit
The transmitting IR LED1 and pho-totransistor T2 of the receiver are fitted to the opposite pillars of the gate such that the IR rays emitted by the LED directly fall on the phototransistor.
The IR LED transmits a train of IR pulses. These pulses are received by the receiver and amplified by IC2. Output pin 8 of the PLL (IC3) is low when the PLL network is locked to the transmitter fre-quency and relay RL5 energises to make PA0 line of IC7 low.
When someone walks through the gate to enter your home, the transmitted signal is interrupted. Output pin 8 of the PLL network goes high and relay RL5 de-ener-gies to make PA0 line of IC7 high. Now the microprocessor starts working as per the program loaded in the EPROM.
Relay RL4 energises to activate the si-ren. At the same time, relay RL3 energises to emutate lifting the telephone handset off the cradle to provide the dial tone. After a few seconds, relay RL2 energises to short the redial button contacts. After the loaded number is dialled, it switches off relay RL2.
Then relay RL1 turns on the audio player.
Here we have provided the same po-larity-reversal detection facility so that Fig. 7: Component layout for the pCB
the audio player turns on only when polar-ity-reversal is detected.
The actual-size, double-side track lay-outs for solder and component sides of the PCB for the 8085 microprocessor-based home security system are shown in Figs 5 and 6, respectively, and their component layout in Fig. 7.
Software program
Fig. 4 shows the flow-chart of the Assembly language program. The device interface IC (IC7) is initialised with con-trol word 99H. Ports A and C of IC7 act as input ports, while port B becomes the output port.
After initialisation, the 8085 micro-processor reads the status of port A. If port A is high, siren is activated. The tel-ephone goes in off-hook condition and the emergency number is dialled through the redial button. Redial button gets switched off after the number is dialled. Now the microprocessor reads the status of port C and checks for the polarity reversal of the telephone line. When polarity reversal is detected, the audio player turns on to play the message. Otherwise, the process re-peats from activation of the siren followed by emergency number dialling and so on.
After delivering the message, the player automatically gets turned off. The siren sounds until the reset switch is pressed.
SeCuriTy.LST
2500 A.D. 8085 CROSS ASSEMBLER - VERSION 3.00b
INPUT FILENAME : SECURITY.ASM OUTPUT FILENAME : SECURITY.
1 0000 ORG 0000H
2 0000 3E 99 MVI A,99H ;Move control word to accumulator.
3 0002 D3 03 OUT 03H ;O/P control word to control registor.
4 0004 DB 00 L1:IN 00H ;Read port-A.
5 0006 FE 01 CPI 01H ;Accumulator value compared with 01H 6 0008 C2 04 00 JNZ L1 ;Jump to L1 if it is not equal.
7 000B 3E 88 L2:MVI A,88H ;Move 88H to accumulator.
8 000D D3 01 OUT 01H ;O/P the accumulator content to port-B (Siren 9 000F 06 FF MVI B,FFH; ON).
10 0011 0E FF LA:MVI C,FFH ;Delay Routine.
11 0013 0D LB:DCR C 12 0014 C2 13 00 JNZ LB 13 0017 05 DCR B 14 0018 C2 11 00 JNZ LA
15 001B 3E 84 MVI A,84H ;Move 84H to accumulator.
16 001D D3 01 OUT 01H ;O/P the accumulator content to port-B.
17 001F 06 FF MVI B,FFH
18 0021 0E FF LAA:MVI C,FFH ;Delay Routine.
19 0023 0D LBB:DCR C 20 0024 C2 23 00 JNZ LBB 21 0027 05 DCR B 22 0028 C2 21 00 JNZ LAA
23 002B 3E 86 MVI A,86H ;Move 86H to accumulator.
24 002D D3 01 OUT 01H ;O/P the accumulator content to port-B.
25 002F 11 FF FF LXI D,FFFFH 26 0032 1B LOOP1:DCX D 27 0033 7A MOV A,D 28 0034 B3 ORA E 29 0035 C2 32 00 JNZ LOOP1
30 0038 3E 84 MVI A,84H ;Move 84H to accumulator.
31 003A D3 01 OUT 01H;O/P the accumulator content to port-B.
32 003C 06 40 MVI B,40H 33 003E 11 FF FF SEC:LXI D,FFFFH 34 0041 DB 02 IN 02H
35 0043 FE 01 CPI 01H 36 0045 CA 59 00 JZ OFF 37 0048 1B LOOP:DCX D 38 0049 7A MOV A,D 39 004A B3 ORA E 40 004B C2 48 00 JNZ LOOP 41 004E 05 DCR B 42 004F C2 3E 00 JNZ SEC
43 0052 DB 02 IN 02H ;Read port-C.
44 0054 FE 01 CPI 01H ;Accumulator value compared with 01H 45 0056 C2 0B 00 JNZ L2 ;Jump to L2 if it is not equal.
46 0059 3E 85 OFF:MVI A,85H ;Move 85H to accumulator.
47 005B D3 01 OUT 01H ;O/P the accumulator content to port-B.
48 005D 01 FF 01 LXI B,1FFH 49 0060 11 FF FF SEC0:LXI D,FFFFH 50 0063 1B LOOP0:DCX D 51 0064 7A MOV A,D 52 0065 B3 ORA E 53 0066 C2 63 00 JNZ LOOP0 54 0069 0B DCX B 55 006A 78 MOV A,B 56 006B B1 ORA C 57 006C C2 60 00 JNZ SEC0 58 006F 3E 80 MVI A,80H 59 0071 D3 01 OUT 01H 60 0073 11 FF FF LP1: LXI D,FFFFH 61 0076 1B LP:DCX D 62 0077 7A MOV A,D 63 0078 B3 ORA E 64 0079 C2 76 00 JNZ LP
65 007C C3 73 00 JMP LP1 66 007F 76 HLT
67 0080 END
************* S Y M B O L I C R E F E R E N C E T A B L E *************
L1 0004 L2 000B LA 0011 LAA 0021
LB 0013 LBB 0023 LOOP 0048 LOOP0 0063
LOOP1 0032 LP 0076 LP1 0073 OFF 0059 SEC 003E SEC0 0060
LINES ASSEMBLED : 67 ASSEMBLY ERRORS : 0 q
F
or the blind, it’s difficult to step out without someone’s help. To make the life simpler for them, here’s an electronic safety guard system that alerts them of any obstacle or object in their path. The system can detect obsta-cles within one metre.The system comprises transmitter and receiver sections (see Fig. 1). The receiver section uses an embedded system that tells the voice processor to play the recorded message in case any obstacle is
P. Murali KuMar