View
228
Download
0
Category
Preview:
Citation preview
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 1/48
1
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 2/48
A2Z INFRA RED
CONTROLLINGDEVICE
by
Er. Zatin Gupta
2
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 3/48
LIST OF FIGURES
Figure No. Caption Page No
3.1.1 Darlingto
3.2.1 Pin Diagr3.3.1 Pin Diagr
3.4.1 Block Dia
3.4.2 IR Receiv
3
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 4/48
ABSTRACT
It is basically an embedded system based project and in this project I am controlling an
electric appliances from remote location i.e. infrared. This idea is having a lot of
applications in daily life. It uses both the software as well as hardware part. The main
purpose of this project is to run equipment through the remote location without use of
wires i.e. through wireless media. User can switch on/off his home appliances by remote
as per user requirement and user is far apart from the device.
Features of the project:
• Send command from remote location to the device
• It will act according to the commands
• Relays are used to switch on/off the appliance
• IR Receiver is used to receive the signal
Technology Involved
Embedded system designing
Hardware Used:
8-bit microcontroller (AT89S52),
Darlington pair,
Relays SPDT,
Software Used:
Keil Compiler
4
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 5/48
CONTENTS
List of Figures
Abstract
Contents
CHAPTER 1: INTRODUCTION
1.1. Hardware used
1.2. Brief overview of peripherals attached 1.3. Description
1.4 Features
CHAPTER 2: LITERATURE: A REVIEW
2.1. Embedded System
2.1.1. Components 9
2.1.2. Input Devices 92.1.3. Output Devices 9
2.1.4. Software’s & Hardware’s 10
2.1.5. Characteristics 102.1.6. Cell Phone 10
2.1.7. Applications 10
2.1.8. Difference-Embedded System & Computing platform 112.2. Microcontroller 11
2.2.1. Types of Microcontroller 11
2.2.1.1. 4-bit microcontroller 11
2.2.1.2. 8-bit microcontroller 112.2.1.3. 16-bit microcontroller 12
2.2.1.4. 32-bit microcontroller 12
2.2.2 Comparison of 8051 Family members 122.2.3 Versions of 8051 microcontroller 13
2.2.3.1 8751 microcontroller
13
2.2.3.2 AT89C51 from ATMEL Corp. 2.2.3.3 OTP 13
CHAPTER 3: TECHNOLOGY INVOLVED3.1. Darlington Pair
14
3.2. Relays 3.2.1. SPDT Relays 15
5
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 6/48
3.2.2. Uses of Relays
15
3.3. AT89S52 Microcontroller 16
3.3.1. Pin Description 16
3.3.2. Pin Diagram19
3.4. TSOP
3.4.1. Description
3.4.2. Available types
20
3.4.3. Features 203.4.4. Block Diagram 20
CHAPTER 4: TESTING
4.1. Hardware Testing 224.1.1. Without IC 22
4.1.2. With IC 224.2. Software Testing 23
4.2.1. Relay Testing 23
4.2.2. Remote Testing 24
CHAPTER 5: SNAPSHOTS
5.1. Block Diagram 29
5.2. Circuit Diagram 305.2.1 Circuit Diagram of Controller 30
5.2.2 Circuit Diagram of Darlington Pair
5.2.3 Circuit Diagram of TSOP 315.3 Snapshots
5.3.1. Project at ON state 32
5.3.2. When Relay 1 is ON 335.3.3. When Relay 2 is ON
5.3.4. When Relay 3 is ON
5.3.5. When Relay 4 is ON 36
5.3.6. When all relays are OFF 375.3.7. Remote used
CHAPTER 6: APPLICATIONS AND FUTURE WORK 6.1 Application of the Project 38
6.2 Further Work 38
CHAPTER 7: REFERNECES 39
APPENDIX I: SOURCE CODE 40
6
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 7/48
Chapter-1
Introduction to Project
1.1 Hardware used
To design the specified project I require the following main hardware components.
• IR Remote (Transmitter)
• TSOP (Receiver)
• One AT89S52 microcontroller
• Darlington Pair
• Keys
• Relays
• 7805 IC
• 9-0-9 V transformer for power supply
• A PCB on which all the hardware is mounted
1.2Brief overview of peripherals attached
• IR Remote (Transmitter) is used to transmit an IR signal when a key is pressed.
• TSOP (Receiver) is used to receive the IR signal and send it to microcontroller.
•Relays are used to switch on/off the appliances.
• Darlington pair is used to operate relays.
• 7805 IC is used for controlling the power supply.
1.3 Description
7
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 8/48
It is basically an embedded system based project and in this project I am controlling an
electronic device from remote location i.e. infrared. This idea is having a lot of
applications in daily life. It uses both the software as well as hardware part. The main
purpose of this project is to run equipment through the remote location without use of
wires i.e. through wireless media. User can switch on/off his home appliances by remote
as per user requirement and user is far apart from the device.
1.4 Features:
• Send command from remote location to the device
• It will act according to the commands
• Relays are used to switch on/off the appliance
• IR Receiver is used to receive the signal
8
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 9/48
CHAPTER 2
LITERATURE: A REVIEW
2.1 Embedded system
A hardware system which is designed to perform a specific task in a particular time
period e.g. mobile phones
2.1.1 Components
Components in an Embedded System are as:-
• Hardware
• Input & Output
• Software
2.1.2 Input Devices
Input devices are as follow:-
• Sensors
• Keys
• Analog signals
• Pulses
2.1.3 Output Devices
• LED’s
9
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 10/48
• LCD
• Motors
• Serial data
2.1.4 Software’s
• Machine language
• Assembly language
• High level language
• C, C++, java
2.1.5 Characteristics
Characteristics of Embedded System are:-
• Perform a single set of functions.
• It works in a time constraint environment.
• Most of the embedded system avoids mechanical moving parts because of friction
& due to friction losses are their & hence probability of accuracy decreases.
• Embedded systems have low cost due to mars production.
2.1.6 Cell-phone: very common example of embedded system
Basis components are:
• Keys
• LCD
• Memory Backup
• Some control unit
2.1.7 Applications of Embedded Systems
10
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 11/48
• Consumer electronics, e.g., cameras, camcorders,
• Consumer products, e.g., washers, microwave ovens, ...
• Automobiles (anti-lock braking, engine control...)
•
Industrial process controllers & avionics/defense• Computer/Communication products, e.g. printers, FAX Machine
• Emerging multimedia applications e.g. cell phones, personal digital assistants…
2.1.8 Difference between Embedded System & General Computing
Platform
• An embedded system will have very few resources compared to general purpose
computing systems like a desktop computer.
• The memory capacity and processing power in an embedded system is limited
where as it is more challenging to develop an application in embedded system due
to its constricted environment as compared to developing the same for a desktop
system.
2.2 Micro-Controller
2.2.1 Types of Micro-controllers
• 4 – Bit microcontroller
• 8 – Bit microcontroller
• 16 – Bit microcontroller
• 32 – Bit microcontroller
2.2.1.1 4 – Bit Microcontrollers
• Most popular microcontroller made in terms of production numbers
• Application: appliances and toys
• Economical
11
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 12/48
2.2.1.2 8 – Bit Microcontrollers
• Represent a transition zone between dedicated, high-volume, 4-bit micr
controllers and the high performance 16 bit microcontroller
•
8 – Bit word size adequate for many computing tasks and control or monitoringapplications.
• Application: simple appliance control, high-speed machine control, dat
collection
2.2.1.3 16 – Bit Microcontrollers
• Provide faster response and more sophisticated calculations
• Applications: control of servomechanism like robot arm
2.2.1.4 32 – Bit Microcontrollers
• Design emphasis is more on high speed computation features and not on chip
features like RAM, ROM, Timers, etc
• Applications: robotics, highly intelligent instrumentation, avionics, image
processing.
• Processing, telecommunications, automobiles, etc
Let’s focus on 8051 family of
• Introduced by Intel Corporation in 1981 as MCS– 51
• Intel allowed other manufacturers to make and market any version of 8051
depending upon the speed and on chip ROM
• All versions code compatible
• Other members of the 8051 family: 8052, 8031
2.2.2 COMPARISON OF 8051 FAMILY MEMBERS
Feature 8051 8031
ROM 4K
12
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 13/48
RAM(bytes) 128 128
Timers 2
I/O Pins 32
Serial Port 1
Interrupt Sources 6 6
2.2.3 VERSIONS OF 8051 μC
2.2.3.1 8751 microcontroller
4K bytes of on chip UV-EPROM require PROM burner, as Ill as UV-EPROM to erase its
contents and takes 20 min erase cycle.
2.2.3.2 AT89C51 from Atmel Corporation
On chip ROM flash memory, erase cycle in seconds, furnish fast development.
2.2.3.3 OTP (one time programmable) version of the 8051
For mass production, low cost. 8051 family from Philips One of the largest selections of
8051 microcontrollers, various features like ADC, DAC, extended I/O, both OTP and
flash.
13
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 14/48
CHAPTER 3
TECHNOLOGY INVOLVED
3. 1 Darlington Pair
A Darlington pair is two transistors that act as a single transistor but with a much higher
current gain. Transistors have a characteristic called current gain. This is referred to asits hFE. The amount of current that can pass through the load when connectedto a
transistor that is turned on equals the input current x the gain of the transistor (hFE).
The current gain varies for different transistor and can be looked up in the data sheet for
the device. Typically it may be 100. This would mean that the current available to drivethe load would be 100 times larger than the input to the transistor.
In some application the amount of input current available to switch on a transistor is verylow. This may mean that a single transistor may not be able to pass sufficient current
required by the load. As stated earlier this equals the input current x the gain of the
transistor (hFE). If it is not be possible to increase the input current then we need toincrease the gain of the transistor. This can be achieved by using a Darlington Pair.
A Darlington Pair acts as one transistor but with a current gain that equals:
Total current gain (hFE total) = current gain of transistor 1 (hFE t1) x current gain of transistor 2 (hFE t2)
So for example if you had two transistors with a current gain (hFE) = 100:
(hFE total) = 100 x 100
(hFE total) = 10,000You can see that this gives a vastly increased current gain when compared to a single
transistor. Therefore this will allow a very low input current to switch a much bigger load
current.
Base Activation Voltage
Normally to turn on a transistor the base input voltage of the transistor will need to begreater that 0.7V. As two transistors are used in a Darlington Pair this value is doubled.
Therefore the base voltage will need to be greater than 0.7V x 2 = 1.4V.
14
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 15/48
It is also worth noting that the voltage drop across collector and emitter pins of the
Darlington Pair when the turn on will be around 0.9V Therefore if the supply voltage is
5V (as above) the voltage across the load will be will be around 4.1V (5V – 0.9V)
Fig 3.1.1: Diagram of Darlington Pair
3.2 RELAYS
3.2.1 SPDT Relays:
(Single Pole Double Throw Relay) an electromagnetic switch, consist of a coil (terminals85 & 86), 1 common terminal (30), 1 normally closed terminal (87a), and one normally
open terminal (87) (Figure 1).
When the coil of an SPDT relay (Figure 1) is at rest (not energized), the common
terminal (30) and the normally closed terminal (87a) have continuity. When the coil is
energized, the common terminal (30) and the normally open terminal (87) havecontinuity.
The diagram below center (Figure 2) shows an SPDT relay at rest, with the coil notenergized. The diagram below right (Figure 3) shows the relay with the coil energized.
As you can see, the coil is an electromagnet that causes the arm that is always connectedto the common (30) to pivot when energized whereby contact is broken from the
normally closed terminal (87a) and made with the normally open terminal (87).
When energizing the coil of a relay, polarity of the coil does not matter unless there is a
diode across the coil. If a diode is not present, you may attach positive voltage to either terminal of the coil and negative voltage to the other, otherwise you must connect
positive to the side of the coil that the cathode side (side with stripe) of the diode is
connected and negative to side of the coil that the anode side of the diode is connected.
15
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 16/48
Fig 3.2.1: Pin Diagram of SPDT Relays
3.2.2 Use of Relays
Anytime you want to switch a device which draws more current than is provided by an
output of a switch or component you'll need to use a relay. The coil of an SPDT or an
SPST relay that we most commonly use draws very little current (less than 200milliamps) and the amount of current that you can pass through a relay's common,
normally closed, and normally open contacts will handle up to 30 or 40 amps.
This allows you to switch devices such as headlights, parking lights, horns, etc., with low
amperage outputs such as those found on keyless entry and alarm systems, and other
components. In some cases you may need to switch multiple things at the same time
using one output. A single output connected to multiple relays will allow you to open
continuity and/or close continuity simultaneously on multiple wires.
3.3 AT89S52 Microcontroller
3.3.1 Pin Description
VCC
Supply voltage.
GNDGround
Port 0
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink
eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high
impedance inputs. Port 0 can also be configured to be the multiplexed low order Address/data bus during accesses to external Program and data memory in this mode, P0
has internal Pull ups. Port 0 also receives the code bytes during Flash programming and
outputs the code bytes during program verification. External pull-ups are required during
program verification.
Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers
can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled highby the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are
16
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 17/48
externally being pulled low will source current (IIL) because of the internal pull-ups. In
addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input
(P1.0/T2) and the Timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown inthe following table. Port 1 also receives the low-order address bytes during Flash
programming and verification.
Port Pin Alternate Functions
• P1.0 T2 (external count input to Timer/Counter 2), clock-out
• P1.1 T2EX (Timer/Counter 2 capture/reload trigger and direction control)
• P1.5 MOSI (used for In-System Programming)
• P1.6 MISO (used for In-System Programming)
• P1.7 SCK (used for In-System Programming)
Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull ups. The Port 2 output bufferscan sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high
by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are
externally being pulled low will source Current (IIL) because of the internal pull-ups Port
2 emits the high-order address byte during fetches from external program memory andduring accesses to external data memory that use 16-bit addresses (MOVX @ DPTR). In
this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to
external data memory that uses 8-bit addresses (MOVX @ RI); Port 2 emits the contentsof the P2 Special Function Register. Port 2 also receives the high-order address bits and
some control signals during Flash programming and verification.
Port 3
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output bufferscan sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high
by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are
externally being pulled low will source current (IIL) because of the pull-ups. Port 3 alsoserves the functions of various special features of the AT89S52, as shown in the
following table. Port 3 also receives some control signals for Flash programming and
verification
Port Pin Alternate Functions
• P3.0 RXD (serial input port)
• P3.1 TXD (serial output port)
• P3.2 INT0 (external interrupt 0)
• P3.3 INT1 (external interrupt 1)
• P3.4 T0 (timer 0 external input)
17
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 18/48
• P3.5 T1 (timer 1 external input)
• P3.6 WR (external data memory write strobe)
• P3.7 RD (external data memory read strobe)
RST
Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device. This pin drives High for 96 oscillator periods after the Watchdog timesout. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In
the default state of bit DISRTO, the RESET HIGH out feature is enabled.
ALE/PROG
Address Latch Enable (ALE) is an output pulse for latching the low byte of the address
during accesses to external memory. This pin is also the program pulse input (PROG)during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6
the oscillator frequency and may be used for external timing or clocking purposes. Note,however, that one ALE pulse is skipped during each access to external data memory. If
desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit
set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin isweakly pulled high. Setting the ALE-disable bit has no Effect if the microcontroller is in
external execution mode.
PSEN
Program Store Enable (PSEN) is the read strobe to external program memory. When theAT89S52 is executing code from external program memory, PSEN is activated twice
each machine cycle, except that two PSEN activations are skipped during each access to
external data memory.
EA/VPP
External Access Enable EA must be strapped to GND in order to enable the device to
fetch code from external program memory locations starting at 0000H up to FFFFH.
Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset.
EA should be strapped to VCC for internal program executions. This pin also receives the12-volt programming enable voltage (VPP) during Flash Programming.
XTAL1Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2Output from the inverting oscillator amplifier.
18
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 19/48
3.3.2 PIN DIAGRAM
19
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 20/48
Fig 3.3.1: Pin Diagram of AT89S52
3.4 TSOP
3.4.1. Description
20
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 21/48
The TSOP17.. – series are miniaturized receivers for infrared remote control systems.
PIN diode and preamplifier are assembled on lead frame, the epoxy package is designedas IR filter. The demodulated output signal can directly be decoded by a microprocessor.
TSOP17.. is the standard IR remote control receiver series, supporting all major
transmission codes.
3.4.2 Available types for different carrier frequencies
Type fo Type
TSOP1730 30 kHz TSOP1733
TSOP1736 36 kHz TSOP1737 TSOP1738 38 kHz TSOP1740
TSOP1756 56 kHz
3.4.3 Features
• 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)
• Suitable burst length .10 cycles/burst
3.4.4 Block Diagram
Fig: 3.4.1. Block Diagram of TSOP
21
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 22/48
Fig 3.4.2: IR Receiver Module
22
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 23/48
CHAPTER-4
TESTING
4.1 HARDWARE TESTING
4.1.1 WITHOUT IC
Power off testing: in this testing module I have checked continuity to all the peripherals
mounted on the PCB i.e. if there is any loose connection or breakage in betweenconnections then it must be repaired.
Continuity in between:
• Controller & L293D
• Controller & HT12D
• Controller and LCD
•Controller with Buzzer
• All the components connected to IC’s
• Keys must be short on pressing
• When key pressed then it short with encoder pin
• Signal goes from encoder to decoder also non distorted
• Output of decoder in BCD form supplied to LED’s so, that connection also tight
Power on testing: in this module all the frequencies, voltages, ground, +ve, -ve points
checked i.e. is all the requirements are fulfilled or not i.e. voltages & frequencies suppliedor generated by supply is right or not. In this:
Vcc=5v
Gnd=0vReset=0v initial & 5v pressed
4.1.2 WITH IC
With IC testing, power on testing type, in which IC also mounted on its base & supply
connected to main. In this some parameters are observed which are mentioned as below:
Vcc=5vGnd=0v
Reset= low-high-low
Crystal Oscillator: in this there are 2 parameters as below Voltage & Frequency.Voltage at 18 & 19 pin <=2v
Frequency=11.0592MHz
23
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 24/48
4.2 SOFTWARE TESTING
This is that testing module in which the hardware components are tested by runningsoftware on them to check only the connections and hardware. The different hardware
tested in this module is given as with their software’s:
4.2.1 Relay TestingRelays are used to drive the appliances. To check this hardware, software is as follows:
RELAY TESTING
#include <reg51.h>sbit relay1=P2^3;
sbit relay2=P2^2;
sbit relay3=P2^1;
sbit relay4=P2^0;
sbit ir=P3^2;//-------------------------
void delay_us(unsigned int);//-----------------------------
//---------------------
void main()
{
relay1=0;
relay2=0;relay3=0;
relay4=0;while(1){
relay1=~relay1;
delay_us(50000);
}
}void delay_us(unsigned int us)
{
TMOD=0x01;
us=65535-us;TH0=us/255;
TL0=us%255;
TR0=1;while(TF0==0);
TF0=0;
TR0=0;}
24
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 25/48
4.2.2. Remote TestingWe are using an IR Remote. To decode the IR signal we use CRO connected with TSOP
and testing phenomenon is as follows:
LO
L1
M0
M1
R1
R0
25
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 26/48
U0
U1
D0
D1
P0
P1
T10
26
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 27/48
T11
T20
T21
T30
T31
Total pulse code duration of each switch is 24ms.
No of pulse are 14.So each pulse period is 24000/14=1714.25uS.
27
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 28/48
In this remote, it is using Biphase-S line coding.
So for decoding of same line coding we have to check the middle of each half pulse if
both are same than consider as “1” logic other wise “0” logic.
Half pulse is 857us.Middle of each half pulses is 857/2=428uS.
It means we have to check the first signal at 428-430uS duration.
Than every 857uS
If switch is continuously press than duration of pulse coding is 85mS.
Middle 0 x x 0 0 0 0 1 1 0 1 1 1 0
Upper 0 x x 0 0 0 0 1 1 0 0 0 0 1
Lower 0 x x 0 0 0 0 1 1 0 0 0 1 0
Right 0 x x 0 0 0 0 0 1 1 0 0 0 1
Left 0 x x 0 0 0 0 0 1 1 0 0 1 0
Power 0 x x 0 0 0 0 0 0 1 0 1 0 1
T0 0 x x 0 0 0 0 0 0 1 0 1 1 0
T1 0 x x 0 0 0 0 1 0 0 1 0 0 1
T2 0 x x 0 0 0 0 1 0 0 1 1 0 0
28
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 29/48
Middle 01 x x 10 10 10 10 11 00 10 11 00 11 01
Upper 01 x x 10 10 10 10 11 00 10 10 10 10 11
Lower 01 x x 10 10 10 10 11 00 10 10 10 11 01
Right 01 x x 10 10 10 10 10 11 00 10 10 10 11
Left 01 x x 10 10 10 10 10 11 00 10 10 11 01
Power 01 x x 10 10 10 10 10 10 11 01 00 10 11T0 01 x x 10 10 10 10 10 10 11 01 00 11 01
T1 01 x x 10 10 10 10 11 01 01 00 10 10 11
T2 01 x x 10 10 10 10 11 01 01 00 11 01 01
Middl e 1011 0011 0100 1101 0101 01xx xx10 B34D500
Upper 1101 0101 0100 1101 0101 01xx xx10 D54D500Lower 1011 0101 0100 1101 0101 01xx xx10 B54D500
Left 1011 0101 0011 0101 0101 01xx xx10 B535500
Right 1101 0101 0011 0101 0101 01xx xx10 D535500
Power 1101 0010 1101 0101 0101 01xx xx10 D2D5500
T0 1011 0010 1101 0101 0101 01xx xx10 B2D5500T1 1101 0100 1010 1101 0101 01xx xx10 D4AD500
T2 1010 1100 1010 1101 0101 01xx xx10 ACAD500
29
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 30/48
CHAPTER-5
SNAPSHOTS
5.1 BLOCK DIAGRAM
A
T
8
9
S
5
2
SENSOR
RELAY 3
RELAY 2
POWER
REGULATOR
RELAY 1
30
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 31/48
5.2 CIRCUIT DIAGRAM OF THE PROJECT
5.2.1 Circuit Diagram of Controller
31
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 32/48
5.2.2 Circuit Diagram of Darlington Pair
5.2.3 Circuit Diagram of TSOP
5.3 SNAPSHOTS
32
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 33/48
5.3.1 Project at ON State
5.3.2 When Relay 1 is ON
33
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 34/48
5.3.3 When Relay 2 is ON
34
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 35/48
5.3.4 When Relay 3 is ON
35
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 36/48
5.3.5 When Relay 4 is ON
36
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 37/48
5.3.6 When Relays are OFF
37
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 38/48
5.3.7 Remote Used
CHAPTER-6
6.1 APPLICATIONS OF PROJECT
38
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 39/48
As stated above that I have made a project on remote control this controls home
appliances. This project has many applications in today life as mentioned below:
• Controlling home appliances for power saving operations.
• It creates automatic controlling the power in the field of switching the appliances.
• This project can be used as a domestic robot for small kind of work.
• This is very useful for handicapped and aged people.
6.2 FURTHER WORK
There is another 3 steps which are applicable over this project they are as mentioned as
below:
• It can be wireless by using Bluetooth
• It can also be connect with the mobile phone to make it completely wireless i.e.
now it connects with home telephone line and when ever there is call happening
by a particular mobile then the mobile no. traces by controller if it is right then the
procedure further proceeds and got the instructions by mobile.
• It can also be connect with the computer to receive the signals from system and
hence the project will work according to them.
CHAPTER-7
REFERENCE
39
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 40/48
To complete this project successfully I need to refer with many websites and books some
of them are as mentioned below:
Web links:
•http://www.google.com/
• http://www.alldatasheet.com/
• http://www.alldatasheet.com/view.jsp?Searchword=at89s52
• http://pdf1.alldatasheet.com/datasheet-pdf/view/82390/ATMEL/AT89S52.html
• http://www.the12volt.com/relays/relays.asp
• http://www.google.co.in/images?
hl=en&resnum=0&q=darlington+pair&um=1&ie=UTF-8&source=univ&ei=Ui4GTNqWE46wrAfb39jDDA&sa=X&oi=image_result_gro
up&ct=title&resnum=4&ved=0CDAQsAQwAw
• http://www.kitronik.co.uk/pdf/darlingtonpair.pdf
• http://en.wikipedia.org/wiki/Darlington_transistor
• http://www.alldatasheet.com/view.jsp?Searchword=TSOP1738
• http://pdf1.alldatasheet.com/datasheet-
pdf/view/127448/VISHAY/TSOP1738KA1.html
• http://www.google.co.in/search?
hl=en&q=ir+receiver+tsop1738&btnG=Search&aq=3&aqi=g-e2g3g-s1g4&aql=&oq=ir+receiver+&gs_rfai=
• http://www.physicsforums.com/showthread.php?t=230079
• http://pdf1.alldatasheet.com/datasheet-pdf/view/257587/WINGS/7805A.html
•
http://www.alldatasheet.com/datasheet-pdf/pdf/257587/WINGS/7805A.html
APPENDIX -I
CODING OF THE PROJECT
40
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 41/48
//=========================================================
#include <reg51.h>//---------------------
#define left_key 0x1B535500UL
#define right_key 0x1D535500UL#define upper_key 0x1D54D500UL
#define lower_key 0x1B54D500UL
#define middle_key 0x1B34D500UL#define power_key 0x1D2D5500UL
#define t1_key 0x1B2D5500UL
#define t2_key 0x1D4AD500UL#define t3_key 0x1ACAD500UL
//-----------------------------
//#define ircheck RA0
sbit relay1=P2^3;
sbit relay2=P2^2;sbit relay3=P2^1;
sbit relay4=P2^0;sbit ir=P3^2;
//---------------------------
void inti(void);void delay_us(unsigned int);
void ir_sence(void);
void remote_ok(void);
void remote_inc(void);void remote_dec(void);
void remote_left(void);void remote_right(void);void remoteelse(void);
//---------------------------
unsigned long data_ir=0;unsigned char relay1_status=0;
unsigned char relay2_status=0;
unsigned char relay3_status=0;unsigned char relay4_status=0;
//-------------------------
void main()
{inti();
while(1)
{while(ir);
ir_sence();
}}
41
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 42/48
//-----------------------initialisation---------------
void inti(void)
{ //make i/o lines accordingly,relay1=0;
relay2=0;
relay3=0;relay4=0;
}
//-------------------------------------------------------void remote_inc()
{
if(relay1_status==0)
{ relay1=1; relay1_status=1;}else
{ relay1=0; relay1_status=0;}
}
//-----------------------------------------------void remote_dec()
{if(relay2_status==0)
{ relay2=1; relay2_status=1;}
else
{ relay2=0; relay2_status=0;}}
//----------------------------------------------
void remote_left(){
if(relay3_status==0)
{ relay3=1; relay3_status=1;}else
{ relay3=0; relay3_status=0;}
}//-----------------------------------------------
void remote_right()
{
if(relay4_status==0){ relay4=1; relay4_status=1;}
else
{ relay4=0; relay4_status=0;}}
//-----------------------------------------------
void remote_ok(){
relay1=0;
relay2=0;
relay3=0;
42
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 43/48
relay4=0;
}
//------------------------------------------------void remoteelse()
{
delay_us(50000);delay_us(50000);
delay_us(50000);
}//-----------------------------------
void delay_us(unsigned int us)
{
TMOD=0x01;us=65535-us;
TH0=us/256;
TL0=us%256;
TR0=1;while(!TF0);
TF0=0;TR0=0;
}
////---------------------------------------------------
//void isr(void) interruptvoid ir_sence(void)
{
// if(INTF==1)// {
// GIE=0;// intruppt diable
//INTE=0;data_ir=0;
delay_us(400); //data1
// ircheck=1;if(ir) data_ir|=0x01;
else data_ir|=0;
delay_us(10);
// ircheck=0;
delay_us(700);//data2
// ircheck=1;if(ir) data_ir|=0x02;
else data_ir|=0;
delay_us(10);// ircheck=0;
delay_us(700);//data3
// ircheck=1;
43
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 44/48
if(ir) data_ir|=0x04;
else data_ir|=0;
delay_us(10);// ircheck=0;
delay_us(700);//data4// ircheck=1;
if(ir) data_ir|=0x08;
else data_ir|=0;delay_us(10);
// ircheck=0;
delay_us(700);//data5// ircheck=1;
if(ir) data_ir|=0x010;
else data_ir|=0;
delay_us(10);// ircheck=0;
delay_us(700);//data6
// ircheck=1;
if(ir) data_ir|=0x020;
else data_ir|=0;delay_us(10);
// ircheck=0;
delay_us(700);//data7
// ircheck=1;
if(ir) data_ir|=0x040;else data_ir|=0;
delay_us(10);
// ircheck=0;
delay_us(700);//data8
// ircheck=1;
if(ir) data_ir|=0x080;else data_ir|=0;
delay_us(10);
// ircheck=0;
delay_us(700);//data9
// ircheck=1;if(ir) data_ir|=0x0100;
else data_ir|=0;
delay_us(10);
// ircheck=0;
44
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 45/48
delay_us(700);//data10
// ircheck=1;if(ir) data_ir|=0x0200;
else data_ir|=0;
delay_us(10);// ircheck=0;
delay_us(700);//data11// ircheck=1;
if(ir) data_ir|=0x0400;
else data_ir|=0;
delay_us(10);// ircheck=0;
delay_us(700);//data12
// ircheck=1;if(ir) data_ir|=0x0800;
else data_ir|=0;delay_us(10);
// ircheck=0;
delay_us(700);//data13// ircheck=1;
if(ir) data_ir|=0x01000;
else data_ir|=0;delay_us(10);
// ircheck=0;
delay_us(700);//data14
// ircheck=1;
if(ir) data_ir|=0x02000;else data_ir|=0;
delay_us(10);
// ircheck=0;
delay_us(700);//data15
// ircheck=1;
if(ir) data_ir|=0x04000;else data_ir|=0;
delay_us(10);
// ircheck=0;
delay_us(700);//data16
// ircheck=1;
if(ir) data_ir|=0x08000;
45
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 46/48
else data_ir|=0;
delay_us(10);
// ircheck=0;
delay_us(700);//data17
// ircheck=1;if(ir) data_ir|=0x010000;
else data_ir|=0;
delay_us(10);// ircheck=0;
delay_us(700);//data18
// ircheck=1;if(ir) data_ir|=0x020000;
else data_ir|=0;
delay_us(10);
// ircheck=0;
delay_us(700);//data19// ircheck=1;
if(ir) data_ir|=0x040000;
else data_ir|=0;
delay_us(10);// ircheck=0;
delay_us(700);//data20// ircheck=1;
if(ir) data_ir|=0x080000;
else data_ir|=0;delay_us(10);
// ircheck=0;
delay_us(700);//data21
// ircheck=1;
if(ir) data_ir|=0x0100000;
else data_ir|=0;delay_us(10);
// ircheck=0;
delay_us(700);//data22
// ircheck=1;
if(ir) data_ir|=0x0200000;else data_ir|=0;
delay_us(10);
// ircheck=0;
46
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 47/48
delay_us(700);//data23
// ircheck=1;
if(ir) data_ir|=0x0400000;else data_ir|=0;
delay_us(10);
// ircheck=0;
delay_us(700);//data24
// ircheck=1;if(ir) data_ir|=0x0800000;
else data_ir|=0;
delay_us(10);
// ircheck=0;
delay_us(700);//data25
// ircheck=1;
if(ir) data_ir|=0x01000000;else data_ir|=0;
delay_us(10);// ircheck=0;
delay_us(700);//data26
// ircheck=1;if(ir) data_ir|=0x02000000;
else data_ir|=0;
delay_us(10);// ircheck=0;
delay_us(700);//data27// ircheck=1;
if(ir) data_ir|=0x04000000;
else data_ir|=0;delay_us(10);
// ircheck=0;
delay_us(710);//data28// ircheck=1;
if(ir) data_ir|=0x08000000;
else data_ir|=0;delay_us(10);
// ircheck=0;
delay_us(750);//data29
// ircheck=1;
if(ir) data_ir|=0x10000000;
else data_ir|=0;
47
8/7/2019 A2Z IR REMOTE CONTROLLING DEVICE
http://slidepdf.com/reader/full/a2z-ir-remote-controlling-device 48/48
delay_us(10);
// ircheck=0;
delay_us(50000);
delay_us(50000);
delay_us(50000);delay_us(50000);
if((data_ir & 0xFFFFFF00)==upper_key) remote_inc(); //1else if((data_ir & 0xFFFFFF00)==lower_key) remote_dec(); //2
else if((data_ir & 0xFFFFFF00)==right_key) remote_right();
//3
else if((data_ir & 0xFFFFFF00)==left_key) remote_left(); //4else if((data_ir & 0xFFFFFF00)==middle_key) remote_ok(); //5
//else if((data_ir & 0xFFFFFF00)==power_key) remote_power();
//6
//else if((data_ir & 0xFFFFFF00)==t1_key) remote_line1(); //7//else if((data_ir & 0xFFFFFF00)==t2_key) remote_line2(); //8
//else if((data_ir & 0xFFFFFF00)==t3_key) remote_line2(); //9else remoteelse();
delay_us(50000);
delay_us(50000);
delay_us(50000);delay_us(50000);
// INTF=0;// GIE=1;
data_ir=0;
//}}
Recommended