41
1 REMOTE CONTROLLING OF HOME APPLIANCES A PROJECT REPORT Submitted by LIBIN THOMAS LINU POULOSE LISHA ANNA DANIEL in partial fulfillment for the award of the degree of BACHELOR OF ENGINEERING in ELECTRONICS AND COMMUNICATION ENGINEERING SREE NARAYANA GURUKULAM COLLEGE OF ENGINEERING, KADAYIRUPPU MG UNIVERSITY: KOTTAYAM MAY 2011

Remote Controlling of Appliances

Embed Size (px)

DESCRIPTION

dasd ad asdasd dagfdfg dfgdf gfr gfdf dsfdsf efdsf sdfdsf sfsd ds sdfdsfds f sdf sfsdsf dsfds fsd sdfdsf sfdsf sdfs f s sfsdf s

Citation preview

Page 1: Remote Controlling of Appliances

1

REMOTE CONTROLLING OF HOME APPLIANCES

A PROJECT REPORT

Submitted by

LIBIN THOMAS

LINU POULOSE

LISHA ANNA DANIEL

in partial fulfillment for the award of the degree

of

BACHELOR OF ENGINEERING

in

ELECTRONICS AND COMMUNICATION ENGINEERING

SREE NARAYANA GURUKULAM COLLEGE OF ENGINEERING,

KADAYIRUPPU

MG UNIVERSITY: KOTTAYAM

MAY 2011

Page 2: Remote Controlling of Appliances

2

Department of Electronics and communication Engineering

MG UNIVERSITY: KOTTAYAM

BONAFIDE CERTIFICATE

Certified that this project report “REMOTE CONTROLLING OF HOME

APPLIANCES” is the bonafide work of “LIBIN THOMAS, LINU POULOSE

and LISHA ANNA DANIEL” who carried out the project work under my

supervision.

SIGNATURE SIGNATURE

PROF. ARUMUGA SAMY Mr. DEEPAK.P

HEAD OF THE DEPARTMENT STAFF IN CHARGE

ELECTRONICS AND COMMUNICATION ENGINEERING ASST. PROFESSOR

SREE NARAYANA GURUKULAM COLLEGE OF ENGINEERING DEPARTMENT OF ECE

KADAYIRUPPU

KOLENCHERY

Page 3: Remote Controlling of Appliances

3

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.

Page 4: Remote Controlling of Appliances

4

ABSTRACT

The main aim of conducting this project is to control a maximum of eight

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

remote with different switches. In this circuit, we interfaced 8 devices. These

devices are switched using remote keypad -1 to 8. AT89C2051 microcontroller is

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

current) buffer is used to drive relays. A working system will ultimately be

demonstrated to validate the design.

Page 5: Remote Controlling of Appliances

5

TABLE OF CONTENTS

CHAPTER NO. TITLE PAGENO.

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

Page 6: Remote Controlling of Appliances

6

12 ADVANTAGES 38

13 FUTURE MODIFICATIONS 38

14 CONCLUSION 39

15 REFERENCE 40

16 APPENDICES 41

Page 7: Remote Controlling of Appliances

7

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

Page 8: Remote Controlling of Appliances

8

1. INTRODUCTION

Infrared (IR) light is an electromagnetic radiation with a wavelength longer

than that of visible light, measured from the nominal edge of visible red light at 0.7

micrometers, and extending conventionally to 300 micrometers. These radiations

with a frequency below our eyes sensitivity cannot be seen, but can only be felt by

our skin temperature sensors. Infra-Red is interesting, because it is easily generated

and doesn't suffer electromagnetic interference and so it is widely used in

communication and control circuits. The adventure of using lots of infra-red in

TV/VCR remote controls helped engineers to work on innovative projects like

controlling home appliances using TV remotes etc.

A TV remote that follows RC5 Protocol is used here. Receiver in the circuit

receives pulsed IR rays from the remote and sends them to a microcontroller that

