03-12-2012, 12:01 PM
WIRELESS MOUSE USING 8051 MICROCONTROLLER
WIRELESS MOUSE.doc (Size: 994.5 KB / Downloads: 68)
ABSTRACT
It is very amazing to see any device operated from a distant place. This idea has motivated our interest towards WIRELESS TECHNOLOGY. Wireless technology when implemented using RF for short range communication has been a costly affair especially for device operated indoor and this situation had given rise to the development of infrared communication.
In this project computer mouse functions are implemented by using microcontroller AT 89C2051 via wireless infrared medium. This consists of two modules, transmitter and receiver. The Microcontroller in the transmitter reads the Positive X-axis, Negative X-axis, Positive Y-axis, Negative Y-axis movements etc.and transmits appropriate communication code to the receiver via 300bps infrared transmitter.
The receiver receives the same code and sends to the computer via synchronous serial communication mode. The Mouse Protocol is implemented between transmitter and receiver in an asynchronous mode, between receiver and PS/2 port in synchronous mode. The transmitter utilizes the power from the battery and the receiver from the PS/2 port of the computer.
INTRODUCTION
A dedicated and continuous task could be achieved easily with the help of microcontrollers. One of such attempts is to establish an infrared communication between two devices.
A 38KHz IR Transceiver for the PC is implemented in which a transmitter connected to the mouse transmits input IR signal to the receiver connected to the CPU. The transmitter mainly consists of an AT89C2051 microcontroller, a 555 timer and an IR LED. The key feature of the transmitter is that it does not emit a continuous IR signal, rather it modulates the input signal which pulses the IR LED.
The receiver mainly consists of an IR LED and an AT89C2051 microcontroller. The key feature of the receiver is that as long as the sensor picks up the IR light from the transmitter, the receiver acts as a low-frequency rectifier to cancel the effect of modulation on the transmitted signal.
INTERFACING MOUSE WITH PC
The device interface used by many mice and keyboards, was developed by IBM. We can interface devices physically and electrically by using different connectors like 6-pin mini-DIN connector or a 5-pin DIN connector.
Communication among devices may be by different ways. They are Device-to-Host or Host-to-Device communication. Whatever may be the way, the communication process is same.
Types of Interfaces
Different types of Interfaces used are Physical Interface and Electrical Interface.
The Physical Interface
The physical PS/2 port is one of two styles of connectors, the 5-pin DIN or the 6-pin mini-DIN. Both connectors are completely (electrically) similar; the only practical difference between the two is the arrangement of pins. This means the two types of connectors can easily be changed with simple hard-wired adaptors.
Mice come in a number of shapes and sizes (and interfaces.) The most popular type is probably the PS/2 mouse, with USB mouse gaining popularity. Just a few years ago, serial mice were also quite popular, but the computer industry is abandoning them in support of USB and PS/2 devices. The cable connecting the keyboard/mouse to the computer is usually about six feet long and consists of four to six 26 AWG wires surrounded by a thin layer of Mylar foil shielding.
The Electrical Interface
Vcc/Ground provides power to the keyboard/mouse. The keyboard or mouse should not draw more than 275 mA from the host and care must be taken to avoid transient surges. Such surges can be caused by "hot-plugging" a keyboard/mouse (i.e., connect/disconnect the device while the computer's power is on.) Older motherboards had a surface-mounted fuse protecting the keyboard and mouse ports. When this fuse blew, the motherboard was useless to the consumer, and non-fixable to the average technician. Most new motherboards use auto-reset "Poly" fuses that go a long way to remedy this problem. However, this is not a standard and there are still plenty of older motherboards in use.
Device-to-Host Communication
The Data and clock lines are both open collector. A resistor is connected between each line and +5V, so the idle state of the bus is high. When the keyboard or mouse wants to send information, it first checks the clock line to make sure it's at a high logic level. If it's not, the host is inhibiting communication and the device must buffer any to-be-sent data until the host releases clock. The clock line must be continuously high for at least 50 microseconds before the device can begin to transmit its data.
CIRCUIT DESCRIPTION
The circuit mainly consists of two modules
1. Transmitter
2. Receiver
3.1 Transmitter circuit
Transmitter mainly consists of an AT89C2051 Microcontroller, a LM555 timer, IR driver and IR LED. The main feature of the transmitter is to transmit the given IR signal to the receiver.
The continuous IR signal is given to the 555 timer where it gets modulated, passes from the microcontroller through a transistor. The modulated signals are given to the IR LED. The IR LED transmits the signal to the receiver.
Transmitter Circuit Operation
For any digital circuit a power supply of +5volts is needed. A battery of 9volts is connected to 78L05 regulator which gives a constant output of +5 volts. This 5 volts supply is used wherever needed in the entire circuit. Transmitter circuit is connected to one end of the mouse. Data input is connected to the first pin of port 1 of the microcontroller.Vcc and grounds are connected to the tenth and twentieth pins of microcontroller respectively. Crystal oscillators at fourth and fifth pins are used to generate a clock frequency of 11.0592 MHz. Whenever a key is pressed in the mouse, ASCII code of ones and zeroes are transmitted.
Whenever the clock input is generated at P.1 and the clock frequency generated by the crystal oscillators are synchronous, then only data is transmitted to the first pin of port 3.
A 555 timer which is operated in astable mode is used to generate a frequency of 38 KHz to carry the data from transmitter to receiver. Whenever a zero is generated, data gets transmitted; else it takes as default input. The switch gets closed whenever a zero is transmitted and gets transmitted from transmitter to the receiver through IR LED.