report on pc control using tv remot

47
A Project Report On Controlling PC using TV remote Submitted By: PATEL KEYUR K. (07/EC/60) PATEL ALAY G. (07/EC/51) Internal Guide: Mr. HITESH PATEL V.T.Patel Department of Electronics & Communication Engineering CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Upload: keyur-patel

Post on 02-Apr-2015

1.396 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Report on PC Control Using Tv Remot

A Project Report

On

Controlling PC using TV remote

Submitted By:

PATEL KEYUR K. (07/EC/60)

PATEL ALAY G. (07/EC/51)

Internal Guide:

Mr. HITESH PATEL

V.T.Patel Department of

Electronics & Communication Engineering

CHAROTAR INSTITUTE OF TECHNOLOGY -CHANGA

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 2: Report on PC Control Using Tv Remot

ACKNOWLEDGEMENT

I take this opportunity to thank my respected H.O.D. Mr. JAYMIN BHALANI and Mr. HITESH PATEL without whose support and encouragement, this project could not have been completed.

I also take this opportunity to thank my other faculty members and friends who have helped me in gathering and organizing the required information.

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 3: Report on PC Control Using Tv Remot

CERTIFICATE

This is to certify that NAME OF THE STUDENTS (Roll No) of final

year EC Semester VIII have/has completed their project on

TITLE OF PROJECT

Towards partial fulfillment of the requirement for

the award of the Bachelor Of Engineering for the

course of Electronics & Communication degree of

Gujarat University For the term ending May-2009

Sign:Internal GuideGuide Name

Sign:H.O.D.

Mr. Jaymin BhalaniV.T. Patel Dept. of Electronics &

Communication Engineering

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 4: Report on PC Control Using Tv Remot

ABSTRACT

This final report is established to fulfill the Final year Project/Thesis requirement for Engineering for final semester student, a standard guideline is prepared to standardize various documentations and this report is done mainly to list down all the important aspect of the project or the electrical and electronic device that designed.

We introduce a method of how electronics devices and machines can be controlled remotely from an operator/user. As a practical model we design a microcontroller 8051 based receiver circuit may connected to Personal computer. This project is an implementation of RC5-remote reception on an 8051 microcontroller. The received code is decoded and sent to the PC IR remote software developed using high level graphical programming language (Visual Basic). The cursor position is moved according to the keys pressed.

The project report focuses on the system which is designed by using the Microcontroller AT89c2051. The infrared receiver have three pins in which two pins are for +5v supply and ground while the third pin is for data output. The Infrared Receiver is designed for demodulating the frequency of 30 kHz to 40 kHz, for example, TSOP1738 is designed for demodulating frequency of 38 kHz which is used in our project.

The IR receiver module receives the data sent by remote handset, amplifies, demodulates and converts it to MCU compatible voltage format and outputs it on its data output pin. The microcontroller decodes the infrared signal data and the microcontroller will sent the infrared Key code to the PC through the Serial port.

We use Microsoft Visual Basic 6.0 to receive the Key code through the Component called MSCOMM which is a component for the Com port control. Through this component we get the key code and do the appropriate functions.

After getting this key code of the Remote control the program compare the key code with the code present in the program and if they are equal then the corresponding function was done.

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 5: Report on PC Control Using Tv Remot

INDEX

1. INTRODUTION…………………………………………………………………............1Introduction to Project…………………………………………………………………....1Possible Design…………………………………………………………………………...1Application Of Project…………………………………………………………………....2

2. HARDWARE…………………………………………………………………………....3Block Diagram…………………………………………………………………………...3Flow Chart……………………………………………………………………………….4Used Component and Description……………………………………………………….4

1. List of Component Used………………………………………………………52. Description………….…………………………………………………………7

Calculation…………………………….………………………………………………..14 Circuit Diagram……………………….………………………………………………..15 Circuit Operation……………………….……………………………………………....16 Trouble shooting……………….……….………………………………………………16

3. SOETWARE……………………………………………………………………………21Flow Chart of Details…………………………………………………………………...21Software Details………………………………………………………………………...22