plays the role of a decoder. Decoded signal is thus received by relay driver IC’s

whose output activates the corresponding home appliance. Thus this circuit can

control the ON/OFF process of eight appliances.

One of the major advantages of this circuit is to control any appliances by

just being in our living room. A major disadvantage is that obstacles on the path of

IR rays can block its remote sensing capabilities.

Page 9: Remote Controlling of Appliances

9

2. BLOCK DIAGRAM

Fig 1: BLOCK DIAGRAM

Page 10: Remote Controlling of Appliances

10

3. BLOCK DIAGRAM EXPLANATION

As seen in the block diagram, our circuit consists of an IR transmitter, an IR

receiver, decoder, relay driver IC and relays.

3.1 IR TRANSMITTER

The IR transmitter used in the circuit is a TV remote. As mentioned earlier a

remote that follows RC5 Protocol is being used in this circuit. A Phillip’s

TV remote is a best example for such remotes. As per this, IR signals from

the remote are modulated by a carrier frequency of 36 kHz. This is because

there are many other IR sources like sun, light bulbs, fire etc. In order to

exclude other sources, IR signal is modulated.

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

Page 11: Remote Controlling of Appliances

11

will be sensed and decoded using this microcontroller. Thus it helps to

determine which device is being operated by the user.

3.4 RELAY DRIVER IC

As we all know ULN2803 is used as the relay driver IC. It consists of octal

high voltage, high current Darlington transistor arrays. The eight NPN

Darlington connected transistors in this family of arrays are ideally suited for

interfacing between low logic level digital circuitry (such as TTL, CMOS or

PMOS/NMOS) and the higher current/voltage requirements of lamps, relays,

printer hammers or other similar loads for a broad range of computer,

industrial, and consumer applications.

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.

Page 12: Remote Controlling of Appliances

12

4. CIRCUIT DIAGRAM

Fig 2: CIRCUIT DIAGRAM

Page 13: Remote Controlling of Appliances

13

Fig 3: POWER SUPPLY DIAGRAM

Fig 4: RELAY CONNECTION FOR EACH APPLIANCE

Page 14: Remote Controlling of Appliances

14

5. WORKING

Our project as mentioned earlier is aimed at controlling 8 home appliances

using a Philip’s TV remote or any remote supporting RC5 Protocol. It controls the

on/off process of the appliances interfaced to this circuit. The devices are operated

using the keypads 1-8. It performs the function of an IR transmitter which sends

pulsed IR rays after modulating the original signal with a carrier of 36 kHz

frequency. These signals are received by TSOP 1736 which is our IR receiver.

These are designed to receive signals of only 36 kHz. It senses the received output

and demodulates them. Therefore original signals are retrieved after demodulation.

The output from the receiver is then sent to the microcontroller

AT89C2051. It is programmed so as to decode the RC5 Protocol. It decodes the

signals from TSOP1736 and thereby it recognizes the device to be functioned. The

inputs and outputs are thus controlled.

The decoded output from the microcontroller is obtained by the relay

driver IC ULN2803. It consists of eight NPN Darlington connected transistors

(often called a Darlington pair). Here the signals from AT89C2051 are given to the

base of the corresponding transistor in the Darlington array. 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.

A total of eight relays are connected to the output pins of ULN2803.

When the relay gets excited from the outputs appearing at the driver IC pins, it gets

activated. Thus the coil gets energized and the COM gets connected to the N/O

contact and the AC mains circuit gets completed and the appliance starts working.

Page 15: Remote Controlling of Appliances

15

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.

Fig 5: RC5 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

Page 16: Remote Controlling of Appliances

16

carrier frequency was chosen to render the system immune to interference from TV

scan lines.

The command comprises 14 bits:

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.

Page 17: Remote Controlling of Appliances

17

5.2 IR RECEIVER (TSOP1736)

The TSOP1736 are miniaturized receivers for infrared remote control

