Professional Documents
Culture Documents
Selected (A) For Home Appliances
Selected (A) For Home Appliances
A PROJECT REPORT
Submitted by
LIBIN THOMAS
LINU POULOSE
of
BACHELOR OF ENGINEERING
in
MG UNIVERSITY: KOTTAYAM
MAY 2011
1
Department of Electronics and communication Engineering
MG UNIVERSITY: KOTTAYAM
BONAFIDE CERTIFICATE
and LISHA ANNA DANIEL” who carried out the project work under my
supervision.
SIGNATURE SIGNATURE
2
ACKNOWLEDGEMENT
Dedicating this project to the God Almighty whose abundant grace and
mercies enabled its successful completion, we would like to express our profound
gratitude to all the people who had inspired and motivated us to make this project a
success.
We here by express our sincere thanks to our Principal Dr. C. E Krishnan
for providing us ample facilities in our college to work on this project. We are also
extremely thankful to Prof. Arumuga Samy, Head of ECE Department who gave
us all help and directions which were very helpful in the successful completion of
our mini project. We are very thankful to him for providing the necessary
laboratory facilities.
We also wish to express our gratitude to Mr. Deepak P, Mr. Vishnu and
Mr. Noble C Kurian for their valuable guidance and suggestions in the whole
course of our project activities.
Last but not the least we thank all our staffs of ECE Department and our
friends for their sincere co-operation with us for the completion of our project.
3
ABSTRACT
electrical appliances by just using a TV remote. Normal IR circuits can switch only
one device. But using this circuit, different devices can be controlled using same
used to control the inputs and outputs. TSOP 1736 (infrared receiver) is used to
receive the infrared signals from TV Remote. ULN2803 (High voltage, high
4
TABLE OF CONTENTS
ABSTRACT 4
LIST OF FIGURES 7
1 INTRODUCTION 8
2 BLOCK DIAGRAM 9
3 BLOCK DIAGRAM EXPLANATION 10
3.1 IR TRANSMITTER 10
3.2 IR RECEIVER 10
3.3 IR DECODER 10
3.4 RELAY DRIVER IC 11
3.5 RELAYS 11
4 CIRCUIT DIAGRAM 12
5 WORKING 14
5.1 RC5 PROTOCOL 15
5.2 IR RECEIVER(TSOP1736) 17
5.3 MICROCONTROLLER(AT89C2051) 19
5.3.1 FEATURES 20
5.3.2 DECODING WITH AT89C2051 21
5.4 RELAY DRIVER IC(ULN2803) 23
5.4.1 WORKING 24
5.5 RELAYS 26
6 POWER SUPPLY CIRCUIT 28
7 ALGORITHM OF THE PROGRAM TO
DECODE RC5 PROTOCOL 29
8 PROGRAM 30
9 PCB FABRICATION TECHNIQUE 36
10 PCB LAYOUT 37
11 APPLICATIONS 38
5
12 ADVANTAGES 38
13 FUTURE MODIFICATIONS 38
14 CONCLUSION 39
15 REFERENCE 40
16 APPENDICES 41
6
LIST OF FIGURES
1. BLOCK DIAGRAM
2. CIRCUIT DIAGRAM
3. POWER SUPPLY DIAGRAM
4. RELAY CONNECTION FOR EACH APPLIANCE
5. RC5 PROTOCOL
6. TSOP1736
7. PIN DIAGRAM OF AT89C2051
8. DECODING WITH MICROCONTROLLER
9. PIN DIAGRAM OF ULN2803
10. DARLINGTON PAIR
11. INTERFACING BETWEEN ULN2803 AND RELAY
12. RELAY
13. 7812 IC
14. 7805 IC
15. PCB LAYOUT
7
1. INTRODUCTION
8
2. BLOCK DIAGRAM
9
3. BLOCK DIAGRAM EXPLANATION
3.2 IR RECEIVER
The IR receiver in the circuit is TSOP 1736. These are capable of receiving
pulsed IR rays of 36 kHz only and can receive no other frequencies. It
receives the signals from the transmitter and retrieves the original
modulating signal from the 36 kHz carrier. The front end of this module has
a PIN photodiode and the input signal from the remote is passed into an
Automatic Gain Control (AGC) stage from which the signal passes into a
Band pass filter and finally into a demodulator. The demodulated output
drives an NPN transistor. The collector of this transistor forms the output of
the module.
3.3 IR DECODER
The microcontroller AT89C2051 is used as the IR decoder in the circuit. It
is flashed with a program that decodes the RC5 Protocol. It is designed to
control the inputs and outputs. The demodulated output from the receiver
10
will be sensed and decoded using this microcontroller. Thus it helps to
determine which device is being operated by the user.
3.5 RELAYS
A relay is an electrically operated switch. It allows one circuit to switch a
second circuit which is completely separated from the first. The output from
the driver IC is send to the corresponding relays which thus results in its
excitation and gets activated. As a result it controls the corresponding home
appliance.
11
4. CIRCUIT DIAGRAM
12
Fig 3: POWER SUPPLY DIAGRAM
13
5. WORKING
14
5.1 RC5 PROTOCOL
The RC-5 protocol was developed by Philips in the late 1980s as a semi-
proprietary consumer IR (infrared) remote control communication protocol for
consumer electronics. However, it was also adopted by most European
manufacturers, as well as many US manufacturers of special audio and video
equipment. The advantage of the RC-5 protocol is that (when properly followed)
any CD handset (for example) may be used to control any brand of CD player
using the RC-5 protocol.
The basics of the protocol are well known. The handset contains a keypad
and a transmitter integrated circuit (IC) driving an IR LED. The command data is a
Manchester coded bit stream modulating a 36 kHz carrier. (Often the carrier used
is 38 kHz or 40 kHz, apparently due to misinformation about the actual protocol.)
The IR signal from the transmitter is detected by a specialized IC with an integral
photo-diode, and is amplified, filtered, and demodulated so that the receiving
device can act upon the received command. RC-5 only provides a one-way link,
with information traveling from the handset to the receiving unit. The 36 kHz
15
carrier frequency was chosen to render the system immune to interference from TV
scan lines.
2 start bits for the automatic gain control in the infrared receiver.
1 toggle bit (change every time when a new button is pressed on the IR
transmitter)
5 address bits for the system address
6 instruction bits for the pressed key
As mentioned before the RC5 code uses the biphase modulation technique
which means that every bit consists of 2 parts which are never the same. So a bit is
always a high/low or a low/high transition. By the RC5 code a 1 is a low high
transition and a 0 is high low transition. For all the bits the most significant bit is
transmitted first. Remember also that the output signal of the integrated receivers is
inverted. Detecting an IR signal the output of the integrated receiver will be 0V.
The duration time of each bit is equal to 1.778 ms, and the total time of a full RC5
code is 24.778 ms. The code word is repeated every 113.778 ms as long as a key
remains pressed. To improve noise rejection the pulses are modulated at a carrier
frequency. The carrier frequency of the RC5 code is 36 kHz so take always a
receiver with a response frequency of 36 kHz.
16
5.2 IR RECEIVER (TSOP1736)
Fig 6: TSOP1736
The main features of these receivers are:
The circuit of the TSOP1736 is designed in that way that unexpected output
pulses due to noise or disturbance signals are avoided. A band pass filter, an
17
integrator stage and an automatic gain control are used to suppress such
disturbances.
The distinguishing mark between data signal and disturbance signal are
carrier frequency, burst length and duty cycle. The data signal should fulfill the
following condition:
• Carrier frequency should be close to center frequency of the band pass (eg
36kHz).
• Burst length should be 10 cycles/burst or longer.
• After each burst which is between 10 cycles and 70cycles a gap time of at least
14 cycles is necessary.
• For each burst which is longer than 1.8ms a corresponding gap time is necessary
at some time in the data stream. This gap time should have at least same length as
the burst.
• Up to 1400 short bursts per second can be received continuously.
Some examples for suitable data format are: NEC Code, Toshiba Micom
Format, Sharp Code, RC5Code, RC6 Code, R–2000 Code and Sony Format
(SIRCS).
When a disturbance signal is applied to the TSOP1736 it can still receive the
data signal. However the sensitivity is reduced to that level that no unexpected
pulses will occur.
Some examples for such disturbance signals which are suppressed by the
TSOP1736 are:
• DC light (e.g. from tungsten bulb or sunlight)
• Continuous signal at 36 kHz or at any other frequency.
• Signals from fluorescent lamps with electronic ballast.
18
5.3 MICROCONTROLLER (AT89C2051)
19
5.3.1 FEATURES
20
5.3.2 DECODING WITH AT89C2051
IR demodulators have inverted logic at its output, that is when a
burst of IR is sensed it drives its output to low level, meaning logic level = 1. Thus
low level means bit ON. During inactivity (no Infrared present) the output of the
Infrared receiver is UP (bit zero).
There is no need to decode those first two bits. The toggle bit
allows the receiving device to distinguish between two successive button presses.
Then it starts to receive the ADDRESS bits. For that we need to be exactly at the
middle of the right level of the first ADDRESS bit to be read (non inverted level)
as shown in figure below.
22
5.4 RELAY DRIVER IC (ULN2803)
23
5.4.1 WORKING
The ULN 2803 IC consists of eight NPN Darlington connected
transistors (often called a Darlington pair). Darlington pair consists of two
bipolar transistors such that the current amplified by the first is amplified
further by the second to get a high current gain β or hfe. The figure shown
below is one of the eight Darlington pairs of ULN 2803 IC.
Input current will increase and both transistors Q1 and Q2 will begin to
conduct. Now, input current of Q2 is combination of input current and
24
emitter current of Q1, so Q2 will conduct more than Q1 resulting in higher
current gain which is very much required to meet the higher current
requirements of devices like motors, relays etc. Output current flows through
Q2 providing a path (sink) to ground for the external circuit that the output is
applied to. Thus, when a 5V input is applied to any of the input pins (1 to 8),
output voltage at corresponding output pin (11 to 18) drops down to zero
providing GND for the external circuit. Thus, the external circuit gets
grounded at one end while it is provided +Vcc at its other end. So, the circuit
gets completed and starts operating.
25
5.5 RELAYS
26
N/C = Normally Closed, COM is connected to this when the relay coil
is off.
N/O = Normally Open, COM is connected to this when the relay coil
is on.
Connect to COM and N/O if you want the switched circuit to be on
when the relay coil is on.
Connect to COM and N/C if you want the switched circuit to be on
when the relay coil is off.
27
6. POWER SUPPLY CIRCUIT
7812 IC
7812 is a famous IC which is being widely used in 12V voltage regulator
circuits.
Fig 13:7812 IC
7805 IC
7805 is a famous IC which is being widely used in 5V voltage regulator
circuits.
Fig 14:7805 IC
28
7. ALGORITHM OF THE PROGRAM TO DECODE RC5
PROTOCOL
29
8. PROGRAM
30
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#100
djnz VAR1,$
mov c,IR ;Read Flip bit
mov FLIP,c
clr A
mov COUNT,#5 ;Count for address
fadd:
mov VAR1,#255 ;1.728mS delay for each bit
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#4
djnz VAR1,$
mov c,IR
rlc a
djnz COUNT,fadd
31
mov ADDR,A ;Save the address
clr a
mov COUNT,#6 ;Count for Command
fcmd:
mov VAR1,#255 ;1.728mS Delay for each bit
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#4
djnz VAR1,$
mov c,IR
rlc a
djnz COUNT,fcmd
mov TEMP,CMD ;Save the old command
mov CMD,a ;Save the new command
mov a,ADDR ;Check for valid address
cjne a,#00,nvalid
mov a,TEMP
cjne a,CMD,valid ;Check for valid command
nvalid:
ljmp main
valid: ;Key press check
clr a
mov c,FLIP
rlc a
32
mov TEMP,a
clr a
mov c,TOG
rlc a
cjne a,TEMP,valid1
sjmp nvalid
valid1:
mov c,FLIP
mov TOG,c
mov a,CMD
clr c
cjne a,#1,skip1 ;Check for SW1
jb SW1,isset1
setb SW1
ljmp main
isset1:
clr SW1
ljmp main
skip1:
cjne a,#2,skip2 ;Check for SW2
jb SW2,isset2
setb SW2
ljmp main
isset2:
clr SW2
ljmp main
skip2:
33
cjne a,#3,skip3 ;Check for SW3
jb SW3,isset3
setb SW3
ljmp main
isset3:
clr SW3
ljmp main
skip3:
cjne a,#4,skip4 ;Check for SW4
jb SW4,isset4
setb SW4
ljmp main
isset4:
clr SW4
ljmp main
skip4:
cjne a,#5,skip5 ;Check for SW5
jb SW5,isset5
setb SW5
ljmp main
isset5:
clr SW5
ljmp main
skip5:
cjne a,#6,skip6 ;Check for SW6
jb SW6,isset6
setb SW6
34
ljmp main
isset6:
clr SW6
ljmp main
skip6:
cjne a,#7,skip7 ;Check for SW7
jb SW7,isset7
setb SW7
ljmp main
isset7:
clr SW7
ljmp main
skip7:
cjne a,#8,skip8 ;Check for SW8
jb SW8,isset8
setb SW8
ljmp main
isset8:
clr SW8
ljmp main
skip8:
cjne a,#0CH,exit ;Check for all switches
mov SWport,#00H
ljmp main
exit:
ljmp main
END ; End of program
35
9. PCB FABRICATION TECHNIQUE
36
10. PCB LAYOUT
37
11. APPLICATIONS
The main application of this circuit is that we can control any appliance by just
being in our living room. This is very much helpful for elderly people as well as
for those who are unable to walk either due to physical disabilities or due to
accidents. This circuit enables us to control appliances in the top floor also.
Another major use of our project is that we can turn off the operating devices all
together at one shot by just pressing the power button.
12. ADVANTAGES
38
14.CONCLUSION
39
15. REFERENCE
1]http://arif-ece.blogspot.com/2010/05/circuit-for-controlling-8-appliances.html
2]http://www.8051projects.net/out.php?link=http://www.ustr.net/infrared/infrar
ed1.shtml
40
16. APPENDICES
41