1. Initialization………………………………………………………………….222. Defined Serial Interrupts…………………………………………………......223. Generating Delay……………………………………………………………..234. Compare With RC-5 Protocol……………………………………………......235. Transmit………………………………………………………………………24

Main Program……………………………………………………………………………24

1. ASSEMBLY CODE…………………………………………………………242. VB CODE……………………………………………………………………29

4. USER GUIDE…….……………………………………………………………………45 Operating Manual………………….…………………………………………………...45 Specification of Project………….……………………………………………………..45

5. LIMITATIONS…………………………………………………………………………46

6. COST OF PROJECT……………………...………………………………………….....47 Cost of Practical Work……………………………………………………………….....47 Miscellaneous Cost……………………………………………………………………..47

CONCLUSION………………………………………………………………………...48

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 6: Report on PC Control Using Tv Remot

FUTURER SCOPE……………………………………………………………………49

APPENDIX-1…………………………………………………………………………50

APPENDIX-2…………………………………………………………………………63

LIST OF FIGURES

1.2 PIC Microcontroller 18f452……………………………………………………………12.1 Block Diagram2.2 Flowchart2.3 Block diagram of power supply2.4 Resistor2.5 Symbol of Capacitor2.6 IR Sensor2.7 MAX 2322.8 RS 232 Connector2.9 Serial Communication with Modem2.10 DB9: View Looking Into Male Connector2.11 DB9: View Looking Into Female Connector2.12 Symbol of Crystal Oscillator2.13 Circuit Diagram 2.14 TV Remote2.15 RC-5 Protocols2.16 IR sensor2.17 Microcontroller2.18 Pin diagram of RS2323.1 Software Flowchart

LIST OF TABLE

Table 2.1 Resistor Color Code

LIST OF SYMBOLS/ABBREVATION1. RAM-Random Access Memory2. ROM- Read Only Memory3. I/O- Input/output4. XTAL- CRYSTAL5. AM- Amplitude Modulation

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 7: Report on PC Control Using Tv Remot

CHAPTER 1-INTRODUCTION

1.1-INTRODUCTION OF THE PROJECT

In this modern age, we are using different remote control for controlling different electronic devices. But everyone in this world wants to operate the different devices with the help of one remote control. For this purpose we use the microcontroller. One of them is the 8051 microcontroller family.

This project is an implementation of RC5 – remote reception on an 8051 microcontroller. The received code is decoded and sent it to the PC IR remote software written in Visual Basics via serial communication. Then it will be processed in the pc remote software. The cursor position is moved according to the keys pressed. There are to modes of operation one is as mouse control and second is Windows media control. When using multimedia pc we can perform volume control, stop, and play/pause type of different operations using TV remote as a mouse. This project can be extended to control all function of pc by remote.

1.2-POSSIBLE DESIGNS

The same device can also be developed in other manners also. Some possible ways are mentioned below:

PIC microcontroller 18f452

Fig 1.2 PIC Microcontrollers 18f452

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 8: Report on PC Control Using Tv Remot

1.3– APPLICATION OF PROJECTThe following functions can be done with PC Remote control.

All Numerical Keys (0-9)

Arithmetic Keys (+,-,/,*)

Enter, Escape, Help , Refresh , Caps lock , Tab , Back space , delete , Left ,Right , up down arrows , Page up, Page down ,Windows keys.

Calculator , Notepad

CD drive Open/Close

Control panel

Computer log off, reboot or shutdown

Volume Up ,Down , Mute

5 User defined Programs

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 9: Report on PC Control Using Tv Remot

CHAPTER 2- HARDWARE

2.1- BLOCK DIAGRAM:

Here is the basic block diagram of our project which illustrates the theme of our project.

Fig 2.1 Block Diagram

The fig2.1 shows the block diagram of the controlling pc using TV remote. From this fig we know that in this first the data are transmitted through the remote. After this data are decoder with the help of 89c2051 microcontroller. After this the decoder value is sent through the pc via serial communication port. Then according this the function is processed through the software using pc remote control software.

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Data is

transmitted

through remote

Data Transmitt

ed are decoded in 8051in microcont

roller

Decoded value is

sent to pc through serial

communication