systems. PIN diode and preamplifier are assembled on lead frame, the epoxy

package is designed as IR filter. The demodulated output signal can directly be

decoded by a microprocessor. TSOP1736 is the standard IR remote control

receiver series, supporting all major transmission codes.

Fig 6: TSOP1736

The main features of these receivers are:

Photo detector and preamplifier in one package

Internal filter for PCM frequency

Improved shielding against electrical field disturbance

TTL and CMOS compatibility

Output active low

Low power consumption

High immunity against ambient light

Continuous data transmission possible(up to 2400 bps)

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

Page 18: Remote Controlling of Appliances

18

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.

Page 19: Remote Controlling of Appliances

19

5.3 MICROCONTROLLER (AT89C2051)

The AT89C2051 is a low-voltage, high-performance CMOS 8-bit

microcomputer with2 Kbytes of Flash programmable and erasable read only

memory (PEROM). The device is manufactured using Atmel’s high density

nonvolatile memory technology and is compatible with the industry standard

MCS-51Ô instruction set and pin out. By combining a versatile 8-bit CPU with

Flash on a monolithic chip, the AtmelAT89C2051 is a powerful microcomputer

which provides a highly flexible and cost-effective solution to many embedded

control applications.

The AT89C2051 provides the following standard features: 2 Kbytes of

Flash, 128bytes of RAM, 15 I/O lines, two 16-bit timer/counters, five vector two-

level interrupt architecture, a full duplex serial port, a precision analog comparator,

on-chip oscillator and clock circuitry. In addition, the AT89C2051 is designed with

static logic for operation down to zero frequency and supports two software

selectable power saving modes. The Idle Mode stops the CPU while allowing the

RAM, timer/counters, serial port and interrupt system to continue functioning. The

Power Down Mode saves the RAM contents but freezes the oscillator disabling all

other chip functions until the next hardware reset.

Fig 7: PIN DIAGRAM

Page 20: Remote Controlling of Appliances

20

5.3.1 FEATURES

• Compatible with MCS®-51Products

• 2K Bytes of Reprogrammable Flash Memory – Endurance: 10,000 Write/Erase

Cycles

• 2.7V to 6V Operating Range

• Fully Static Operation: 0 Hz to 24 MHz

• Two-level Program Memory Lock

• 128 x 8-bit Internal RAM

• 15 Programmable I/O Lines

• Two 16-bit Timer/Counters

• Six Interrupt Sources

• Programmable Serial UART Channel

• Direct LED Drive Outputs

• On-chip Analog Comparator

• Low-power Idle and Power-down Modes

• Green (Pb/Halide-free) Packaging Option

Page 21: Remote Controlling of Appliances

21

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).

Here we connect the IR receiver output to any input port pin or

interrupt pin of the microcontroller, and keep polling it or prepare the interrupt

routine to trigger the reading of signals after the first low level is sensed.

When we press a key at the remote, it transmits the train of pulses,

and the microcontroller will receive bit 1 first. It will be sensed right after the

middle of the bit when it changes from high to low level which means bit "1". This

is the first time that the microcontroller will "see" the incoming IR signal.

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.

Fig8:DECODING WITH MICROCONTROLLER

Page 22: Remote Controlling of Appliances

22

Now it starts to read the next 11 bits spaced 1.728ms each. The first 5

bits are Address and the next 6 bits are Command. Thus these bits are properly

decoded and the output is produced.

The general working of the RC5 Protocol decoding program

(working based on program) under which our microcontroller is working is as

follows:

First the ports to be used in the microcontroller are initialized through

the program. The output of the IR receiver is connected to the port 3.3 or the

interrupt pin of AT89C2051. Thus this pin is the input. Ports 1.1 to 1.7 serve as the

output pins. Initially at the start of the program all the relays are switched off. Now

the controller waits for the first bit to be received. As the first two bits are not of

concern a time delay of 3.024ms is provided and then the flip bit or the toggle bit is

