This project report describes an infrared remote control system to switch electrical devices on and off. The system uses an AT89C2051 microcontroller to receive infrared signals from a remote control via an infrared receiver. The microcontroller then controls up to six electrical devices using ULN2003 transistors. The system has a range of up to 10 meters and works using the Phillips RC5 infrared communication protocol. It was developed by four electrical engineering students at Assam Engineering College as their final year project.
OBSTACLE AVOIDACE ROBOT USING ARDUINO UNO AND ULTRASONIC SENSOR
Infrared Remote Control Project Report
1. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
Project Report
On
INFRARED REMOTE
CONTROL ON/OFF SWITCH
Submitted in partial fulfillment of the requirements for the award
of the degree of Bachelor of Engineering in Electrical Engineering
of Guwahati University
Session 2010
by
Anirban Lahon (07/169)
Farooq Imran Khan(07/123)
Indranuj Khound(07/143)
Pallab Das(07/151)
Under the guidance of
DR. AROOP BARDALAI
Assistant professor
Department of Electrical Engineering
Assam Engineering College
Department of Electrical & Instrumentation Engineering
Assam Engineering College, Jalukbari, Guwahati- 781013
2. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
ABSTRACT
This Project INFRARED REMOTE CONTROL ON/OFF SWITCH is used to switch on/off the
Home Appliances by using a standard Remote control. The system is used to switch on/off upto
six electrical devices. All the above processes are controlled by the 8 bit Microcontroller
AT89C2051. The system works on Phillips RC5 format.
3. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
Certificate from the Supervisor
This is to certify that the project entitled “INFRARED REMOTE CONTROL ON/OFF
SWITCH” has been carried out and presented by
1.Anirban Lahon (07/169)
2.Farooq Imran Khan(07/123)
3.Indranuj Khound(07/143)
4.Pallab Das(07/151)
Students of B.E. 7th Semeste (Electrical Engineering), Assam Engineering College, under my
supervision and guidance in a manner satisfactory to warrant its acceptance as prerequisite for
the award of Bachelor of Engineering in Electrical Engineering of the Gauhati University.
Further the report has not been submitted/ reproduced in any form for the award of any other
degree/ diploma.
Date: Dr. AROOP BARDALAI
Deptt. Of Electrical & Instrumentaion Enginnering
Place: Guwahati Assam Engineering College
Guwahati-781013
4. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
Certificate from the Head of the Department
This is to certify that the project report enitled “ INFRARED REMOTE CONTROL ON/OFF
SWITCH” has been submitted by the following BE 7th semester students.
1.Anirban Lahon (07/169)
2.Farooq Imran Khan(07/123)
3.Indranuj Khound(07/143)
4.Pallab Das(07/151)
in the partial fulfillment of the requirements for the award of the degree of Bachelor of
Engineering in Electrical Engineering of Gauhati University.
Date: (Dr. Damodar Agarwal)
Head of the Department,
Place: Guwahati Deptt. Of Electrical& Instrumentaion Engineering
Assam Engineering College
Guwahati-781013
5. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
Acknowledgement
We are thankful to Dr. Aroop Bardalai and our respected Head of the Department Dr. Damodar
Agarwal who have given me a great opportunity and guided me to complete this project.
We have taken help from the internet from where I got important data and information.I have
also got hold of some information from a mazagine. I have enjoyed and learnt a lot during the
completion of this project.
We also envince thanks to Prof., Dr.Durlav Hazarika and Asstt.Prof., Dr. Dipankar Chanda for
their kind assistance and guidance.
We are also thankful to all Electrical Engineering Department personnel for their help and details
explanation on various systems.
7. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
CHAPTER 1
1.1 Introduction
The Project INFRA-RED REMOTE SWITCH USING MICROCONTROLLER is used to switch
on/off the Home Appliances by using a standard Remote control. The system is used to switch
on/off upto six electrical devices. All the above processes are controlled by the 8 bit
Microcontroller AT89C2051. The Microcontroller receives the Infrared Signal from the receiver
and it decodes and switch on/off the appropriate Device. The Range of the system is upto 10
meters. The system works on Phillips RC5 format. High power loads can also be connected by
changing the Relay. The Microcontroller is used to receive the Infrared signal from the
Transmitter, the received signal is processed by the Microcontroller and according to the signal
the corresponding device is switched ON/OFF.
1.2 Objectives
1. To switch on/off the Home Appliances by using a standard Remote control.
2. The system is used to switch on/off upto six electrical devices.
3. The system should work within a range of 10 meters.
4. High power loads can also be connected by using relays of appropriate value.
5. The system should work on any remote supporting Phillips RC5 protocol.
1.3Background
INFRARED REMOTE CONTROL
An infra-red remote control is a component of an electronics device, most commonly a television
set, used for operating the device wirelessly from a short line-of-sight distance. Since infrared
(IR) remote controls use light, they require line of sight to operate the destination device. The
signal can, however, be reflected by mirrors, just like any other light source..Infrared receivers
8. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
also tend to have a more or less limited operating angle, which mainly depends on the optical
characteristics of the phototransistor.
INFRA-RED
Infrared (IR) light is electromagnetic radiation with a wavelength between 0.7 and 300
micrometres, which equates to a frequency range between approximately 1 and 430 THz.
IR wavelengths are longer than that of visible light, but shorter than that of terahertz radiation
microwaves. Infrared imaging is used extensively for military and civilian purposes. Military
applications include target acquisition, surveillance, night vision, homing and tracking. Non-
military uses include thermal efficiency analysis, remote temperature sensing, short-ranged
wireless communication, spectroscopy, and weather forecasting. Infrared astronomy uses sensor-
equipped telescopes to penetrate dusty regions of space, such as molecular clouds; detect objects
such as planets, and to view highly red-shifted objects from the early days of the universe.
RC-5 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. he 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 handset contains a keypad and a
transmitter integrated circuit (IC) driving an IR LED. The command data is a Manchester coded
bitstream modulating a 36 kHz carrier 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.
9. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
1.4 SIGNIFICANCE OF THE PROJECT
In modern electronics, electronic remote control system is a well known system. Infrared remote
control kit’s available in the market are quite expensive and it some one wishes to assemble one,
their IC’s may not be easily available. More over for simple ON-OFF function such as
controlling a lamp or fan we do not need very complex circuit. The IR remote control circuit
using photodiode and phototransistor sensor suffer from major drawback of being affected by
ambient light and a very low range. The advantage is that this circuit is absolutely free form
ambient light interference.
1.5 ORGANISATION OF THE REPORT
10. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
CHAPTER 2
CIRCUIT DESCRIPTION
Here is a versatile remote controlled appliance switch that can ON or OFF any appliance
connected to it using a TV remote. IR remote sensor SM0038 is used for recieving the signal.
Normally when no signal is falling on pin3,the output of it will be high.When a signal of 38 KHz
from the TV remote falls on the pin3 its output goes low.This send a pulse at pin 6 of
AT89C2051 which is the microcontroller.The high output is amplified to drive the relay .For the
next signal the outputs of IC3(ULN2003) toggles state. Result, we get a relay toggling on each
press on the remote.Any appliance connected to this circuit can be switched ON or OFF.
11. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
Fig1. Circuit Diagram
CHAPTER 3
CIRCUIT COMPONENETS
3.1 AT89C2051 (MICROCONTROLLER)
The AT89C2051 is a low-voltage, high-performance CMOS 8-bit microcomputer with 2K bytes
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. By combining a versatile 8-bit CPU with Flash on a monolithic
chip, the Atmel AT89C2051 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: 2K bytes of Flash, 128 bytes of RAM, 15 I/O lines, two 16-bit
timer/counters, a five vector two-level interrupt architecture, a full duplex serial port, a precision
12. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
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.
Fig2. Pin configuration of AT89C2051
14. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
PIN DESCRIPTION
VCC Supply Voltage
GND Ground
PORT 1 The Port 1 is an 8-bit bi-directional I/O port. Port pins P1.2 to P1.7 provide
internal pull-ups. P1.0 and P1.1 require external pull-ups. P1.0 and P1.1 also serve as the positive
input (AIN0) and the negative input (AIN1), respectively, of the on-chip precision analog
comparator. When 1s are written to Port 1 pins, they can be used as inputs. Port 1 also receives
code data during Flash programming and verification.
PORT 3 Port 3 pins P3.0 to P3.5, P3.7 are seven bi-directional I/O pins with internal
pull-ups. P3.6 is hard-wired as an input to the output of the on-chip comparator and is not
accessible as a gen-eral-purpose I/O pin. When 1s are written to Port 3 pins they are pulled high
by the internal pull-ups and can be used as inputs.
RST Reset input. All I/O pins are reset to 1s as soon as RST goes high. Holding the
RST pin high for two machine cycles while the oscillator is running resets the device.
XTAL1 Input to the inverting oscillator amplifier and input to the internal clock
operating circuit .
XTAL2 Output from the inverting oscillator amplifier.
OSCILLATOR CHARACTERISTICS The XTAL1 and XTAL2 are the input and
output, respectively, of an inverting amplifier which can be configured for use as an on-chip
oscillator, as shown in Figure 5-1. Either a quartz crystal or ceramic resonator may be used.
Fig4. Oscillator connections
15. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
3.2 ULN2003 (HIGH VOLTAGE AND CURRENT TRANSISTOR ARRAY
The ULN2003 is a monolithic high voltage and high current Darlington transistor arrays. It
consists of seven NPN Darlington pairs that features high-voltage outputs with common-cathode
clamp diode for switching inductive loads. The collector-current rating of a single Darlington
pair is 500mA. The Darlington pairs may be paralleled for higher current capability.
Applications include relay drivers, hammer drivers, lamp drivers, display drivers. The ULN2003
has a 2.7kW series base resistor for each Darlington pair for operation directly with TTL or 5V
CMOS devices.
Fig5. Logic Diagram
18. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
3.4 LM7805 (VOLTAGE REGULATOR)
Voltage Regulator (LM7805), having three legs, converts varying input voltage and produces a
constant regulated output voltage. The LM7805 typically has the ability to drive current up to 1A
The component has three legs: Input leg which can hold up to 36VDC Common leg (GND) and
an output leg with the regulator's voltage. For maximum voltage regulation, adding a capacitor in
parallel between the common leg and the output is usually recommended. This eliminates any
high frequency AC voltage that could otherwise combine with the output voltage.
Fig8. LM7805 IC
19. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
3.5 CRYSTAL OSCILLATOR
Most microprocessors, and microcontrollers have two oscillator pins labeled XTAL1 and
XTAL2 to connect to an external quartz crystal, RC network or even a Ceramic resonator. In this
application the Crystal Oscillator produces a train of continuous square wave pulses whose
frequency is controlled by the crystal which in turn regulates the instructions that controls the
device. For example, the master clock and system timing.
3.6 SIP RESISTOR
SIP stands for Serial In-line Package. single in-line package (or SIP) is an electronic device
package which has one row of connecting pins. It is not as popular as the dual in-line package,
but has been used for packaging RAM chips and multiple resistors with a common pin. In this
project, it has been used as a pull-up resistor for port1 of the microcontroller (AT89C2051).
Fig9. SIP resistor
20. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
3.7 TRANSFORMER(230/12V)
A transformer is a device that transfers electrical energy from one circuit to another through
inductively coupled conductors—the transformer's coils. A varying current in the first or primary
winding creates a varying magnetic flux in the transformer's core and thus a varying magnetic
field through the secondary winding. This varying magnetic field induces a varying
electromotive force (EMF) or "voltage" in the secondary winding. This effect is called mutual
induction. If a load is connected to the secondary, an electric current will flow in the secondary
winding and electrical energy will be transferred from the primary circuit through the
transformer to the load. In an ideal transformer, the induced voltage in the secondary winding
(Vs) is in proportion to the primary voltage (Vp), and is given by the ratio of the number of turns
in the secondary (Ns) to the number of turns in the primary (Np) as follows:-
Fig9. A transformer
21. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
3.8 RELAY
A relay is an electrically operated switch. Many relays use an electromagnet to operate a
switching mechanism mechanically, but other operating principles are also used. Relays are used
where it is necessary to control a circuit by a low-power signal (with complete electrical isolation
between control and controlled circuits), or where several circuits must be controlled by one
signal.
Fig10. A Relay
22. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
3.9 INFRA-RED SENSOR
Fig11. Internal circuit of an IR sensor
The IR emitter outputs IR at D1. The output from sensor turns on sensor,Q1,when
there is nothing blocking it. The sensor is connected as an inverting transistor, so its
output is low when IR light is striking it. When something blocks IR beam, the output
of Q1 goes high. The output is connected to a Schmitt trigger input which converts
the slowly changing analog signal to a conventional TTL logic signal with fast rise
and fall time. It also provides noise immunity so the output gate does not make
multiple transisitions as the input signal slowly passes through the threshold.
Fig12. An SM0038 IR sensor
23. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
CHAPTER 4
PROGRAMMING THE MICROCONTROLLER
The AT89C2051 is shipped with the 2K bytes of on-chip PEROM code memory
array in the erased state (i.e., contents = FFH) and ready to be programmed. The
code memory array is programmed one byte at a time. Once the array is
programmed, to re-program any non-blank byte, the entire memory array needs to
be erased electrically.
Internal Address Counter: The AT89C2051 contains an internal PEROM address
counter which is always reset to 000H on the rising edge of RST and is advanced
by applying a positive going pulse to pin XTAL1.
To program the AT89C2051, the following sequence is recommended.
1. Power-up sequence: Apply power between VCC and GND pins. Set RST and
XTAL1 to GND.
2. Set pin RST to “H”
Set pin P3.2 to “H”
3.Apply the appropriate combination of “H” or “L” logic levels to pins P3.3, P3.4,
P3.5, P3.7 to select one of the programming operation.
24. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
CHAPTER 5
SOURCE CODE(PROGRAM)
[ PROGRAM FOR REMOTE CONTROL ]
INCLUDE reg_52.pdf
INPUT EQU P3.2 ; Port3, Bit2 is used as input. The demodulated signal
with active low level is connected to this pin
OUTPUT EQU P1
OP1 EQU P1.2
OP2 EQU P1.3
OP3 EQU P1.4
OP4 EQU P1.5
OP5 EQU P1.6
OP6 EQU P1.7
DSEG ; this is internal data memory
ORG 20H ; Bit addressable memory
FLAGS: DS 1
CONTROL BIT FLAGS.0 ; toggles with every new keystroke
NEW BIT FLAGS.1; Bit set when a new command has been received
25. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
COMMAND: DS 1 ; Received command byte
SUBAD: DS 1 ; Device subaddress
TOGGLE: DS 1 ;Toggle every bit
ANS: DS 1 ;
ADDR: DS 1
STACK: DS 1 ; Stack begins here
CSEG ; Code begins here
[ PROCESSOR INTERRUPT AND RESET VECTORS]
ORG 00H ; Reset
JMP MAIN
ORG 0003H ; External Interrupt0
JMP RECEIVE
[ Interrupt 0 routine]
RECEIVE:
cpl p3.7
MOV 2,#255 ; Time Loop (3/4 bit time)
DJNZ 2,$ ; Waste Time to sync second bit
26. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
MOV 2,#255 ; Time Loop (3/4 bit time)
Djnz 2,$ ; Waste Time to sync second bit
Mov 2,#145 ; Time Loop (3/4 bit time)
Djnz 2,$ ; Waste Time to sync second bit
clr a
mov r6,#07h
pol1: mov c,Input
rlc a
Mov 2,#255 ; Waste time for next BIT
Djnz 2,$
Mov 2,#255 ; Time Loop (3/4 bit time)
Djnz 2,$ ; Waste Time to sync second bit
Mov 2,#255 ; Time Loop (3/4 bit time)
Djnz 2,$ ; Waste Time to sync second bit
Mov 2,#114 ; Time Loop (3/4 bit time)
Djnz 2,$ ; Waste Time to sync second bit
djnz r6,pol1
MOV SUBAD,A
mov r6,#06h
pol2:
mov c,Input
rlc a
Mov 2,#255 ; Waste time for next BIT
27. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
Djnz 2,$
Mov 2,#255 ; Time Loop (3/4 bit time)
Djnz 2,$ ; Waste Time to sync second bit
Mov 2,#255 ; Time Loop (3/4 bit time)
Djnz 2,$ ; Waste Time to sync second bit
Mov 2,#114 ; Time Loop (3/4 bit time)
Djnz 2,$ ; Waste Time to sync second bit
djnz r6,pol2
Mov COMMAND,A ; Save Command at IRData memory
MOV A,SUBAD
MOV ADDR,A
ANL A,#0FH
MOV SUBAD,A
CJNE A,#03H,ZXC1
MOV A,COMMAND
CPL A
MOV COMMAND,A
AJMP ASZ
ZXC1: MOV A,SUBAD
CJNE A,#00H,ANSS
AJMP ASZ
ASZ: MOV A,ADDR
30. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
MOV ANS,A
SETB NEW ; Set flag to indicate the new command
;################################################################
ANS1:
RETI
[ Main routine. Program execution starts here.]
MAIN:
MOV SP,#60H
MOV OUTPUT,#0FFH ;Switch off all devices
SETB EX0 ; Enable external Interrupt0
CLR IT0 ; triggered by a high to low transition
SETB EA
MOV ANS,#00H ;clear temp toggle bit
CLR NEW
LOO:
JNB NEW,LOO
CLR NEW
AJMP LOO
END
31. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
CHAPTER 6
WORKING OF THE CIRCUIT
The Infra-Red Remote control circuit described here used here for any simple ON-OFF function.
The circuit is free from ambient light interference and works upto a range of 10 meters.
The 38khz infra-red(IR) rays energized by a remote control are received a infra-
red receiver module SM0038 of the circuit. Pin1 is connected to ground, pin2 is connected to
supply through a 47k resistor and the output is taken from pin3. The output is given to the pin6
of the microcontroller(AT89C2051) for processing. The IC ULN2003 amplifies the signal which
drives the relay. The appliance connected to the relay does operate due to signal from the remote
control.
The 12V to the relay circuit and the 5V to the microcontroller circuit is provided
by the rectifier circuit. This circuit consists of an IC LM7805 which constantly gives an output
of 5V for an input in the range of (9-12V). It has a transformer which steps down the 220V to
12V and a bridge rectifier which converts the ac to dc.
34. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
BIBLIOGRAPHY
1. Muhammad Ali Mazidi, Janice Gillispie Mazidi, Rolin d. Mckinlay,
THE 8051 MICROCONTROLLER AND EMBEDDED SYSTEMS
2. www.8051projects.info
3. www.wikipedia.org
4. www.atmel.com
5. www.datasheetcatalog.org
6. www.electronics-tutorials.com