Procss in the pc remote control

software

Page 10: Report on PC Control Using Tv Remot

2.2 FLOW CHART:

Fig 2.2 Flow chart of hardware working

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Select the mode of operation

Press remote key

Receive IR code

Decoded IR code

Generate proper signal level

Receive in PC common port

Execute using software in PC

Page 11: Report on PC Control Using Tv Remot

From this flow chart we can say that first we have to select the mode with the help of the TV. After this the key will be pressed. Then the infrared rays will be transmitted. These rays will be detected by the infrared sensor which is the receiver circuit. Then this data will be passed to the microcontroller. Microcontroller AT89c2051 decoded this data and transmit the data to the serial communication port. Serial communication port RS232 will transmit the decoded data which is received from the microcontroller. Then this data will perform the function which is defined in the program. Now program will precede the data and perform the function. In this manner we can control the pc using the TV remote.

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 12: Report on PC Control Using Tv Remot

2.3 USED COMPONENTS AND DESCRIPTION:

2.3.1 LIST OF COMPONENT USED:

2.3.1.1 POWER SUPPLY:

CAPACITOR:1. 1000mF/16V electrolytic2. 100nF polyester (2 nos.)3. 100nF/16V electrolytic

DIODE:1. 1N4004 or bridge of passages 50V-1A (4 nos.)

VOLTAGE REGULATOR:1. LM7805

TRANSFORMER:1. 220V/12V- 10V

2.3.1.2 CIRCUIT:

RESISTOR:1. 10K

CAPACITOR:1. 10 µf (5 Nos.)2. 33 pF (2 Nos.)3. 100 nF

IR SENSOR:1. TSOP 1736

MAX 232 RS 232 CONNECTOR

CRYSTAL OSCILLATOR (XTAL):1. 11.0592 MHz

AT89C2051 MICROCONTOLLER

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 13: Report on PC Control Using Tv Remot

2.3.1.1 POWER SUPPLY:

Description:

Above fig shows the block diagram of power supply. 230V power supply input is given to the transformer. Transformer steps down this voltage to 9V. Now this step down ac voltage is given to the rectifier to make it dc. Here bridge Rectifier is used to convert this ac voltage to the dc voltage. The o/p of the bridge rectifier contains ripples so these ripples can be removed by voltage using filter. Capacitor is used as a filter. Capacitor is connected at the rectifier o/p. and a dc voltage is obtained across the capacitor. Now this filter o/p and a dc regulator voltage are obtained across the capacitor . IC regulator regulates the dc voltage to the desired voltage. Here fixed voltage regulator fixes the output voltage to the given value.

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 14: Report on PC Control Using Tv Remot

2.2.1.2 DESCRIPTION OF THE CIRCUIT COMPONENTS

2.3.1.2.1 RESISTOR

Resistor is a component that resists the flow of direct or alternating electric circuit. Resistors can limit or divide the current, reduce the voltage, protect an electric circuit, or provide large amount of heat or light. An electric current is the movement of charged particles called electrons from one region to another. Resistors are usually placed in electric circuits.

Physicists explain the flow of current through a material, such as a resistor, by comparing it to water flowing through a pipe. Resistors are designed to have a specific value of resistance. Resistors used in electric circuits are cylindrical. They are often color coded by three or four color bands that indicate the specific value of resistance. Resistors obey the ohm’s law, which states that the current density is directly proportional to the electric field when the temperature is constant.

How to identify the resistance value from color bands:

Hold the resistor as shown below:

Three bands that are close together are to the left.

Then colors of;

Band no.1 signifies the 1st digit

Band no.2 signifies the 2nd digit

Band no.3 the multiplier.

Band no.4 the tolerance.

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 15: Report on PC Control Using Tv Remot

Band Color Significant Digit Multiplier ToleranceBlack 0 1Brown 1 10Red 2 100Orange 3 1kYellow 4 10kGreen 5 100kBlue 6 1MViolet 7 10MGrey 8 -White 9 -Gold - 0.1 5%Silver - 0.01 10%No Band - - 20%

Table: 2.1 Resistor Color Code

2.3.1.2.2 CAPACITOR:

