Chapter - 1: 1.1 Objectives
Chapter - 1: 1.1 Objectives
INTRODUCTION
This main objective of this project is to use Infrared frequency signal to control
(on/off) the Home Appliances. This Project is REMOTE CONTROLLED SWITCH
BOARD, which is used to switch on/off the Home Appliances by using a standard
Remote control. The system is used to switch on/off up to eight electrical devices. All
the above processes are controlled by the PIC16F84A 8-bit Microcontroller. 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 up to 10 meters. The
project can switch on/off electrical devices of maximum load current of 5Amperes.
High power loads can also be connected by changing the Relay and the devices will
come to the original state after the power failure. The Microcontroller is used 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.1 OBJECTIVES
1. To switch on/off the Home Appliances by using a standard Remote control.
2. The system is used to switch on/off up to eight 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.
TV
REMOTE
SWITCHING
TRANSISTOR
TSOP1738
Power supply
PIC16F84A
MICROCONTROLLER
RELAYS
DRIVER
RELAYS
LOAD OFF
INDICATOR
LOAD ON
INDICATOR
1.3 BACKGROUND
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 also tend to have a more or less limited
operating angle, which mainly depends on the optical characteristics of the
phototransistor.
2
INFRA-RED
Infrared (IR) light is electromagnetic radiation with a wavelength between 0.7 and
300 micrometers, 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 bit stream 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.
Chapter -2
LITERATURE SURVEY
2.1 WHAT IS INFRARED?
Infrared is a energy radiation with a frequency below our eyes sensitivity, so we
cannot see it. Even that we cannot "see" sound frequencies, we know that it exist, we
can listen them.
Similar to the airplane at the night sky, our TV room may have hundreds of tinny IR
sources, our body, and the lamps around, even the hot cup of tea. A way to avoid all
those other sources, is generating a key, like the flashing airplane. So, remote controls
use to pulsate its infrared in a certain frequency. The IR receiver module at the TV,
VCR or stereo "tunes" to this certain frequency and ignores all other IR received. The
best frequency for the job is between 30 and 60 kHz, the most used Is around 36 kHz.
So, remote controls use the 36 kHz (or around) to transmit information. Infrared light
emitted by IR Diodes is pulsated at 36 thousand times per second, when transmitting
logic level "1" and silence for "0".
2.3 IR GENERATION
To generate a 36 kHz pulsating infrared is quite easy, more difficult
is to receive and identify this frequency. This is why some
companies produce infrared receives, that contains the filters,
decoding circuits and the output shaper, that delivers a square
wave, meaning the existence or not of the 36kHz incoming pulsating
infrared.
It means that those 3 dollars small units, have an output pin that
goes high (+5V) when there is a pulsating 36kHz infrared in front of
it, and zero volts when there is not this radiation.
Those IR demodulators have inverted logic at its output, when a burst of IR is sensed
it drives its output to low level, meaning logic level = 1.
2 start bits,
1 control bit,
5 address bits
6 command bits.
The start bits are always logic 1 and intended to calibrate the optical receiver
automatic gain control loop. Next, is the control bit. This bit is inverted each time the
user releases the remote button and is intended to differentiate situations when the
user continues to hold the same button or presses it again. The next 5 bits are the
address bits and select the destination device. A number of devices can use RC5 at the
same time. To exclude possible interference, each must use a different address. The 6
command bits describe the actual command. As a result, a RC5 transmitter can send
the 2048 unique commands. The transmitter shifts the data word, applies Manchester
encoding and passes the created
One-bit sequence to a control carrier frequency signal amplitude modulator. The
amplitude modulated carrier signal is sent to the optical transmitter, which radiates the
infrared light. In RC5 systems the carrier frequency has been set to 36 kHz. Figure
below displays the RC5 protocol
Chapter -3
DESIGN OVERVIEW
3.1CIRCUIT 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 TSOP 1738 is used for
receiving 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 sends a pulse at pin 6 of PIC16F84A which is the microcontroller. The
high output is amplified to drive the relay .For the next signal the outputs of IC3
(ULN2803APG) 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.
3.2 CIRCUIT DIAGRAM
10
Chapter -4
CIRCUIT COMPONENETS
12
Peripheral Features:
14
Features
500mA rated collector current.
Inputs compatible with various type of inputs.
Relay driver application.
15
4.3 RELAY
A relay is an electrically operated switch. Many relays use an electromagnet to
mechanically operate a switch, but other operating principles are also used, such as
solid- state relays. Relays are used where it is necessary to control a circuit by a lowpower signal (with complete electrical isolation between control and controlled
circuits), or where several circuits must be controlled by one signal. The rst relays
were used in long distance telegraph circuits as appliers they repeated the signal
coming in from one circuit and re-transmitted it on another circuit. Relays were used
extensively in telephone exchanges and early computers to perform logical
operations.
16
Fig 4.8: the relay contacts are close by electro-magnetism created by the coil
The appliance to be controlled is connected between the pole of the relay and neutral
terminal of mains. It gets connected to live terminal of AC mains via normally opened
(N/O) contact when the relay energises.
In short we can say relay is like a switch which is necessary to control a circuit
The TSOP 17XX series 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. TSOP 17XX is the standard IR remote control receiver series,
supporting all major transmission codes. Here XX refers to the frequency of the
infrared carrier signal on which the code is modulated, which is 38 KHz in our case. It
has three pins .GND and Vcc are connected to the power supply with VCC as 5V and
Vout which becomes 0V, or GND when the demodulated bit received is high i.e. 5V and
vice versa.
Features
18
19
20
4.7 DIODE
In electronics, a diode is a two-terminal electronic component with asymmetric
conductance it has low resistance to current in one direction, and high resistance in
the other. A semiconductor diode, the most common type today, is a crystalline piece
of semiconductor material with a pn junction connected to two electrical terminals. A
vacuum tube diode has two electrodes, a plate (anode) and a heated cathode.
21
4.9 CAPACITOR
A capacitor is a passive two-terminal electrical component used to store energy
electrostatically in an electric field. The forms of practical capacitors vary widely, but
all contain at least two electrical conductors separated by a dielectric. The conductors
can be thin films, foils or sintered beads of metal or conductive electrolyte, the
nonconducting dielectric acts to increase the capacitors charge capacity. A dielectric
can be glass, ceramic, plastic film, air, vacuums, paper, mica, oxide layer. Capacitors
are widely used as parts of electrical circuits in many common electrical devices.
Unlike a resistor, an ideal capacitor does not dissipate energy. Instead, a capacitor
stores energy in the form of an electrostatic field between its plates.
22
23
4.11 RESISTOR
A resistor is a passive two-terminal electrical component that implements electrical
resistance as a circuit element. Resistors act to reduce current flow, and, at the same
time, act to lower voltage levels within circuits. In electronic circuits resistors are
used to limit current flow, to adjust signal levels, bias active elements, terminate
transmission lines among other uses.
High-power resistors that can dissipate many watts of electrical power as heat may be
used as part of motor controls, in power distribution systems, or as test loads for
generators.
Fixed resistors have resistances that only change slightly with temperature, time or
Operating voltage. Variable resistors can be used to adjust circuit elements or as
sensing devices for heat, light, humidity, Force or chemical activity.
24
4.12 LED
A light emitting diode (LED) is essentially a PN junction opto-semiconductor that
emits a monochromatic (single color) light when operated in a forward biased
direction.
LEDs convert electrical energy into light energy. They are frequently used as "pilot"
lights in electronic appliances to indicate whether the circuit is closed or not.
25
LED connection
Chapter -5
CIRCUIT DESIGNING
5.1 PCB Design and Construction
ASSEMBLY
26
Use the component overlay on the PCB to place the components in the following
order. Do not insert any ICs until after the TESTING section.
1. Resistors and diodes.
2. IC sockets
3. Resistor networks. Note that RP2 is inserted inside the IC1 IC socket. The small dot
at one end of the network denotes pin 1 which is the square pad.
4. Ceramic resonator, capacitors and IR module. The lens bump of the IR module
faces outwards.
5. Three switches 2 SPDT and a zippy tact switch
6. DC power jack and 7805 regulator. Use needle nosed pliers to bend the leads of the
regulator. It does not require a heatsink. Screw down onto to PCB.
7. LEDs
8. Electrolytic capacitors. Make sure you insert them the correct way around.
9. Terminal blocks. Note the terminal blocks do NOT slide together. Also make sure
the wire entry side faces out from the PCB.
10. Relays
TESTING
Finally after you have inspected your work connect 12V DC centre positive from a
plug pack. The power LED should light. Use a multimeter to measure the 5V output
from the regulator. Easiest way to do this is across pins 10 and 20 of the IC1 socket
(pin 20 = positive). If all is well you can remove the power and insert the ICs. Take
care that none of the IC leads are bent under when inserting them into their sockets.
Connect a 12V supply again. Put the slide switches in the momentary (MOM)
position and press button 1 on the remote control unit. Relay 1 should operate and
LED 1 should light. Release the button and the relay should release. Check each of
the other relays in turn by pressing the other buttons. Buttons 13 and 14 have no affect
in momentary mode. Now put the slide switches in the toggle (TOG) position. Now
press and release button 1 on the remote control unit. Relay 1 should operate and stay
operated. LED 1 should also be on. Press each of the other buttons 2 to 12 in turn and
note that each relay and its LED is on. At this point all the relays and LEDs should be
on. Now press button 13. All Group 1 relays (1-4) should release and LEDs 1-4
should be off. Pressing button 14 should release all Group 2 (5-8) relays and turn off
their M associated LEDs 5-8.
27
28
29
The timing is controlled by dividing down the signal from a 4MHz crystal (X1) to
obtain 1.8ms intervals this is the spacing between each bit in the remote control
sequence. The decoded signal appears at pin 1 of IC1 and is used to drive the
Acknowledge LED (LED11) via a 220 resistor.
IC1 can be forced to display its remote control status by connecting pin 1 to the 5V
supply (TP2) via a 220 test Resistor at power up. This will set pins 18 & 17 to
provide a tracer signal and a stop and start level for the code respectively.
The tracer shows when the code level is monitored for each of the 14 bits in the code.
When in this mode, the 0 and 1 outputs are prevented from operating normally.
Normal operation is restored by switching off the supply for a few seconds, removing
the 220W test resistor and reapplying power.
Chapter -6
PROGRAMMING THE MICROCONTROLLER
6.1 SOFTWARE
MPLAB IDE
MPLAB is a free integrated development environment for the development
of embedded applications on PIC and dsPIC microcontrollers, and is developed
by Microchip Technology. MPLAB X is the latest edition of MPLAB, and is
developed on the Net Beans platform. MPLAB and MPLAB X support project
management, code editing, debugging and programming of Microchip 8-bit, 16-bit
and 32-bit PIC microcontrollers.
A development system for embedded controllers is a system of programs running on a
Desktop PC to help write, edit, debug and program code the intelligence of
embedded systems applications into a microcontroller. MPLAB IDE runs on a PC
and contains all the components needed to design and deploy embedded systems
applications.
The PIC16F84A 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 reprogram any non-blank byte, the entire memory array needs to be erased electrically.
Internal Address Counter: The PIC16F84A 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 PIC16F84A, the
following sequence is recommended.
31
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, and P3.7 to select one of the programming operations.
Programming the PIC in assembly language is no exception but it is more difficult to
Work with than high-level languages, like BASIC and C++.
Assembly language uses a one-to-one correspondence of mnemonic words with
The binary machine codes that the processor uses to code the instructions. The user
writes the program using the mnemonic words called the source program and gives
this to the program on the PC called the assembler which converts it into the
machine code of the PIC in the form of a list of hexadecimal numbers. This set of
numbers is called the object program. The user then writes the object program into
the PIC in the downloading process of programming the PIC. When this is done, the
PIC is ready to run its new program.
6.2 PROGRAM
[PROGRAM FOR REMOTE CONTROL]
$mod51
INPUT EQU P3.2; Port3, Bit2 is used as input. The demodulated signal
OUTPUT EQU P1
with active low level is connected to this pin
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
COMMAND: DS 1; Received command byte
SUBAD: DS 1; Device sub address
TOGGLE: DS 1; Toggle every bit
ANS: DS 1;
ADDR: DS 1
STACK: DS 1; Stack begins here
CSEG; Code begins here
32
CPL A
MOV COMMAND,A
AJMP ASZ
ZXC1: MOV A, SUBAD
CJNE A, #00H,ANSS
AJMP ASZ
ASZ: MOV A, ADDRANL A,#20H
MOV TOGGLE,A
CJNE A, ANS,ANSS
AJMP WAR
ANSS: JMP ANS1
WAR:
MOV A, COMMAND
MOV R0, A
XRL A, #01H; device 1
JNZ CH1
CPL OP1; Light 1
AJMP GO
CH1: MOV A, R0
XRL A, #02H ; device 2
JNZ CH2
CPL OP2; Light 1
AJMP GO
CH2: MOV A, R0
XRL A, #03H ; device 3
JNZ CH3
CPL OP3; Light 1
AJMP GOCH3: MOV A, R0
XRL A, #04H; device 4
JNZ CH4
CPL OP4; Light 1
AJMP GO
CH4: MOV A, R0
XRL A, #05H; device 5
JNZ CH5
CPL OP5; Light 1
AJMP GO
CH5: MOV A, R0
XRL A,#06H ; device 6
JNZ CH6
CPL OP6; Light 1
AJMP GO
CH6: MOV A, R0
XRL A, #0CH ; all devices off
JNZ go
MOV OUTPUT,#0FFH
AJMP GO
GO:
MOV ANS,TOGGLE
MOV A, ANS
CPL ACC.5MOV ANS,A
34
Chapter -7
CONCLUSION AND FUTURE WORK
7.1 CONCLUSION
Hereby we come to an end of or project IR remote control switch board. This
project gives us an idea of RC5 Protocol and the microcontroller PIC16F84A. 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.
35
Chapter -8
BIBLIOGRAPHY
8.1 REFERENCES
[1]
www.wikipedia.com
[2]
www.google.com
[3]
www.atmel.com
[4]
www.coolcircuit.com
[5]
www.circuitvalley.com
[6]
http://archive.siliconchip.com.au/cms/A_30626/article.html
8.2 DATASHEETS
PIC16F84A
TSOP 1738
ULN2803APG
36
37