102642452 infrared-remote-switch-project-report


Published on

  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

102642452 infrared-remote-switch-project-report

  1. 1. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ Project Report On INFRARED REMOTE CONTROL ON/OFF SWITCHSubmitted in partial fulfillment of the requirements for the awardof 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. 2. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ ABSTRACTThis Project INFRARED REMOTE CONTROL ON/OFF SWITCH is used to switch on/off theHome Appliances by using a standard Remote control. The system is used to switch on/off uptosix electrical devices. All the above processes are controlled by the 8 bit MicrocontrollerAT89C2051. The system works on Phillips RC5 format.
  3. 3. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ Certificate from the SupervisorThis is to certify that the project entitled “INFRARED REMOTE CONTROL ON/OFFSWITCH” 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 mysupervision and guidance in a manner satisfactory to warrant its acceptance as prerequisite forthe 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 otherdegree/ diploma.Date: Dr. AROOP BARDALAI Deptt. Of Electrical & Instrumentaion EnginneringPlace: Guwahati Assam Engineering College Guwahati-781013
  4. 4. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ Certificate from the Head of the DepartmentThis is to certify that the project report enitled “ INFRARED REMOTE CONTROL ON/OFFSWITCH” 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 ofEngineering 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. 5. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ AcknowledgementWe are thankful to Dr. Aroop Bardalai and our respected Head of the Department Dr. DamodarAgarwal 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 havealso got hold of some information from a mazagine. I have enjoyed and learnt a lot during thecompletion of this project.We also envince thanks to Prof., Dr.Durlav Hazarika and Asstt.Prof., Dr. Dipankar Chanda fortheir kind assistance and guidance.We are also thankful to all Electrical Engineering Department personnel for their help and detailsexplanation on various systems.
  6. 6. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ CONTENTS1. Introduction. 1-32.
  7. 7. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ CHAPTER 11.1 IntroductionThe Project INFRA-RED REMOTE SWITCH USING MICROCONTROLLER is used to switchon/off the Home Appliances by using a standard Remote control. The system is used to switchon/off upto six electrical devices. All the above processes are controlled by the 8 bitMicrocontroller AT89C2051. The Microcontroller receives the Infrared Signal from the receiverand it decodes and switch on/off the appropriate Device. The Range of the system is upto 10meters. The system works on Phillips RC5 format. High power loads can also be connected bychanging the Relay. The Microcontroller is used to receive the Infrared signal from theTransmitter, the received signal is processed by the Microcontroller and according to the signalthe 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.3BackgroundINFRARED REMOTE CONTROLAn infra-red remote control is a component of an electronics device, most commonly a televisionset, 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. Thesignal can, however, be reflected by mirrors, just like any other light source..Infrared receivers
  8. 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 opticalcharacteristics of the phototransistor.INFRA-REDInfrared (IR) light is electromagnetic radiation with a wavelength between 0.7 and 300micrometres, 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 radiationmicrowaves. Infrared imaging is used extensively for military and civilian purposes. Militaryapplications include target acquisition, surveillance, night vision, homing and tracking. Non-military uses include thermal efficiency analysis, remote temperature sensing, short-rangedwireless communication, spectroscopy, and weather forecasting. Infrared astronomy uses sensor-equipped telescopes to penetrate dusty regions of space, such as molecular clouds; detect objectssuch as planets, and to view highly red-shifted objects from the early days of the universe.RC-5 protocolThe 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 theRC-5 protocol is that (when properly followed) any CD handset (for example) may be used tocontrol any brand of CD player using the RC-5 protocol. The handset contains a keypad and atransmitter integrated circuit (IC) driving an IR LED. The command data is a Manchester codedbitstream modulating a 36 kHz carrier The IR signal from the transmitter is detected by aspecialized IC with an integral photo-diode, and is amplified, filtered, and demodulated so thatthe 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. 9. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/1.4 SIGNIFICANCE OF THE PROJECTIn modern electronics, electronic remote control system is a well known system. Infrared remotecontrol 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 ascontrolling a lamp or fan we do not need very complex circuit. The IR remote control circuitusing photodiode and phototransistor sensor suffer from major drawback of being affected byambient light and a very low range. The advantage is that this circuit is absolutely free formambient light interference.1.5 ORGANISATION OF THE REPORT
  10. 10. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ CHAPTER 2CIRCUIT DESCRIPTIONHere is a versatile remote controlled appliance switch that can ON or OFF any applianceconnected 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 KHzfrom the TV remote falls on the pin3 its output goes low.This send a pulse at pin 6 ofAT89C2051 which is the microcontroller.The high output is amplified to drive the relay .For thenext signal the outputs of IC3(ULN2003) toggles state. Result, we get a relay toggling on eachpress on the remote.Any appliance connected to this circuit can be switched ON or OFF.
  11. 11. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ Fig1. Circuit Diagram CHAPTER 3CIRCUIT COMPONENETS3.1 AT89C2051 (MICROCONTROLLER)The AT89C2051 is a low-voltage, high-performance CMOS 8-bit microcomputer with 2K bytesof Flash programmable and erasable read-only memory (PEROM). The device is manufacturedusing 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 monolithicchip, the Atmel AT89C2051 is a powerful microcomputer which provides a highly-flexible andcost-effective solution to many embedded control applications. The AT89C2051 provides thefollowing standard features: 2K bytes of Flash, 128 bytes of RAM, 15 I/O lines, two 16-bittimer/counters, a five vector two-level interrupt architecture, a full duplex serial port, a precision
  12. 12. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/analog comparator, on-chip oscillator and clock circuitry. In addition, the AT89C2051 isdesigned with static logic for operation down to zero frequency and supports two softwareselectable 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 modesaves the RAM contents but freezes the oscillator disabling all other chip functions until the nexthardware reset. Fig2. Pin configuration of AT89C2051
  13. 13. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ Fig3.Block diagram of AT89C2051
  14. 14. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/PIN DESCRIPTIONVCC Supply VoltageGND GroundPORT 1 The Port 1 is an 8-bit bi-directional I/O port. Port pins P1.2 to P1.7 provideinternal pull-ups. P1.0 and P1.1 require external pull-ups. P1.0 and P1.1 also serve as the positiveinput (AIN0) and the negative input (AIN1), respectively, of the on-chip precision analogcomparator. When 1s are written to Port 1 pins, they can be used as inputs. Port 1 also receivescode 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 internalpull-ups. P3.6 is hard-wired as an input to the output of the on-chip comparator and is notaccessible as a gen-eral-purpose I/O pin. When 1s are written to Port 3 pins they are pulled highby 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 theRST 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 clockoperating circuit .XTAL2 Output from the inverting oscillator amplifier.OSCILLATOR CHARACTERISTICS The XTAL1 and XTAL2 are the input andoutput, respectively, of an inverting amplifier which can be configured for use as an on-chiposcillator, as shown in Figure 5-1. Either a quartz crystal or ceramic resonator may be used. Fig4. Oscillator connections
  15. 15. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/3.2 ULN2003 (HIGH VOLTAGE AND CURRENT TRANSISTOR ARRAYThe ULN2003 is a monolithic high voltage and high current Darlington transistor arrays. Itconsists of seven NPN Darlington pairs that features high-voltage outputs with common-cathodeclamp diode for switching inductive loads. The collector-current rating of a single Darlingtonpair is 500mA. The Darlington pairs may be paralleled for higher current capability.Applications include relay drivers, hammer drivers, lamp drivers, display drivers. The ULN2003has a 2.7kW series base resistor for each Darlington pair for operation directly with TTL or 5VCMOS devices. Fig5. Logic Diagram
  16. 16. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ Fig6. Schematic (each Darlington pair)Features  500mA rated collector current.  Inputs compatible with various type of inputs.  Relay driver application.
  17. 17. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/3.3 74LS04 (Hex Inverting Gates)This device contains six independent gates each of which performs the logicINVERT function. Fig7. Logic DiagramFUNCTION TABLE
  18. 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 aconstant regulated output voltage. The LM7805 typically has the ability to drive current up to 1AThe component has three legs: Input leg which can hold up to 36VDC Common leg (GND) andan output leg with the regulators voltage. For maximum voltage regulation, adding a capacitor inparallel between the common leg and the output is usually recommended. This eliminates anyhigh frequency AC voltage that could otherwise combine with the output voltage. Fig8. LM7805 IC
  19. 19. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/3.5 CRYSTAL OSCILLATORMost microprocessors, and microcontrollers have two oscillator pins labeled XTAL1 andXTAL2 to connect to an external quartz crystal, RC network or even a Ceramic resonator. In thisapplication the Crystal Oscillator produces a train of continuous square wave pulses whosefrequency is controlled by the crystal which in turn regulates the instructions that controls thedevice. For example, the master clock and system timing.3.6 SIP RESISTORSIP stands for Serial In-line Package. single in-line package (or SIP) is an electronic devicepackage 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 thisproject, it has been used as a pull-up resistor for port1 of the microcontroller (AT89C2051). Fig9. SIP resistor
  20. 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 throughinductively coupled conductors—the transformers coils. A varying current in the first or primarywinding creates a varying magnetic flux in the transformers core and thus a varying magneticfield through the secondary winding. This varying magnetic field induces a varyingelectromotive force (EMF) or "voltage" in the secondary winding. This effect is called mutualinduction. If a load is connected to the secondary, an electric current will flow in the secondarywinding and electrical energy will be transferred from the primary circuit through thetransformer 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 turnsin the secondary (Ns) to the number of turns in the primary (Np) as follows:- Fig9. A transformer
  21. 21. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/3.8 RELAYA relay is an electrically operated switch. Many relays use an electromagnet to operate aswitching mechanism mechanically, but other operating principles are also used. Relays are usedwhere it is necessary to control a circuit by a low-power signal (with complete electrical isolationbetween control and controlled circuits), or where several circuits must be controlled by onesignal. Fig10. A Relay
  22. 22. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/3.9 INFRA-RED SENSOR Fig11. Internal circuit of an IR sensorThe IR emitter outputs IR at D1. The output from sensor turns on sensor,Q1,whenthere is nothing blocking it. The sensor is connected as an inverting transistor, so itsoutput is low when IR light is striking it. When something blocks IR beam, the outputof Q1 goes high. The output is connected to a Schmitt trigger input which convertsthe slowly changing analog signal to a conventional TTL logic signal with fast riseand fall time. It also provides noise immunity so the output gate does not makemultiple transisitions as the input signal slowly passes through the threshold. Fig12. An SM0038 IR sensor
  23. 23. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ CHAPTER 4PROGRAMMING THE MICROCONTROLLERThe AT89C2051 is shipped with the 2K bytes of on-chip PEROM code memoryarray in the erased state (i.e., contents = FFH) and ready to be programmed. Thecode memory array is programmed one byte at a time. Once the array isprogrammed, to re-program any non-blank byte, the entire memory array needs tobe erased electrically.Internal Address Counter: The AT89C2051 contains an internal PEROM addresscounter which is always reset to 000H on the rising edge of RST and is advancedby 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 andXTAL1 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. 24. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ CHAPTER 5SOURCE 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. 25. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/COMMAND: DS 1 ; Received command byteSUBAD: DS 1 ; Device subaddressTOGGLE: DS 1 ;Toggle every bitANS: DS 1 ;ADDR: DS 1STACK: DS 1 ; Stack begins hereCSEG ; 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. 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,#07hpol1: 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,#06hpol2: mov c,Input rlc a Mov 2,#255 ; Waste time for next BIT
  27. 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 ASZZXC1: MOV A,SUBAD CJNE A,#00H,ANSS AJMP ASZASZ: MOV A,ADDR
  28. 28. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ ANL A,#20H MOV TOGGLE,A CJNE A,ANS,ANSS AJMP WARANSS: JMP ANS1WAR:;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! MOV A,COMMAND;------------------------------------------- MOV R0,A XRL A,#01H ; device 1 JNZ CH1 CPL OP1 ;Light 1 AJMP GOCH1: MOV A,R0 XRL A,#02H ; device 2 JNZ CH2 CPL OP2 ;Light 1 AJMP GOCH2: MOV A,R0 XRL A,#03H ; device 3 JNZ CH3 CPL OP3 ;Light 1 AJMP GO
  29. 29. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/CH3: MOV A,R0 XRL A,#04H ; device 4 JNZ CH4 CPL OP4 ;Light 1 AJMP GOCH4: MOV A,R0 XRL A,#05H ; device 5 JNZ CH5 CPL OP5 ;Light 1 AJMP GOCH5: MOV A,R0 XRL A,#06H ; device 6 JNZ CH6 CPL OP6 ;Light 1 AJMP GOCH6: MOV A,R0 XRL A,#0CH ; all devices off JNZ go MOV OUTPUT,#0FFH AJMP GOGO:;*********************************************************** MOV ANS,TOGGLE MOV A,ANS CPL ACC.5
  30. 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. 31. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ CHAPTER 6WORKING OF THE CIRCUITThe 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 tosupply through a 47k resistor and the output is taken from pin3. The output is given to the pin6of the microcontroller(AT89C2051) for processing. The IC ULN2003 amplifies the signal whichdrives the relay. The appliance connected to the relay does operate due to signal from the remotecontrol. The 12V to the relay circuit and the 5V to the microcontroller circuit is providedby the rectifier circuit. This circuit consists of an IC LM7805 which constantly gives an outputof 5V for an input in the range of (9-12V). It has a transformer which steps down the 220V to12V and a bridge rectifier which converts the ac to dc.
  32. 32. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
  33. 33. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
  34. 34. www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/ BIBLIOGRAPHY1. Muhammad Ali Mazidi, Janice Gillispie Mazidi, Rolin d. Mckinlay, THE 8051 MICROCONTROLLER AND EMBEDDED SYSTEMS2. www.8051projects.info3. www.wikipedia.org4. www.atmel.com5. www.datasheetcatalog.org6. www.electronics-tutorials.com