Capacitors store electric charge. They are used with resistors in the timing circuits because it takes time for a capacitor to fill with charge. They are used to smooth varying DC supplies by acting as a reservoir of charge. They are also used in filter circuits because capacitors easily pass AC signals but they block DC signals.

Fig. 2.5 Symbol of Capacitor

Capacitance is a charge of a capacitor’s ability to store charge. A large capacitance means that more charge can be stored. Capacitance is measured in farads, symbol F. However 1F is very large, so prefixes are used to show the smaller values.

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 16: Report on PC Control Using Tv Remot

Three prefixes (multipliers) are used, µ (micro), n (nano) and p (pico):

µ means 10-6 (millionth), so 1000000µF = 1F n means 10-9 (thousand-millionth), so 1000nF =1µF p means 10-12 (million-millionth), so 1000pF =1 F

2.3.1.2.3 Infrared Sensor (IR sensor – TSOP 1736):

An infrared sensor is a device that can detect infrared light which is below the optical spectrum for use to a purpose. Most of the remote controls for TVs and other entertainment equipment use infrared energy as the transmission medium to carry information between the controls and to be operated. Infrared sensors also have important scientific, military, security and rescue whose magnitude is 38 kHz, distance may be 10 meters.

Fig. 2.6 IR Sensor

2.3.1.2.4 MAX 232:

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.

Fig. 2.7 MAX 232

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 17: Report on PC Control Using Tv Remot

2.3.1.2.3 RS 232:

In telecommunications, RS-232 (Recommended Standard 232) is a standard for serial binary data signals connecting between a DTE (Data Terminal Equipment) and a DCE (Data Circuit Terminating Equipment). It is a commonly used in computer serial ports. An RS-232 port can supply only limited power to another device. The number of output lines, the type of interface driver IC, and the state of the output lines are important considerations.

Fig. 2.8 RS 232 Connector

In serial communication the terminal end (PC) is called the Data Terminal Equipment (DTE) and the modem is called the Data Communication Equipment (DCE) as shown in the diagram below.

Fig 2.9 Serial Communication with modem

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 18: Report on PC Control Using Tv Remot

RS-232 signals have a direction (in or out) depending on whether they are with respect to a DTE or a DCE. In the entire pin out diagrams below the signal direction is with respect to the DTE (PC).

Fig. 2.10 DB9: View looking into male connector

Fig 2.11 DB9: View looking into female connector

2.3.1.2.6 CRYSTAL OSCILLATOR (XTAL – 11.0592 MHz):

A crystal oscillator is an electronic circuit that uses the mechanical resonance of a vibrating crystal of piezoelectric material to create an electric signal with a very precise frequency. This frequency is commonly used to keep track of time, to provide a stable clock signals for digital integrated circuits, and to stabilize frequencies for radio transmitters and receivers. The most common type of piezoelectric resonator used is the quartz crystal, so oscillator circuits designed around them were called “crystal oscillator”. Quartz crystals are manufactured for frequencies from tens of megahertz.

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 19: Report on PC Control Using Tv Remot

Fig 2.12 Symbol of Crystal Oscillator

The crystal used in the circuit is AB-11.0592MHz-B2 often called Oscillators, which have mounting type is through hole. Its Oscillating Frequency is 11.059200MHz and its operating temperature is + 20ppm. It has operating mode fundamentally and its operating temperature is -200 C (minimum) to 700C (maximum).

Crystal 1: Input to inverting oscillator amplifier and input to the internal clock generator circuits.

Crystal 2: Output from the inverting oscillator amplifier.

Oscillator characteristics: XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier. The pins can be configured of use an On-chip oscillator. To drive the device from an external clock source, XTAL1 should be driven while XTAL2 is left unconnected except that two PSEN activations are skipped during each access to external data memory.

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 20: Report on PC Control Using Tv Remot

2.3.1.2.7 AT89C2051 MICROCONTROLLER:

The AT89C2051 is a low voltage, high performance CMOS 8-bit microcomputer with 2K bytes of Flash programmable and high density nonvolatile memory (PEROM). The device is manufactured using Atmel’s high–density nonvolatile set. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C2051 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications.

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 21: Report on PC Control Using Tv Remot

