A MINI PROJECT REPORT
ON
TV REMOTE AS CORDLESS MOUSE FOR COMPUTER
By
A.Sindhuja 11B81A04C7 P.Sneha Sree 11B81A04D4 M.Swathi
11B81A04F8
Department of Electronics & Communication EngineeringCVR
COLLEGE OF ENGINEERING(An Autonomous Institution, Affiliated to
JNTUH, Accredited by NBA, AICTE)Vastunagar, Mangalpalli(V),
Ibrahimpatnam(M), R.R.District, A.P2014
TV REMOTE AS CORDLESS MOUSE FOR COMPUTERA Mini Project Report
submitted in the partial fulfillment of Requirements for the award
of degree
BACHELOR OF TECHNOLOGYINELECTRONICS & COMMUNICATION
ENGINEERING
BY
A.Sindhuja 11B81A04C7P.Sneha Sree11B81A04D4 M.Swathi
11B81A04F8
UNDER THE SUPERVISION OFMs. Ms. Dhruva R.Rinku, M.Tech.Senior
Assistant Professor
Department of Electronics & Communication EngineeringCVR
COLLEGE OF ENGINEERING(An Autonomous Institution, Affiliated to
JNTUH, Accredited by NBA, AICTE)Vastunagar, Mangalpalli(V),
Ibrahimpatnam(M), R.R.District, A.PWeb: http://cvr.ac.in Email:
[email protected], [email protected]
Cherabuddi Education SocietysCVR COLLEGE OF ENGINEERING
ACCREDITED BY NATIONAL BOARD OF ACCREDITATION, AICTE(Approved by
A.I.C.T.E. & Govt. of Andhra Pradesh and Affiliated to JNT
University)Vastunagar, Mangalpalli (V), Ibrahimpatnam (M), R.R.
District, PIN 501 510Web: http://cvr.ac.in, email: [email protected]
Phones: Code within A.P.: 958414; Code from Outside: 08414 General:
252222, 252369 Office Telefax: 252396, Principal: 252396 (O)
Department of Electronics and Communication
EngineeringCERTIFICATEThis is to certify that the mini project
report entitled TV Remote as Cordless Mouse for Computer is
submitted byA.Sindhuja 11B81A04C7P.Sneha Sree11B81A04D4 M.Swathi
11B81A04F8
in partial fulfillment of requirement for the award of Bachelor
of Technology degree in Electronics and Communication Engineering
from JNTUH, Kukatpally, Hyderabad for the academic year
2014-15.
Ms.Dhruva R.Rinku, M.Tech. Dr. K. S. Nayanathara Project Guide
Head of the Department
ACKNOWLEDGEMENTFirst and foremost I express my deep sense of
gratitude to the Almighty which cannot be described in words, for
the blessings and strength the God has showered on me in fulfilling
my aspirations and shall always be looking to his blessings.
I wish to express my deepest gratitude and thanks to Principal
Prof. L.V.A.R. Sarma for his constant support and encouragement. At
the outset, I am very much indebted to the Management of CVR
COLLEGE OF ENGINEERING (CVRCE) for the valuable education imparted
to me in the successful completion of the
I would like to express my gratitude to Dr. K. S. Nayanathara,
Head of the Department, E.C.E, for No words can express my
gratitude to my Parents, without whose support and encouragement
this achievement would not have been possible. I also express my
thanks to my friends and well-wishers who have extended their
co-operation in this regard.
ABSTRACT The project is designed to use a TV remote as a
cordless mouse for the computer. A conventional PC/laptop uses a
mouse to operate and control all its applications. As a PC mouse is
wired to the system, one has to sit near the PC to operate it. This
becomes very tedious when the PC is used for presentation purposes
(when using a projector). In this proposed system TV remote can be
used as a cordless mouse, and the user need not operate the PC
sitting near it. A typical TV remote sends coded infrared data that
is read by an IR sensor interfaced to an 8051 family
microcontroller. This data so received by the microcontroller sends
it to the COM port of a PC through a level shifter IC. This IR code
is traditionally RC5 code as followed by some manufacturers.
Software named PC remote is used on the PC that recognizes data
received from the microcontroller through the COM port and performs
the required operation. Designated numbers on the TV remote are
used to perform up - down, right - left cursor movement. Features
like left click and right click of the mouse can also be performed
with of the TV remote .Further this project can be enhanced using
Bluetooth/ RF technology to overcome the traditional line of sight
communication drawbacks of the infrared type. NOTE: The project
works only on operating systems having hyper terminal (E.g. Windows
XP). The computer must have a RS232 serial port. A.Sindhuja.
(11B81A04C7) P.Sneha Sree. (11B81A04D4) M.Swathi. (11B81A04F8)
CONTENTS PAGE NO.1. INTRODUCTION 1.1 Introduction to Embedded
systems 091.2 Objective 101.3 Thesis Organisation 102. BLOCK
DIAGRAM EXPLANATION 2.1 Descriptioni. Power Supply 11 ii. Standard
Connections to 8051 Series Microcontroller 12 iii. Reset 12iv.
External Access 13v. MAX 232 13vi. Brief explanation of TSOP1738 13
3. HARDWARE REQUIREMENTS 3.1 Transformers 14 3.2 Voltage Regulator
(LM7805) 16 3.3 Filter 18 3.4 Rectifier 19 3.5 Microcontroller
(AT89S52/C51) 19 3.6 TSOP1738 26 3.7 MAX232 28 3.8 DB9 Connector 32
3.9 LED 33 3.10 Diode 1N4007 34 3.11 Resistors 35 3.12 Capacitors
36 4. SOFTWARE REQUIREMENTS4.1 IDE 374.2 Concept of Compiler 374.3
Concept of Cross Compiler 37 4.4 Building projects and Creating HEX
Files 37 4.5 CPU Simulation 384.6 PC Remote Software 38 5.
OPERATION 5.1 Connections 39 5.2 Working 39 5.3 Operation Procedure
39 6. HARDWARE TESTING 6.1 Continuity Test 406.2 Power on Test 407.
RESULTS 428. CONCLUSION 449. BIBLIOGRAPHY 45
45
LIST OF FIGURES PAGE NO 2. Block Diagram 113.1 A Typical
Transformer 143.2(a) Block Diagram of Voltage Regulator 17 3.2(b)
Rating of Voltage Regulator 173.5(a) Block Diagram of AT89S52
223.5(b) Pin Diagram of AT89S52 233.5(c) Oscillator Connections
253.6(a) TSOP1738 263.6(b) TSOP Block Diagram 273.7(a) Pin Diagram
of MAX232 30 3.8(a) DB9 Connector 323.9(a) Symbol of LED 34
1. INTRODUCTION
1.1 INTRODUCTION TO EMBEDDED SYSTEMSWhat is embedded system?An
Embedded System is a combination of computer hardware and software,
and perhaps additional mechanical or other parts, designed to
perform a specific function. An embedded system is a
microcontroller-based, software driven, reliable, real-time control
system, autonomous, or human or network interactive, operating on
diverse physical variables and in diverse environments and sold
into a competitive and cost conscious market.An embedded system is
not a computer system that is used primarily for processing, not a
software system on PC or UNIX, not a traditional business or
scientific application. High-end embedded & lower end embedded
systems. High-end embedded system - Generally 32, 64 Bit
Controllers used with OS. Examples Personal Digital Assistant and
Mobile phones etc .Lower end embedded systems - Generally 8,16 Bit
Controllers used with an minimal operating systems and hardware
layout designed for the specific purpose. Examples Small
controllers and devices in our everyday life like Washing Machine,
Microwave Ovens, where they are embedded in. CLASSIFICATION:1. Real
Time Systems.1. RTS is one which has to respond to events within a
specified deadline.1. A right answer after the dead line is a wrong
answer.RTS CLASSIFICATION:1. Hard Real Time Systems1. Soft Real
Time SystemHARD REAL TIME SYSTEM: "Hard" real-time systems have
very narrow response time. Example: Nuclear power system, Cardiac
pacemaker.
SOFT REAL TIME SYSTEM: "Soft" real-time systems have reduced
constrains on "lateness" but still must operate very quickly and
repeatable. Example: Railway reservation system takes a few extra
seconds the data remains valid.1.2. OBJECTIVEIn this technology
driven days everything is made easy and simple. The main objective
of this project is designed to control computer using TV
remote.1.3. THESIS ORGANISATION: The rest of the chapters in the
thesis organized as follows: Chapter 2 illustrates about the Block
diagram and explains all the blocks. Chapter 3 illustrates about
all the hardware components used in the project. Chapter 4
illustrates about the software requirements of the project. Chapter
5 illustrates about the operation and implementation of the
project. Chapter 6 explains the result of project.
2. BLOCK DIAGRAM
2.1 DESCRIPTION i. POWER SUPPLY:The circuit uses standard power
supply comprising of a step-down transformer from 230Vto 12V and 4
diodes forming a bridge rectifier that delivers pulsating dc which
is then filtered by an electrolytic capacitor of about 470F to
1000F. The filtered dc being unregulated, IC LM7805 is used to get
5V DC constant at its pin no 3 irrespective of input DC varying
from 7V to 15V. The input dc shall be varying in the event of input
ac at 230volts section varies from 160V to 270V in the ratio of the
transformer primary voltage V1 to secondary voltage V2 governed by
the formula V1/V2=N1/N2. As N1/N2 i.e. no. of turns in the primary
to the no. of turns in the secondary remains unchanged V2 is
directly proportional to V1.Thus if the transformer delivers 12V at
220V input it will give 8.72V at 160V.Similarly at 270V it will
give 14.72V.Thus the dc voltage at the input of the regulator
changes from about 8V to 15V because of A.C voltage variation from
160V to 270V the regulator output will remain constant at 5V. The
regulated 5V DC is further filtered by a small electrolytic
capacitor of 10F for any noise so generated by the circuit. One LED
is connected of this 5V point in series with a current limiting
resistor of 330 to the ground i.e., negative voltage to indicate 5V
power supply availability. The unregulated 12V point is used for
other applications as and when required.ii. STANDARD CONNECTIONS TO
8051 SERIES MICRO- CONTROLLER: ATMEL series of 8051 family of micro
controllers need certain standard connections. The actual number of
the Microcontroller could be 89C51 , 89C52, 89S51, 89S52, andas
regards to 20 pin configuration a number of 89C2051. The 4 set of
I/O ports are used based on the project requirement. Every
microcontroller requires a timing reference for its internal
program execution therefore an oscillator needs to be functional
with a desired frequency to obtain the timing reference as t =1/f.
A crystal ranging from 2 to 20 MHz is required to be used at its
pin number 18 and 19 for the internal oscillator. It may be noted
here the crystal is not to be understood as crystal oscillator It
is just a crystal, while connected to the appropriate pin of the
microcontroller it results in oscillator function inside the
microcontroller. Typically 11.0592 MHz crystal is used in general
for most of the circuits using 8051 series microcontroller. Two
small value ceramic capacitors of 33pF each is used as a standard
connection for the crystal as shown in the circuit diagram.iii.
RESET:Pin no 9 is provided with a re-set arrangement by a
combination of an electrolytic capacitor and a register forming RC
time constant. At the time of switch on, the capacitor gets
charged, and it behaves as a full short circuit from the positive
to the pin number 9.After the capacitor gets fully charged the
current stops flowing and pin number 9 goes low which is pulled
down by a 10k resistor to the ground. This arrangement of reset at
pin 9 going high initially and then to logic 0 i.e., low helps the
program execution to start from the beginning. In absence of this
the program execution could have taken place arbitrarily anywhere
from the program cycle. A pushbutton switch is connected across the
capacitor so that at any given time as desired it can be pressed
such that it discharges the capacitor and while released the
capacitor starts charging again and then pin number 9 goes to high
and then back to low, to enable the program execution from the
beginning. This operation of high to low of the reset pin takes
place in fraction of a second as decided by the time constant R and
C.iv. External Access(EA): Pin no 31 of 40 pin 8051 microcontroller
termed as EA is required to be connected to 5V for accessing the
program form the on-chip program memory. If it is connected to
ground then the controller accesses the program from external
memory. However as we are using the internal memory it is always
connected to +5V. v. MAX232: The MAX232 used in the project is an
integrated circuit that converts signals from an RS-232 serial port
to signals suitable for use in TTL compatible digital logic
circuits like microcontroller. The MAX232 is a dual driver/receiver
and typically converts the RX, TX, CTS and RTS signals.vi. BRIEF
EXPLANATION OF TSOP 1738: TheTSOP 1738is a member ofIR remote
control receiverseries. This IR sensor module consists of a PIN
diode and a pre amplifier which are embedded into a single package.
The output ofTSOPis active low and it gives +5V in off state. When
IR waves, from a source, with a center frequency of 38 kHz incident
on it, its output goes low.TSOP modulehas an inbuilt control
circuit for amplifying the coded pulses from the IR transmitter. A
signal is generated when PIN photodiode receives the signals. This
input signal is received by an automatic gain control (AGC). For a
range of inputs, the output is fed back to AGC in order to adjust
the gain to a suitable level. The signal from AGC is passed to a
band pass filter to filter undesired frequencies. After this, the
signal goes to a demodulator and this demodulated output drives an
npn transistor. The collector output of the transistor is obtained
at pin 3 of TSOP module.
3. HARDWARE REQUIREMENTS
HARDWARE COMPONENTS:1. TRANSFORMER (230 12 V AC)2. VOLTAGE
REGULATOR (LM 7805)3. FILTER4. RECTIFIER5. MICROCONTROLLER
(AT89S52/AT89C51) 6. TSOP17387. MAX2328. DB9 CONNECTOR9. LED10.
1N400711. RESISTORS12. CAPACITORS3.1 TRANSFORMER: Transformers
convert AC electricity from one voltage to another with a little
loss of power. Step-up transformers increase voltage, step-down
transformers reduce voltage. Most power supplies use a step-down
transformer to reduce the dangerously high voltage to a safer low
voltage.
FIG 3.1: A TYPICAL TRANSFORMER
The input coil is called the primary and the output coil is
called the secondary. There is no electrical connection between the
two coils; instead they are linked by an alternating magnetic field
created in the soft-iron core of the transformer. The two lines in
the middle of the circuit symbol represent the core. Transformers
waste very little power so the power out is (almost) equal to the
power in. Note that as voltage is stepped down and current is
stepped up. The ratio of the number of turns on each coil, called
the turns ratio, determines the ratio of the voltages. A step-down
transformer has a large number of turns on its primary (input) coil
which is connected to the high voltage mains supply, and a small
number of turns on its secondary (output) coil to give a low output
voltage. TURNS RATIO = (Vp /Vs) = ( Np / Ns )Where,
Vp = primary (input) voltage.Vs = secondary (output) voltageNp =
number of turns on primary coilNs = number of turns on secondary
coilIp = primary (input) current Is= secondary (output)
current.Ideal power equation:
The ideal transformer as a circuit elementIf the secondary coil
is attached to a load that allows current to flow, electrical power
is transmitted from the primary circuit to the secondary circuit.
Ideally, the transformer is perfectly efficient; all the incoming
energy is transformed from the primary circuit to the magnetic
field and into the secondary circuit. If this condition is met, the
incoming electric power must equal the outgoing power:
3.2 VOLTAGE REGULATOR 7805:Features: Output Current up to 1A.
Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V. Thermal
Overload Protection. Short Circuit Protection. Output Transistor
Safe Operating Area Protection.
Circuit DiagramDescription:The LM78XX/LM78XXA series of
three-terminal positive regulators are available in the
TO-220/D-PAK package and with several fixed output voltages, making
them useful in a Wide range of applications. Each type employs
internal current limiting, thermal shutdown and safe operating area
protection, making it essentially indestructible. If adequate heat
sinking is provided, they can deliver over 1A output Current.
Although designed primarily as fixed voltage regulators, these
devices can be used with external components to obtain adjustable
voltages and currents.
Internal Block Diagram:
FIG 3.2(a): BLOCK DIAGRAM OF VOLTAGE REGULATORAbsolute Maximum
Ratings TABLE 3.2(b): RATINGS OF THE VOLTAGE REGULATOR
3.3 RECTIFIER:A rectifier is an electrical device that converts
alternating current (AC), which periodically reverses direction, to
direct current (DC), current that flows in only one direction, a
process known as rectification. Rectifiers have many uses including
as components of power supplies and as detectors of radio signals.
Rectifiers may be made of solid state diodes, vacuum tube diodes,
mercury arc valves, and other components. The output from the
transformer is fed to the rectifier. It converts A.C. into
pulsating D.C. The rectifier may be a half wave or a full wave
rectifier. In this project, a bridge rectifier is used because of
its merits like good stability and full wave rectification. In
positive half cycle only two diodes( 1 set of parallel diodes) will
conduct, in negative half cycle remaining two diodes will conduct
and they will conduct only in forward bias only.
3.4 FILTER:
Capacitive filter is used in this project. It removes the
ripples from the output of rectifier and smoothens the D.C. Output
received from this filter is constant until the mains voltage and
load is maintained constant. However, if either of the two is
varied, D.C. voltage received at this point changes. Therefore a
regulator is applied at the output stage.The simple capacitor
filter is the most basic type of power supply filter. The use of
this filter is very limited. It is sometimes used on extremely
high-voltage, low-current power supplies for cathode-ray and
similar electron tubes that require very little load current from
the supply. This filter is also used in circuits where the
power-supply ripple frequency is not critical and can be relatively
high. Below figure can show how the capacitor charges and
discharges.
3.5 MICROCONTROLLER AT89S52:The AT89S52 is a low-power,
high-performance CMOS 8-bit microcontroller with 8K bytes of
in-system programmable Flash memory. The device is manufactured
using Atmels high-density non-volatile memory technology and is
compatible with the industry standard 80C51 instruction set and pin
out. The on-chip Flash allows the program memory to be reprogrammed
in-system or by a conventional non-volatile memory programmer. By
combining a versatile 8-bit CPU with in-system programmable Flash
on a monolithic chip, the Atmel AT89S52 is a powerful
microcontroller which provides a highly-flexible and cost-effective
solution to many embedded control applications. Features:
Compatible with MCS-51 Products 8K Bytes of In-System Programmable
(ISP) Flash Memory Endurance: 10,000 Write/Erase Cycles 4.0V to
5.5V Operating Range Fully Static Operation: 0 Hz to 33 MHz
Three-level Program Memory Lock 256 x 8-bit Internal RAM 32
Programmable I/O Lines Three 16-bit Timer/Counters Eight Interrupt
Sources Full Duplex UART Serial Channel Low-power Idle and
Power-down Modes Interrupt Recovery from Power-down Mode Watchdog
Timer Dual Data Pointer Power-off Flag Fast Programming Time
Flexible ISP Programming (Byte and Page Mode) Green
(Pb/Halide-free) Packaging Option
Block Diagram of AT89S52: Fig 3.5: Block Diagram Of AT89S52
Pin Configurations of AT89S52:
FIG 3.5(b): PIN DIAGRAM OF AT89S52
Pin Description:
VCC: Supply voltage.GND:Ground.
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. 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. 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).Port 2:Port 2 is
an 8-bit bidirectional I/O port with internal pull-ups. The Port 2
output buffers can sink/source four TTL inputs. 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
contents of the P2 Special Function Register.Port 3:Port 3 is an
8-bit bidirectional I/O port with internal pull-ups. The Port 3
output buffers can sink/source four TTL inputs. Port 3 pins that
are externally being pulled low will source current (IIL) because
of the pull-ups.RST:Reset input. A high on this pin for two machine
cycles while the oscillator is running resets the device.
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. However, that one ALE pulse is skipped during
each access to external data memory.PSEN:Program Store Enable
(PSEN) is the read strobe to external program memory. When the
AT89S52 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 the 12-volt programming enable
voltage (VPP) during Flash programming.XTAL1:Input to the inverting
oscillator amplifier and input to the internal clock operating
circuit.XTAL2:Output from the inverting oscillator
amplifier.Oscillator Characteristics: XTAL1 and XTAL2 are the input
and output, respectively, of an inverting amplifier which can be
configured for use as an on-chip oscillator. Either a quartz
crystal or ceramic resonator may be used. To drive the device from
an external clock source, XTAL2 should be left unconnected while
XTAL1 is driven.
FIG 3.5(c): Oscillator
Idle Mode: In idle mode, the CPU puts itself to sleep while all
the on chip peripherals remain active. The mode is invoked by
software. The content of the on-chip RAM and all the special
functions registers remain unchanged during this mode. The idle
mode can be terminated by any enabled interrupt or by a hardware
reset.Power down Mode: In the power down mode the oscillator is
stopped, and the instruction that invokes power down is the last
instruction executed. The on-chip RAM and Special Function
Registers retain their values until the power down mode is
terminated. The only exit from power down is a hardware reset. 3.6
TSOP1738:Description: The TSOP17 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. TSOP1738 is the standard IR remote control receiver
series, supporting all major transmission codes.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/burstFIG 4.6(a) TSOP 1738
Block diagram of TSOP:
The circuit of the TSOP17 is designed in that way that
unexpected output pulses due to noise or disturbance signals are
avoided. A band pass filter, an integrator stage and an automatic
gain control are used to suppress such disturbances. The
distinguishing mark between data signal and disturbance signal are
carrier frequency, burst length and duty cycle. The data signal
should full fill the following condition: Carrier frequency should
be close to center frequency of the band pass (e.g. 38kHz). Burst
length should be 10 cycles/burst or longer. After each burst which
is between 10 cycles and 70 cycles a gap time of at least 14 cycles
is necessary. For each burst which is longer than 1.8ms a
corresponding gap time is necessary at some time in the data
stream. This gap time should have at least same length as the
burst. Up to 1400 short bursts per second can be received
continuously. Some examples for suitable data format are: NEC Code,
Toshiba Micom Format, Sharp Protocol, RC5 Protocol, RC6 Protocol,
R2000 Protocol, Sony Format (SIRCS). When a disturbance signal is
applied to the TSOP17.It can still receive the data signal. However
the sensitivity is reduced to that level that no unexpected pulses
will occur. Some examples for such disturbance signals which are
suppressed by the TSOP17 series are: DC light (e.g. from tungsten
bulb or sunlight) Continuous signal at 38 kHz or at any other
frequency In this project we use RC5 protocol which converts the
information from remote into pulses and modulates it and sends to
microcontroller. The RC5 - code has an instruction set of 2048
different instructions and is divided into 32 addresses (5 bits) of
each 64 instructions or commands (6 bits). The transmitted code is
a data word that consists of 14 bits and is defined as:2 start bits
(ss) for the automatic gain control in the infrared receiver.ss =
10 (Add 64 to command)ss = 11 (Use command as it is)The command set
can be increased by 64 commands by using a modified start bit 10
instead of 11 using the second start bit as7th command bit. 1
toggle bit (change every time when a new button is pressed on the
IR transmitter) 5 address bits for the system address. 6
instruction bits for the command or key pressed.The RC5 code uses
the Bi-Phase modulation technique, meaning that a single bit is
split up into two half bits:0 -> 101 -> 01The duration time
of each bit is equal to 1.778ms containing32 pulses with a
repetition rate of 36 kHz, the carrier frequency of this code. The
total time of a fullRC5 code is 24.889ms. The space between two
transmitted codes is 50 bit times or 88.889ms. The carrier
frequency is used to enable a narrow band reception to improve the
noise rejection. The carrier frequency of the RC5 code is 36 kHz.
The complete signal is repeated every 114ms as long as the command
button is still pressed. The toggle bit is changing its polarity
each time the button is pressed.
3.7 MAX232:The MAX232 is an integrated circuit that converts
signals from an RS-232 serial port to signals suitable for use in
TTL compatible digital logic circuits. The MAX232 is a dual
driver/receiver and typically converts the RX, TX, CTS and RTS
signals.The drivers provide RS-232 voltage level outputs (approx.
7.5V) from a single +5V supply via on-chip charge pumps and
external capacitors. This makes it useful for implementing RS-232
in devices that otherwise do not need any voltages outside the 0V
to +5V range, as power supply design does not need to be made more
complicated just for driving the RS-232 in this case. The receivers
reduce RS-232 inputs (which may be as high as 25V), to standard 5V
TTL levels. These receivers have a typical threshold of 1.3V, and a
typical hysteresis of 0.5V.The later MAX232A is backwards
compatible with the original MAX232 but may operate at higher baud
rates and can use smaller external capacitors (0.1F) in place of
the 1.0F capacitors used with the original device. The newer
MAX3232 is also backwards compatible, but operates at a broader
voltage range, from 3 to 5.5V.
Voltage levels:It is helpful to understand what occurs to the
voltage levels. When a MAX232 IC receives a TTL level to convert,
it changes a TTL Logic 0 to between +3 and +15V, and changes TTL
Logic 1 to between -3 to -15V, and vice versa for converting from
RS232 to TTL. This can be confusing when you realize that the RS232
Data Transmission voltages at a certain logic state are opposite
from the RS232 Control Line voltages at the same logic state. To
clarify the matter, see the table below. For more information see
RS-232 Voltage Levels.
FIG3.7(a):Pin Diagram of MAX-232Pin Description:
Application:The MAX232 has two receivers (converts from RS-232
to TTL voltage levels) and two drivers (converts from TTL logic to
RS-232 voltage levels). This means only two of the RS-232 signals
can be converted in each direction.
Typically a pair of a driver/receiver of the MAX232 is used for
TX and RX And the second one for CTS and RTS. There are not enough
drivers/receivers in the MAX232 to also connect the DTR, DSR, and
DCD signals. Usually these signals can be omitted when e.g.
communicating with a PC's serial interface. If the DTE really
requires these signals either a second MAX232 is needed, or some
other IC from the MAX232 family can be used.
3.8 DB9 CONNECTOR:The DB9 (originally DE-9) connector is an
analog 9-pin plug of the D-Sub miniature connector family (D-Sub or
Sub-D). The DB9 connector is mainly used for serial connections,
allowing for the asynchronous transmission of data as provided for
by standard RS-232 (RS-232C).
Fig 3.8: DB9 CONNECTORPin description:
This is a common connector used in many computer, audio/video,
and data applications. The official name is D-sub miniature, but
many people call it D-sub or just DB. The connector gets its name
from its trapezoidal shape that resembles the letter D. Most DB
connectors have two rows of pins. Common types of D-sub connectors
are DB9 and DB25, used on PCs for serial and parallel ports.
Interfacing Between Microcontroller and Db9 Connector:
3.9 LED:
A light-emitting diode (LED) is a semiconductor light source.
LEDs are used as indicator lamps in many devices, and are
increasingly used for lighting. When a light-emitting diode is
forward biased (switched on), electrons are able to recombine with
holes within the device, releasing energy in the form of photons.
This effect is called electroluminescence and the color of the
light (corresponding to the energy of the photon) is determined by
the energy gap of the semiconductor. An LED is often small in area
(less than 1mm2), and integrated optical components may be used to
shape its radiation pattern. LEDs present many advantages over
incandescent light sources including lower energy consumption,
longer lifetime, improved robustness, smaller size, faster
switching, and greater durability and reliability. Light-emitting
diodes are used in applications as diverse as replacements for
aviation lighting, automotive lighting as well as in traffic
signals. The compact size, the possibility of narrow bandwidth,
switching speed, and extreme reliability of LEDs has allowed new
text and video displays and sensors to be developed, while their
high switching rates are also useful in advanced communications
technologyElectronic Symbol:
Fig 3.9(a): symbol of LED
3.10 Diode 1N4007 Diodes are used to convert AC into DC these
are used as half wave rectifier or full wave rectifier. Three
points must he kept in mind while using any type of diode. 1.
Maximum forward current capacity 2. Maximum reverse voltage
capacity 3. Maximum forward voltage capacity
Fig: 1N4007 diodesThe number and voltage capacity of some of the
important diodes available in the market are as follows: Diodes of
number IN4001, IN4002, IN4003, IN4004, IN4005, IN4006 and IN4007
have maximum reverse bias voltage capacity of 50V and maximum
forward current capacity of 1 Amp.
Fig:PN Junction diode3.11 RESISTORS:A resistor is a two-terminal
electronic component designed to oppose an electric current by
producing a voltage drop between its terminals in proportion to the
current, that is, in accordance with Ohm's law: V = IRResistors are
used as part of electrical networks and electronic circuits. They
are extremely common in most electronic equipment. Practical
resistors can be made of various compounds and films, as well as
resistance wire (wire made of a high-resistivity alloy, such as
nickel/chrome).The primary characteristics of resistors are their
resistance and the power they can dissipate. Other characteristics
include temperature coefficient, noise, and inductance.
A resistor is a two-terminal passive electronic component which
implements electrical resistance as a circuit element. When a
voltage V is applied across the terminals of a resistor, a current
I will flow through the resistor in direct proportion to that
voltage. The reciprocal of the constant of proportionality is known
as the resistance R, since, with a given voltage V, a larger value
of R further "resists" the flow of current I as given by Ohm's
law
Units:The ohm (symbol: ) is the SI unit of electrical
resistance, named after Georg Simon Ohm. An ohm is equivalent to a
volt per ampere 3.12 CAPACITORS: A capacitor or condenser is a
passive electronic component consisting of a pair of conductors
separated by a dielectric. When a voltage potential difference
exists between the conductors, an electric field is present in the
dielectric. This field stores energy and produces a mechanical
force between the plates. The effect is greatest between wide,
flat, parallel, narrowly separated conductors.An ideal capacitor is
characterized by a single constant value, capacitance, which is
measured in farads. This is the ratio of the electric charge on
each conductor to the potential difference between them.
Charge separation in a parallel-plate capacitor causes an
internal electric field. A dielectric (orange) reduces the field
and increases the capacitance.
4. SOFTWARE REQUIREMENTS:4.1 INTRODUCTION TO KEIL MICRO VISION
(IDE): Keil an ARM Company makes C compilers, macro assemblers,
real-time kernels, debuggers, simulators, integrated environments,
evaluation boards, and emulators for ARM7/ARM9/Cortex-M3,
XC16x/C16x/ST10, 251, and 8051 MCU families. Keil development tools
for the 8051 Microcontroller Architecture support every level of
software developer from the professional applications engineer to
the student just learning about embedded software development. Keil
is a cross compiler. 4.2 CONCEPT OF COMPILER:Compilers are programs
used to convert a High Level Language to object code. Desktop
compilers produce an output object code for the underlying
microprocessor, but not for other microprocessors i.e the programs
written in one of the HLL like Cwill compile the code to run on the
system for a particular processor like x86 (underlying
microprocessor in the computer). The compiler derives its name from
the way it works, looking at the entire piece of source code and
collecting and reorganizing the instruction. However compilers
require some time before an executable program emerges. Now as
compilers translate source code into object code, which is unique
for each type of computer, many compilers are available for the
same language.4.3 CONCEPT OF CROSS COMPILER:A cross compiler is
similar to the compilers but we write a program for the target
processor (like 8051 and its derivatives) on the host processors
(like computer of x86). It means being in one environment you are
writing a code for another environment is called cross development.
And the compiler used for cross development is called cross
compiler.So the definition of cross compiler is a compiler that
runs on one computer but produces object code for a different type
of computer.
4.4 Building Projects and Creating a HEX Files:Typical, the tool
settings under Options Target are all you need to start a new
application. You may translate all source files and line the
application with a click on the Build Target toolbar icon. When you
build an application with syntax errors, Vision2 will display
errors and warning messages in the Output Window Build page. A
double click on a message line opens the source file on the correct
location in a Vision2 editor window. Once you have successfully
generated your application you can start debugging. After you have
tested your application, it is required to create an Intel HEX file
to download the software into an EPROM programmer or simulator.
Vision2 creates HEX files with each build process when Create HEX
files under Options for Target Output is enabled. You may start
your PROM programming utility after the make process when you
specify the program under the option Run User Program #1.4.5 CPU
Simulation:Vision2 simulates up to 16 Mbytes of memory from which
areas can be mapped for read, write, or code execution access. The
Vision2 simulator traps and reports illegal memory accesses. In
addition to memory mapping, the simulator also provides support for
the integrated peripherals of the various 8051 derivatives. The
on-chip peripherals of the CPU you have selected are configured
from the Device. 4.6 PC REMOTE SOFTWARE: PC Remote software is an
easy to use and reliable application that can provide you with
remote access to a computer allowing you to control its actions.
With the help of this software all the instruction related to mouse
in computer operating system are interfaced with sensor and
microcontroller and work on the information sent by the remote. It
has some built in methods and instructions which helps the remote
act as mouse.
5. OPERATION5.1 Connections:The output of power supply which is
5v is connected to the 40th pin of microcontroller &Gnd is
connected to 20th pin of microcontroller. Pin 3.0 of port 3 of
microcontroller are connected to pins 11 & 12 of Max232.Pins 13
and 14 of Max232 are given to pins 2 and 3 of DB9 connector. Pin
3.3 of port 3 of microcontroller are given to 3rd pin of
TSOP1738.
5.2 Working: The project uses an IR receiver such as TSOP1738
that responds to only specific frequency of 38 kHz, in order to
avoid receiving false signal from normal environmental infrared
sources. The output of this receiver is interfaced to interrupt 1
i.e., pin 13 of the microcontroller. A standard TV remote that
delivers infrared codes at 38 kHz is thus received by the TSOP
receiver feeding a 14 bit data so emitted from the remote to the
controller through receiver. The program is so returned that it
recognizes the 14 bit data relating to a particular number being
pressed at the remote.Here the TV remote buttons are used for
sending specific 14 bit data to pin 13 of port 3.3. Software used
at the PC receives these commands through the serial port being
connected to the MC through MAX232, RS232 interface. Thus the TV
remote works like a mouse from a distance.5.3 Operation Proceedure:
Run PC control software Select com1 and select enable option 2 = up
arrow 5 = down arrow 4 = left arrow 6 = right arrow 1 = left click
3 = right click Volume+ = to increase cursor speed Volume- = to
decrease cursor speed
6. HARDWARE TESTING6.1 CONTINUITY TEST:In electronics, a
continuity test is the checking of an electric circuit to see if
current flows (that it is in fact a complete circuit). A continuity
test is performed by placing a small voltage (wired in series with
an LED or noise-producing component such as a piezoelectric
speaker) across the chosen path. If electron flow is inhibited by
broken conductors, damaged components, or excessive resistance, the
circuit is "open".Devices that can be used to perform continuity
tests include multi meters which measure current and specialized
continuity testers which are cheaper, more basic devices, generally
with a simple light bulb that lights up when current flows.An
important application is the continuity test of a bundle of wires
so as to find the two ends belonging to a particular one of these
wires; there will be a negligible resistance between the "right"
ends, and only between the "right" ends.This test is the performed
just after the hardware soldering and configuration has been
completed. This test aims at finding any electrical open paths in
the circuit after the soldering. Many a times, the electrical
continuity in the circuit is lost due to improper soldering, wrong
and rough handling of the PCB, improper usage of the soldering
iron, component failures and presence of bugs in the circuit
diagram. We use a multi meter to perform this test. We keep the
multi meter in buzzer mode and connect the ground terminal of the
multi meter to the ground. We connect both the terminals across the
path that needs to be checked. If there is continuation then you
will hear the beep sound.6.2 POWER ON TEST:This test is performed
to check whether the voltage at different terminals is according to
the requirement or not. We take a multi meter and put it in voltage
mode. Remember that this test is performed without microcontroller.
Firstly, we check the output of the transformer, whether we get the
required 12 v AC voltage.
Then we apply this voltage to the power supply circuit. Note
that we do this test without microcontroller because if there is
any excessive voltage, this may lead to damaging the controller. We
check for the input to the voltage regulator i.e., are we getting
an input of 12v and an output of 5v. This 5v output is given to the
microcontrollers 40th pin. Hence we check for the voltage level at
40th pin. Similarly, we check for the other terminals for the
required voltage. In this way we can assure that the voltage at all
the terminals is as per the requirement.
7. RESULTSThis figure gives the view of the circuit after all
the connections are made.
This figure gives the view of the circuit when power is supplied
to circuit.
This figure illustrates the first stage of running PC Remote
software i.e. selecting one of the available COM Ports.
This figure illustrates the second stage of running software
i.e. enabling the COM Port.
This figure illustrates the completion of running software and
now if we want to stop software simply we need to select
disable.
8. CONCLUSION Thus, by using this project TV remote can be used
as a cordless mouse for Computer by using TV remote software. The
information from remote is sensed by an IR sensor and is converted
into microcontroller compatible format and the computer is
interfaced to the sensor. The software makes all the instructions
of the mouse in kernel compatible to remote instructions. By
pressing some buttons in mouse the following actions take place: 2
= up arrow 5 = down arrow 4 = left arrow 6 = right arrow 1 = left
click 3 = right click Volume+ = to increase cursor speed Volume- =
to decrease cursor speed
13. BIBLIOGRAPHYTEXT BOOKS REFERED:
1. The 8051 Microcontroller and Embedded systems by Muhammad Ali
Mazidi and Janice Gillispie Mazidi, Pearson Education.2. ATMEL
89S52 Data Sheets.
WEBSITES
www.atmel.com www.beyondlogic.org www.wikipedia.org
www.howstuffworks.com www.alldatasheets.com