recognized. Then the five address bits followed by the six command bits are

decoded. Then the microcontroller checks which key is pressed. This is done in

such a way that the controller checks if the bit is in a high state or low state. If the

bit is in high state it is changed to low state and vice versa. That is if a device is

ON it is turned OFF or vice versa. If the power key of the remote is pressed then

all the bits are made low. This means, if that key is pressed all the devices are

turned off at one shot.

Page 23: Remote Controlling of Appliances

23

5.4 RELAY DRIVER IC (ULN2803)

IC ULN2803 consists of octal high voltage, high current Darlington

transistor arrays. The eight NPN Darlington connected transistors in this family of

arrays are ideally suited for interfacing between low logic level digital circuitry

(such as TTL, CMOS or PMOS/NMOS) and the higher current/voltage

requirements of lamps, relays, printer hammers or other similar loads for a broad

range of computer, industrial, and consumer applications. The main features of

ULN2803 are:

Eight Darlington’s with Common Emitter.

Open–collector outputs.

Freewheeling clamp diodes for transient suppression.

Output Current to 500 mA.

Output Voltage to 50 V.

Inputs pinned opposite outputs to simplify board layout.

Fig 9: PIN DIAGRAM OF ULN2803

Page 24: Remote Controlling of Appliances

24

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.

Fig 10: DARLINGTON PAIR

Now 2 cases arise:-

Case 1: When IN is 0 volts.

Q1 and Q2 both will not conduct as there is no base current provided to

them. Thus, nothing will appear at the output (OUT).

Case 2: When IN is 5 volts.

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

Page 25: Remote Controlling of Appliances

25

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.

The interfacing between relay driver IC and relay is shown in figure 11

below:

Page 26: Remote Controlling of Appliances

26

5.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. For

example a low voltage battery circuit can use a relay to switch a 230V AC

mains circuit. There is no electrical connection inside the relay between the

two circuits, the link is magnetic and mechanical.

Fig 12: RELAY

In the above figure, when controlling switch is closed, current

flows through the coil and thus, magnetic field is produced. The resulting

magnetic field attracts an armature that is mechanically linked to a set of

contacts. The movement makes a connection with a fixed contact and circuit

gets completed. When the current to the coil is switched off, the armature is

returned by a force approximately half as strong as the magnetic force to its

relaxed position and the connection is broken.

The relay's switch connections are usually labeled COM, N/C

and N/O as shown in figure 11 above:

COM = Common, always connect to this; it is the moving part of the

switch.

Page 27: Remote Controlling of Appliances

27

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.

Page 28: Remote Controlling of Appliances

28

6. POWER SUPPLY CIRCUIT

As in figure 3, this circuit is an approach to obtain both 12V and

5V DC power supply. The circuit uses two ICs 7812(IC1) and 7805 (IC2) for

obtaining the required voltages. The AC mains voltage will be stepped down by

the transformer T1, rectified by bridge B1 and filtered by capacitor C1 to obtain a

steady DC level .The IC1 regulates this voltage to obtain a steady 12V DC. The

output of the IC1 will be regulated by the IC2 to obtain a steady 5V DC at its

output. In this way both 12V and 5V DC are obtained. Such a circuit is very useful

in cases when we need two DC voltages for the operation of a 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

Page 29: Remote Controlling of Appliances

29

7. ALGORITHM OF THE PROGRAM TO DECODE RC5

PROTOCOL

The algorithm of the system can be listed as follows:

1. Initialize the registers of the microcontroller.

2. IR receiver to port 3.3

3. Wait for first bit to receive.

4. Providing 3.024ms delay to skip first 2 bits.

5. Read the flip bit.

6. Count for address

7. Provide 1.728ms delay for each bit

8. Save the address to the ADDR register

9. Count for command

10. Provide 1.728ms delay for each bit

11. Check which key is pressed.

12. Check the bit is in high / low state