2.4 CALCULATIONS:

This project is working on the RC-5 protocol. In this project, we are transmitting data via serial communication. For this we have to define the BAUD RATE for the serial communication. The Equation for this is given below.

When SMOD=0, 8051 divides 1/2 of the crystal frequency by 32 and uses that frequency for

timer1 to set the BAUD RATE. In our case CRYSTAL FREQUENCY=11.0592MHz,

Machine cycle frequency =11.0592MHz/12 = 92106 kHz

92106/32=28,000 Hz since SMOD=1.

This is the frequency used by the Timer 1 to set the baud rate.

In our case SMOD is 0 so baud rates for this 9600.

2.5 CIRCUIT DIAGRAM:

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 22: Report on PC Control Using Tv Remot

2.6 CIRCUIT OPERATION

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 23: Report on PC Control Using Tv Remot

In this circuit mainly operation is divided into three different parts. The different parts are listed below.

(1) Transmitting data via remote(2) Decoding data(3) Decoder data transmit to the pc via serial communication port

2.6.1 TRANSMITTING DATA VIA TV REMOTE

In this circuit, for transmitting data we are using Phillips remote. Because Phillips remote are working on the RC-5 protocol. In this project we are working on the rc-5 protocol.

Fig. 2.14 Phillips Remote (RC5 protocol)

This is one of the Phillips remote which is working on the RC-5 protocol. The function of the rc-5 protocol is describe below First of all, Phillips adopted or created the RC5 standard that uses fixed bit length and fixed quantity of bits. Each time you pass a button at the Phillips remote control, it sends a train of 14 bits, 1.728ms per bit, the whole train is repeated every 130ms if you keep the button pressed. Each bit is sliced in two halves. The left and right half opposed levels. If the bit to be transmitted is one (1), its left side is zero while its right side is one. If the bit to be transmitted is zero (0), its left side is one while the right side is zero. The left and right half has opposed levels. If the bit to be transmitted is one (1), its left side is zero while its right side is zero. It means that the second half of the bit is actually the same meaning of the bit to be

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 24: Report on PC Control Using Tv Remot

transmitted, as you can see at the shaded blue right side of the bit as on, means bit transmitted =1. If you want to measure the

Correct logic level directly from the Receiver Output, you should measure at the first half of the bit. The correct interpretation is that it changes level exactly at the middle of bit time. At the IR Receiver output a bit Zero changes level from Up to Low. There are a minimum quantity of incoming 27µs pulses to the demodulator understand it is at the right frequency and then drop its output. The quantity of pulses used at a bit “0” to be transmitted it means 32 square pulses of 27µs each , then 32×27µs of silence. The bit “1” is the opposite, 32×27µs of silence followed by 32 square pulses of 27µs. Our job here will be to decode the receiving of the changing at the middle of the bit, if going down, means bit 0, going up, means bit 1.RC5 is a standard infrared data communication protocol used in remotes. This protocol was developed by Philips. It has 2048 different commands which are divided into 32 addresses each of 64 commands.

RC5 Bit Logic

RC5 standard uses fix bit length and fixed of bits. It uses bi phase modulation technique i.e. each bit consists of two parts and has a level transition and a ‘0’ is defined by high to low transition. The duration of each bit is equal to 1.778ms since the RC5 protocol consists of 14 bits so the total duration is approximately 24.8ms. The carrier frequency used for transmitting is 36 KHz.

As stated earlier this protocol consists of 14 bits as follows:

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 25: Report on PC Control Using Tv Remot

Fig 2.15 RC5 Protocol

The first two bits are the start bits used for Automatic Gain Calibration (AGC) of the receiver. These bits are basically two HIGH bits. The third bit is TOGGLE BIT or CHECK BIT, this bit toggles every time a new button is pressed. The next 5 bits ADDRESS BITS each device has a specific address. This is used to identify which kind of device executes the command bits. The next 6 bits are COMMAND BITS. These bits are used to give instruction to the address device i.e. what action to perform. Since the carrier frequency of the RC5 code is 36 kHz we require a receiver with a response frequency of 36 kHz. One such receiver is VISHAY’S TSOP1836. It is basically a 3 pin device and gives demodulated output signal which can directly be decoded by the microcontroller.

