Documente Academic
Documente Profesional
Documente Cultură
P. MURALI KUMAR
System operation
The transmitter is built around timer
IC 555, which is designed to operate at a
frequency of 38 kHz. This signal is amplied by a current amplier and transmitted through infrared (IR) diodes.
The receiver section consists of an IR
PARTS LIST
Semiconductors:
IC1
IC2
IC3
IC4
- 555 timer
- 7805 5V regulator
- LM311 comparator
- AT89C51 microcontroller
chip
IC5
- ISD1420 voice processor
T1-T5, T7
- BC 548 npn transisor
T6
- BC558 pnp transisor
IR LED1, IR LED2 - Infrared LEDs (5mm dia.)
IRX1
- TSOP1738 IR receiver
module
ZD1
- 2.2V, 1/4W zener diode
D1
- 1N4001 rectier diode
LED1, LED2
- Red LED (5mm dia.)
LED3
- Green LED (5mm dia.)
LED4
- Yellow LED (5mm dia.)
LED5
- Red LED (5mm dia.)
Capacitors:
C1, C2
C3, C4
C5, C6
C7
C8, C14
C9, C10, C11,
C13
C12
Miscellaneous:
B1, B2
XTAL1
S1, S2
S3, S4
MIC
JACK1
RL1
115
microcontroller.
When the comparator output
goes high because of reection of
signal from an object, the microcontroller energises a relay via the
relay driver. The relay contacts are
used by a voice processor to play a
prerecorded warning message (such
as hey, theres an obstacle). The
user can hear the played message
using a headphone.
Circuit description
Transmitter section. Fig. 2
shows the transmitter circuit pow- Fig. 3: Receiver circuit
ered by a 9V battery. When
switch S1 is closed, LED1
glows to indicate the presence
of power in the circuit. Timer
IC 555 (IC1) is wired as an
astable multivibrator. The
output frequency (38 kHz) of
IC1 at its pin 3 can be varied
using VR1 (2k). The output
of IC1 is given to the base of
npn transistor T1 (BC548) via
resistor R3. Transistors T1
and T2 (each BC548) form a
Darlington pair that boosts
the output current to drive the
two infrared diodes connected
in series at the collector of the
Darlington pair (IR LED1 and
IR LED2). The output signal
frequency of 38 kHz is transmitted by the IR LEDs.
Receiver section. Fig.
3 shows the receiver circuit Fig. 4: Connections for the microcontroller
powered by a 9V battery. When
switch S2 is closed, LED2 glows to indicate
LED3. This output is given to the I/O port
the presence of power in the circuit. The
P1.0 of microcontroller IC4.
9V supply is down-converted to 5V using
Microcontroller section. Microregulator IC 7805 (IC2) to drive the IR
controller chip AT89C51 (IC4) acts as a
receiver module (TSOP1738), microconswitching hub only and can be replaced
troller and voice processor sections.
by any other switching circuit. The use of
The IR rays reected from any object
this chip in this circuit is to show how to
in the path of the user are received by
interface an embedded system in a home
the IR receiver module. This signal is
made project. The program burnt into this
ampli!ed by the power ampli!er stage
chip decides the action when a signal is
comprising transistors T3, T4 and T5
received at its input.
(each BC548). The ampli!ed output at
As shown in Fig. 4, ports P1.0 through
the emitter of transistor T5 is given to the
P1.3 of IC4 are used as the input ports.
non-inverting input (pin 2) of comparator
The corresponding outputs are available
IC LM311 (IC3) through resistor R13.
at ports P2.0 through P2.3. The output of
A reference voltage of 2.2V developed
the comparator is fed to port P1.0 and the
across zener diode ZD1 is connected to the
corresponding output at port P2.0 is fed to
inverting input (pin 3) of IC3. When the
the base of transistor T6 (BC558) through
voltage level at pin 2 increases beyond the
resistor R18.
reference voltage, output pin 7 of IC3 goes
Normally, when no signal is applied at
high, which is indicated by the glowing of
input port P1.0, output port P2.0 is high.
116
117
Fig. 6: Actual-size, single-side PCB for transmitter and receiver circuits of the safety guard
Construction and
working
118
again.
If compilation is successful, an object
le with .obj extension is created for the
source le. The compiler shows Embed0 Error(s), 0 Warning(s) in the output
window just below the project window.
It also produces a listing le with .lst
extension for the source le. Then the
system links all the generated les into a
combined hex le (with .hex extension)
suitable for loading into the chip. In this
The transmitter and receiver circuits can be assembled on separate general-purpose PCBs. Both the circuits
must be separated or covered
by some opaque, non-conducting material so that no stray
signal from the transmitter
falls on the receiver. The units
can be carried in a bag, with
the IR transmitting LEDs
and the receiver sensor (IRX1)
mounted on the front side of
the users belt by extending their leads
using shielded wires.
This system uses only one pair of
transmitter and receiver circuits for
alerting against the obstacles in the path
of the user, but it can be extended to use
three more pairs for detection of objects
on the right, left and back side. As shown
in Fig. 4, input ports P1.1, P1.2 and P1.3
of AT89C51 and their corresponding
output ports P2.1, P2.2 and P2.3 are
EMBED.C
/* C PROGRAM OF EMBEDDED SYSTEM */
#include<stdio.h>
#include<Regx51.h>
sbit t0=P1^0;
sbit t1=P1^1;
sbit t2=P1^2;
sbit t3=P1^3;
sbit t4=P2^0;
sbit t5=P2^1;
sbit t6=P2^2;
sbit t7=P2^3;
sbit t8=P2^4;
sbit t9=P1^5;
sbit t10=P1^6;
sbit t11=P1^7;
sbit t12=P2^5;
sbit t13=P2^6;
sbit t14=P2^7;
void main()
{
t9=t10=t11=t12=t13=t14=0;
t0=1; t1=1;t2=1;t3=1;//t3=t2=t1=t0=1;
for(; ;)
{
l1: if(t0==0)
{
t4=1;
t5=t6=t7=t8=0;
goto l1;
}
l2:if(t1==0)
{
t5=1;
t4=t6=t7=t8=0;
goto l2;
}
l3:if(t2==0)
{
t6=1;
t4=t5=t7=t8=0;
goto l3;
}
l4:if(t3==0)
{
t7=1;
t4=t5=t6=t8=0;
goto l4;
}
t8=1;
t4=t5=t6=t7=0;
}
}
EMBED.LST
C51 COMPILER V7.10 EMBED
1
1
1
1
source
/* C PROGRAM OF EMBEDDED SYSTEM */
#include<stdio.h>
#include<Regx51.h>
sbit t0=P1^0;
sbit t1=P1^1;
sbit t2=P1^2;
sbit t3=P1^3;
sbit t4=P2^0;
sbit t5=P2^1;
sbit t6=P2^2;
sbit t7=P2^3;
sbit t8=P2^4;
sbit t9=P1^5;
sbit t10=P1^6;
sbit t11=P1^7;
sbit t12=P2^5;
sbit t13=P2^6;
sbit t14=P2^7;
void main()
{
t9=t10=t11=t12=t13=t14=0;
t0=1; t1=1;t2=1;t3=1;//t3=t2=t1=t0=1;
for(; ;)
{
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
2
2
3
3
3
3
2
2
3
3
3
3
2
2
3
3
3
3
2
2
3
3
3
3
2
2
2
1
l1: if(t0==0)
{
t4=1;
t5=t6=t7=t8=0;
goto l1;
}
l2:if(t1==0)
{
t5=1;
t4=t6=t7=t8=0;
goto l2;
}
l3:if(t2==0)
{
t6=1;
t4=t5=t7=t8=0;
goto l3;
}
l4:if(t3==0)
{
t7=1;
t4=t5=t6=t8=0;
goto l4;
}
t8=1;
t4=t5=t6=t7=0;
}
}
119
; SOURCE LINE # 21
0000
0002
0004
0006
0008
000A
C2A7
C2A6
C2A5
C297
C296
C295
CLR
CLR
CLR
CLR
CLR
CLR
D290
D291
D292
D293
SETB
SETB
SETB
SETB
20900C
l1:
JB
t0,l2
; SOURCE LINE # 26
; SOURCE LINE # 27
0017
D2A0
SETB
t4
0019
001B
001D
001F
C2A4
C2A3
C2A2
C2A1
CLR
CLR
CLR
CLR
t8
t7
t6
t5
SETB
t6
0037
0039
003B
003D
C2A4
C2A3
C2A1
C2A0
CLR
CLR
CLR
CLR
t8
t7
t5
t4
003F
80F1
SJMP
l3
; SOURCE LINE # 42
; SOURCE LINE # 43
t0
t1
t2
t3
; SOURCE LINE # 23
; SOURCE LINE # 24
; SOURCE LINE # 25
0014
0014
D2A2
; SOURCE LINE # 41
; SOURCE LINE # 22
000C
000E
0010
0012
0035
; SOURCE LINE # 40
t14
t13
t12
t11
t10
t9
0041
0041
20930C
l4:
JB
0044
D2A3
SETB
0046
0048
004A
004C
C2A4
C2A2
C2A1
C2A0
CLR
CLR
CLR
CLR
004E
80F1
SJMP
SOURCE LINE # 28
0021
0023
0023
80F1
20910C
SJMP
l2:
JB
0050
; SOURCE LINE # 49
; SOURCE LINE # 29
0050
D2A4
SETB
t8
; SOURCE LINE # 30
; SOURCE LINE # 31
0052
0054
0056
0058
C2A3
C2A2
C2A1
C2A0
CLR
CLR
CLR
CLR
t7
t6
t5
t4
005A
80B8
SJMP
l1
; SOURCE LINE # 50
t1,l3
; SOURCE LINE # 32
; SOURCE LINE # 33
SETB
t5
; SOURCE LINE # 34
D2A1
0028
002A
002C
002E
C2A4
C2A3
C2A2
C2A0
CLR
CLR
CLR
CLR
t8
t7
t6
t4
0030
80F1
SJMP
l2
; SOURCE LINE # 35
; SOURCE LINE # 36
; SOURCE LINE # 37
20920C
l3:
JB
; SOURCE LINE # 51
; FUNCTION main (END)
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE
=
92
---CONSTANT SIZE
=
------XDATA SIZE =
------PDATA SIZE =
------DATA SIZE
=
------IDATA SIZE
=
------BIT SIZE
=
------END OF MODULE INFORMATION.
t2,l4
; SOURCE LINE # 38
; SOURCE LINE # 39
120
?C0010:
l1
0026
0032
0032
t3,?C0010
; SOURCE LINE # 44
; SOURCE LINE # 45
t7
; SOURCE LINE # 46
t8
t6
t5
t4
; SOURCE LINE # 47
l4
; SOURCE LINE # 48