13. If the bit is low set it to high

14. If the bit is high set to low

15. If the key pressed is POWER then set all bits to low state.

Page 30: Remote Controlling of Appliances

30

8. PROGRAM

VAR1 equ r7 ;Temporary Variable

TEMP equ 10H ;Temp variable

COUNT equ 11H ;Count

ADDR equ 12H ;Device address

CMD equ 13H ;Command

FLIP bit 00H ;Flip bit

TOG bit 01H ;Temp bit for flip

IR equ P3.3 ;IR Receiver connected to this pin

SW1 equ P1.0 ;Switch 1 connected here

SW2 equ P1.1 ;Switch 2 connected here

SW3 equ P1.2 ;Switch 3 connected here

SW4 equ P1.3 ;Switch 4 connected here

SW5 equ P1.4 ;Switch 5 connected here

SW6 equ P1.5 ;Switch 6 connected here

SW7 equ P1.6 ;Switch 7 connected here

SW8 equ P1.7 ;Switch 8 connected here

SWport equ P1 ;Port at which switches are connected

org 00H ;Start of prog

mov SWport,#00H ;switch all relays off!

mov sp,#50H ;Stack pointer initialization

clr TOG ;Clear temp bit

main:

jb IR,$ ;Wait for first bit

mov VAR1,#255 ;3.024mS delay

Page 31: Remote Controlling of Appliances

31

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

Page 32: Remote Controlling of Appliances

32

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

Page 33: Remote Controlling of Appliances

33

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:

Page 34: Remote Controlling of Appliances

34

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

Page 35: Remote Controlling of Appliances

35

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

Page 36: Remote Controlling of Appliances

36

9. PCB FABRICATION TECHNIQUE

The first step of assembling is to produce a printed circuit board. The

fabrication of the program counter plays a crucial role in the electronic field. The

success of the circuit is also dependent on the PCB. As far as the cost is concerned,

more than 25% of the total cost is for the PCB design and fabrication. The board is designed using a personal computer. The layout is drawn using

the software “Adobe PageMaker 6.5”. The layout is printed in a “buffer sheet”

using a laser procedure. First, a negative screen of the layout is prepared with the

help of a professional screen printer. Then the copper clad sheet is kept under this

screen. The screen printing ink is poured on the screen and brushed through the top

of the screen. The printed board is kept under shade for few hours till the ink

becomes dry.

The etching medium is prepared with the un-hydrous ferric chloride water.

The printed board is kept in this solution till the exposed copper dissolves in the

solution fully. After that the board is taken out and rinsed in flowing water under a

tap. The ink is removed with solder in order to prevent oxidation.

Another screen, which contains component side layout, is prepared and the

same is printed on the component side of the board. A paper epoxy laminate is

used as the board. Both the component and the track layout of the peripheral PCB

is given at the end of this report.

Page 37: Remote Controlling of Appliances

37

10. PCB LAYOUT

Fig 15:PCB LAYOUT

Page 38: Remote Controlling of Appliances

38

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

• Time saving as it is operated by a remote.

• Controlling all devices from one place.

• More secure as there is no direct contact with the appliance.

13. FUTURE MODIFICATIONS

The circuit can be modified to control all functions of a particular device

like the TV remote controlling all processes of a television. Also the program can

be altered to control the ON/OFF processes of more than eight appliances.

Page 39: Remote Controlling of Appliances

39

14.CONCLUSION

Hereby we come to an end of or project “remote controlling of home

appliances”. This project gives us an idea of RC5 Protocol and the microcontroller

AT89C2051. This project can be used anywhere either at home or offices. This is

also cost efficient. Thus by this attempt of ours the ON/OFF processes of many

devices was successfully carried out by just using a TV remote.

Page 40: Remote Controlling of Appliances

40

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

3] The 8051 microcontroller - Kenneth J. Ayala

Page 41: Remote Controlling of Appliances

41

16. APPENDICES