2.6.2 DECODING DATA

With the help of TV remote we can send the data to the receiver circuit. The infrared sensor will take the data circuit is working on the 36 kHz frequency. So the decoding process is done through two different parts.

Infrared Sensor Microcontroller AT89C2051 Decode data transmitted via serial communication

2.6.2.1 INFRARED SENSOR

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 26: Report on PC Control Using Tv Remot

Fig. 2.16 Infrared sensor

In this circuit we are using the infrared sensor tsop1736. It has working on the 36 kHz carrier frequency. The demodulated output signals can directly be decoded by a microprocessor. TSOP1736 is the standard IR remote control receiver series, supporting all major transmission codes. The receiver code is sent to the at89c2051 microcontroller. In this project we are using rc-5 protocol in which we are using 36 kHz carrier frequency. So for this project tsop1736 is more compatible than anything else.

2.6.2.2 MICRO CONTROLLER AT89C2051:

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 27: Report on PC Control Using Tv Remot

Fig. 2.17 Microcontroller AT89c2051

The AT89C2051 is a low voltage, high-performance CMOS 8-bit microcomputer with 2K Bytes of Flash programmable and erasable read only memory (PEROM). The AT89C2051 provides the following standard features: 2K Bytes of Flash, 128bytes of RAM, 15 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex serial port, a precision analog comparator, on chip oscillator and clock circuitry. In addition, the AT89C2051 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. When we are transmitting data from remote it will be sensed and demodulated by the infrared sensor. After this the data will be transmitted to the microcontroller AT89C2051. Now the data will be decoded with the help of the microcontroller. In this project we are using port 3.3 which is used as an interrupt 1. Also we are using port 20 which is voltage supply pin. The operating range of this microcontroller is 2.5v to 6v. So, we are giving voltage supply of 5v. Clock pulses are given by the crystal. For this we are using 11.0592 MHz crystal. We need a specific frequency so we have to use an 11.0592 MHz crystal. With the help of the receiver and transmit pin we are using to received the data and transmit the data. Microcontroller will decode data will be sent to the RS 232. In this manner data will be sent to the serial communication port.

2.6.3 DECODE DATA TRANSMITTED VIA SERIAL COMMUNICATION:

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 28: Report on PC Control Using Tv Remot

The decoded data will be transmitter from the microcontroller and received by the serial communication port. The data will be transmitted to the PC via communication port. For this project we are using 9 pin R232 (db9).

This is the basic diagram of the RS232. With the help of this port can do a serial communication port? In this we are doing universal asynchronous port (UART) mode.

2.7 TROUBLE SHOOTING OF CIRCUIT

2.7.1 POWER SUPPLY:

In power supply circuit make sure that your transformer gives exact output or not. If you are using 220v/9v transformer then your transformer must give 9v output.

If you are using bridge rectifier then check the direction of all the diodes. After bridge connection if you are using capacitor for filtering then make sure

about positive and negative terminal of the capacitor. After filtering you have to consider the terminal of the voltage regulator. If you are

using LM7805 then you should clear which one is vcc, gnd and output.

CHEPTER 3 SOFTWARE

3.1 FLOW CHART OF SOFTWARE:

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 29: Report on PC Control Using Tv Remot

Fig 3.1 Flow chart of software

Fig 3.1 is a flow design of software which is used in the PC remote control project. In this type first we initialize the variable. After than it was defined serial interrupt. After than we generating the delay. After than we defined the serial mode. If mode bit is equal to 0 than it is mouse mode

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Start

Initialize all input output ports

Set the serial interrupts

Wait for 3.024ms delay

Set mode bit

Keyboard or Mouse mode

Compare with RC-5 protocol

Transmit

Page 30: Report on PC Control Using Tv Remot

and if mode bit 1equal than it is equal keyboard mode. Now we compare this with the RC-5 protocol. Than transmit this bit via serial communication port.

3.2 SOFTWARE DETAILS

3.2.1 INITILIZATION:

In this we are taking some variables for initialization. We are also initialization for the mode. In this we know about that as it uses in the in the keyboard mode or mouse mode. We also initialize for the flip bit and toggle bit. We also initialize for the IR receiver pin. With the help of TCON and SCON we can also initialize in which mode it is going to be operated. Like 16 bit timer or it is 8-bit UART.

3.2.2 DEFIINED SERIAL INTERRUPTS:

SCON

SM0 SM1 SM2 REN TB8 RB8 TI RI

SM0-Serial mode specifiedSM1-Serial mode specifiedSM2-Enables the multiprocessor communication feature in mode 2and3, if sm2 is set to set1 then

RI will not be activated I the received 9th data bit is 0.REN-Set/Cleared by software to enable/disable reception.TB8-The 9th bit that will be transmitted in modes 2and3.RB8-In modes 2and3, is the 9th data bit that was received.TI- Transmit interrupts flag. Set by hardware at the end of the 8th bit time in mode0.RI-Receive interrupt flag. Set by hardware at the end of the 8th bit time in mode0.

SM0 SM1 MODE DESCRIPTON0 0 0 Shift register0 1 1 8-bit UART1 0 2 9-bit UART1 1 3 9-bit UART

For initializing purpose we have taken SCON is 50H. When we converting it in binary value than we get the,

0 1 0 1 0 0 0 0

From this we get that SM0 is 0 and SM1 is 1. So it will be operated in the 8-bit UART. For this we have taken9600 baud rate.

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 31: Report on PC Control Using Tv Remot

TCON

GATE C/T M1 M0 GATE C/T M1 M0

GATE- when tax is set and GATE=1, timer / counter will run only while Int pin is high (hardware control), when trx is set and GATE=0, timer /counter will run only while Int pin is high (software control). C/T- Timer or counter selector.

M0-mode selector bit.

M1-mode selector bit.

M1 M0 Operating mode0 0 13-bit timer0 1 16-bit timer1 0 8-bit auto reloaded1 1 TL0 is an 8-bit timer/counter

Controlled by the standard timer 0 control bits, TH0 is an 8-bit timer/counter controlled by the standard timer1 control bits

1 1 Timer counter 1 stopped

For initializing purpose we have taken TCON as 20H. When we converting it to the binary number we get the,

0 0 1 0 0 0 0 0

From this we get that M0 is 1 and M1 is 0. So it will be operated in the 16-bit timer or counter. Also we know that it will be operated for the timer mode from the C/T bit. Also we know that it will be hardware interrupt or the software interrupt. In this way we are initializing the stack pointer and which mode is going to be operated.

3.2.3 GENERATING DELAY:

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 32: Report on PC Control Using Tv Remot

In this project we are using RC-5 protocol. In RC-5 protocol we know that first two bit is automatic gain control bit and another one bit is toggle bit. So for that we have to generate the delay. After than five bits are the address bits. So first we have to wait for 4.572ms. After than we can generate the delay. For generating delay we are terminating the loop.

3.2.4 DEFINED MODE:

After generating delay we have to define the mode in which the computer will be operated like keyboard mode or mouse mode. For that we have to define the mode bit. If mode bit is equal to 1 than it will be operate in a mouse mode. If mode equal to 1 than it will be operate in a mouse mode. Means TV remote will work like mouse. If mode bit equal to 1 than it will be operated in a keyboard. Means TV remote will work like keyboard. If it is operated in the mouse mode than in the program will jump to the mouse loop. After than it will compare with the different addresses. If it is operated in the keyboard mode than in the program will jump to the keyboard loop. After than it will compare with the different addresses of the RC-5 protocol.

3.2.5 COMPARE WITH RC-5 PROTOCOL:

RC-5 protocol is used widely in the Philips TV remote. Now with the different inputs are given by the TV remote. So that all different inputs have different inputs have different hexadecimal addresses. Now given by these different addresses are compared with the RC-5 protocol addresses value. If the given addresses are compared with RC-5 protocol addresses than it will jump to another loop. Now it will compared with the another address. If the addresses match than it will perform the function and it will return to the main loop. This process will perform until the address will be compared.

3.2.6 TRANSMIT:

After comparison of the addresses pc will select the addresses which are given as an input. Now this will be transmitted to the pc remote control software via serial port. For this we use RS232 port. Now bit will be transmitted to the pc serial communication. Now transmitted bit will be performed according to the pc remote software. In this manner the whole software were designed. These are the basics steps of the flow designed of the software.

CHAPTER-4 USER GUIDE

4.1 OPERATING MANUAL:

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 33: Report on PC Control Using Tv Remot

This is the user manual to operate the hardware portion of the PC remote control project. First of all check the hardware layout that the pin connections are as given in schematic diagram and also no schematic diagram and also no schematic connections were lost of layout. After than check that I.C. is perfectly burnt. If software is not perfectly loaded in I.C. than the execution of the hardware is not possible.

Now check the power supply that gives exact value to run the kit. Supply voltage given to all components is shown in the data sheet of all components. DC and AC electrical specifications do not apply when operating the device beyond its rated operating conditions. Now give the power supply and check whether output is correct or not. If the output is not correct than check the connections of the circuit. If the connections are perfect than watch out for the component. Due to high temperature any components are damaged or not. For that component see the operating range in data sheet. If operating range is above the given range of the component.

User must follow the data sheets of components for avoiding limitations and damages occur in testing of circuit. All the data sheets are given in appendix.

The interfacing of microcontroller and P.C. is necessary for controlling P.C. using TV remote. For interfacing of microcontroller and P.C. we must have to load the assembly language code into the I.C. with the help of this code we can connect the TV remote to the P.C. and we can perform the function. Without loading this assembly language code into the I.C. we cannot perform the function.

4.2 Specifications of the Project:

Power Supply : 4-6V DC Range : 2.7-6V Frequency : 0-24 MHz Modulation : AM Date Rate : 100kbps

CHAPTER-5 LIMITATION

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 34: Report on PC Control Using Tv Remot

5.1 LIMITATION:

The Infrared Receiver is designed for demodulating the frequency of 30 kHz t o40 kHz. Here used IR receiver TSOP1838/36 is designed for demodulating frequency of 38 kHz or 36 kHz. If the particular frequency is not given than infrared sensor cannot sense the signal and it cannot decode the signal. So a particular frequency is needed.

Controlling PC can be done with TV Remote Control within the distance of 10m. Because infrared signals range are u pt o01m. It cannot operate above 01m range.

In this project, we have specific protocol for the Philips TV Remote. So, we have to use particular coding protocol for specific remote, so change of remote will need reprogramming of microcontroller.

CHAPTER-6 COST OF PROJECT

6.1 COST OF PRACTICAL WORK:

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 35: Report on PC Control Using Tv Remot

COMPONENTS COSTAt89c2051 60Rs232 15Max232 15Crystal 20 Capacitor 20Resistor 5IC holder 20PCB layout design 190Infrared sensor(TSOP1736) 15RS232 to USB converter 200Phillips TV remote 90Transformer 60Connecting wires 40Total 750

6.2 MISCELLENEOUS COST:

XEROX 100BINDING 300

CONCLUSION

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 36: Report on PC Control Using Tv Remot

From this project we can perform various computer functions through TV remote. In this age we can operate many digital devices through the remote control. We have to use different types of remote control to operate the P.C. using the remote which we are using for the TV. TV remote is working as a keyboard or the mouse for P.C.

With the help of this project we can overcome many complexities in daily life. We don’t need to learn different remote to operate different devices. Also, we can operate the computer from the distance. But this distance should be equal to the infrared range.

From this project we can conclude that with the help of the 8051 microcontroller family we can make a universal remote. With the help of this remote we can control both TV and P.C.

FUTURE SCOPE

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA

Page 37: Report on PC Control Using Tv Remot

The future of remote controls is already happening and it is from a remote source via

fiber, satellite, and wireless to you and the devices in your home. The electrical company can

already control your household appliances, including your computers through the electrical

wiring. Remote brain interfaces that you have no choice over are next. The opportunities are

obvious with more intuitive interaction, but so are the dangers and they are not being presented

truthfully

CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA