- INFRARED WIRELESS MOUSE
-ECE /EIE / EEE FINAL SEMESTER PROJECT
A NORMAL MOUSE TO AN INFRARED MOUSE
mouse have recently been introduced in the market and they basically work
on IR principle or radio waves. IR
( Infrared is more popular) The advantage of this mouse is that
it does not have a "TAIL" - no wires connected to the PC and convenient
to handle. The IR rays fall on a small receiver that is connected to the
PC's mouse port kept near the PC in front of the mouse . The wireless distance
is within 12".
mouse users like CAD/CAM / GRAPHIC designers prefer the cordless mouse
for its convenience.
project is aimed at converting a normal mouse into an IR one using a bread
board and a few ICs to simulate the concept of an IR mouse and to see how
it really works. If necessary you make a small PCB to fit it into the mouse
enclosure and a small 9/12 V battery inside the mouse. (ie. if you have
the necessary skills in soldering and making a very small PCB and finding
enough place for a battery also inside the mouse enclosure)
testing purpose , we are going to connect the mouse to a bread board using
an IR LED beam, the mouse sends signals to a receiver diode again on a
BB ( Bread board) which is connected to the PC com-1 mouse port. In this
method the mouse is not damaged and concept can be made to work as a demonstration.
| bread |
mouse cable | bread |=)> infrared )| board | cable
|mouse \==============+ board |=)>
<--- 12" --->
a mouse is very easy , just look under the mouse for 2 or 3 screws - open
them and click open the mouse body. Remember to remove the rubber track
ball before opening the mouse.
will find about five wires from the mouse cord connected to the mouse PCB,
two rollers connected to two slotted wheels that rotate when the mouse
is moved. Two switches that get clicked when you press the left / right
mouse button. (These are ordinary micro switches)
side the two slotted wheels (approx 0.5 inch dia) you will find two opto-couplers
that detect the pulses generated when the wheel is rotated. In the opto
-coupler one side is a LED and the other end is a Photo detector Diode.
Whenever the beam is broken a pulse is generated which indicates movement
of the mouse. Normally you will find two o/cs (opto -couplers) for each
wheel for detecting the direction of rotation.
mouse have one o/c with two receiving diodes to detect the direction of
rotation. Besides these mechanical parts you will find on the PCB a few
diodes, resistors and a dedicated IC which handles all the o/cs and switches
to send info to the PC.
bit surprising is that there is no battery inside the mouse !
where does the IC and other electronic components inside the mouse get
their power supply from ?
bit of reading old mouse manuals and some research got us the information.
A few years back when the mouse was introduced, they used to be connected
to COM1 ( serial port -1) on the PC and a short cable from the connector
used to go to a "T" connector to the PC KEYBOARD socket. The
mouse used to get its power supply through the KB connector. But
recently , there is no such direct supply.
test revealed the secret. We connected the mouse to the PC and switched
ON the PC and checked for any DC Voltage on any of the mouse 5-wire cable.
We found on two wires +10v marked as DTR/RTS .
On close examination of the mouse PCB, we also found that two IN4148 diodes
were "OR" connected to pins-4 & 7 (DTR & RTS) trying to pull out
power from any one of these pins to supply the voltage to the Mouse PCB
and its components. Probably the mouse manufacturer is using a LSI IC CMOS
version that just draws a few milliamps and decided to take the power from
the serial port itself. Nowadays , ICs draw very little current. On examination
, we found that about 5ma was consumed, not a heavy drain on the serial
mouse cord ends in a MALE 9-pin "D" connector as it is popularly known
which plugs into the PC's COM-1 ( RS 232 port -1) (com-2 is normally used
for a modem)
check on the ports available on the PC will give you more information.
ports available are:-
comm1 rs232 9pin or 25 pin (normally 9-pin used by a mouse)
comm2 rs232 -do- (normally used by a modem)
LPT1 printer port 25 pin (printer)
LPT2 printer -2 port ( normally does not exist )
VGA output port (connected to the monitor)
Keyboard port ( to keyboard)
Game port (joystick)
pin configuration of this port:- (COM-1) (as mentioned in the IBM PC technical
function signal direction <-- -->
CD carrier detect <---
RXD Receive data <---
TXD Transmit data --->
DTR Data terminal ready --->
Ground Common line
DSR Data set ready <---
RTS Ready to send --->
CTS Clear to send <---
RI Ring indicator <---
are international standards and are the same in any PC from a 286 to a
Pentium or even on any other brand. If you check the IBM PC Technical reference
manual, you will find this information and much more on the functionality
of the pins.
"D" connector showing the five wires in the mouse cord
1 |DCD-------NOT USED
DSR | 6 ---|----------NOT USED
RTS | 7 ---|----------------------------------USED
CTS | 8 ---|----------NOT USED
RI | 9 ---|----------NOT
testing the mouse (OPEN) with a PC , there were erratic problems and we
found that is was due to the Photo diodes receiving ambient light to be
the cause. No wonder, no one made a transparent mouse
like the IMAC-PC.
type of signals are generated when you click a mouse button or move it
on the mouse pad in different directions?
we know this , we cant send these signals through an infrared beam. Since
there are five wires , do we need five beams?
more research gave us some useful information.
the mouse is connected to the serial port ( RS-232) it
may be sending standard protocol data in serial form at a particular BAUD
rate. (BITS PER SECOND) To test if this was true, we plugged in
a new mouse into COM-2 after removing our modem and ran a software called
"serial port watcher".
software merely displays on the screen whatever it receives from COM-2.
You can also write one in "C" - just read from port COM-2 and display the
byte on the screen and get back into a loop.
running this program, we clicked a mouse button , double clicked it, moved
it north/south/east/west and all we got was JUNK on the screen - nothing
we know knew that clicking buttons and moving the mouse created data flow
FROM the mouse to the PC and the mouse steals a little current from the
PC serial port.
were looking for proper data to come from the mouse , like
click should send "L"
click - "R"
something like that.
reset the PC and ran the program again -
dint touch the mouse and nothing came on the screen. Click a button and
we got junk again.
recollection of our data communication programs reminded us that the baud
rate of our software could be wrong. In the software there was an option
to change the baud rate from 300 baud to 19200 baud and it was set to 9,600
baud. The parity was "NO" and STOP BITS was 1. Looked to us like our modem
communication software we normally use 9600-N-8-1
a popular standard in data communication.
N=no parity 8= no of data bits 1= no of stop bits and 9600= bits per second.
surely had a slow mouse with us , so we reduced the speed to 4800 and then
to 2400 but still we got junk.
at last when we tried at 1200 baud.
got some meaningful data on the screen. Left mouse click generated 3 bytes
of data on the screen
releasing the button generated another 3 bytes of data. We carefully clicked
and released the left mouse button and noted the data- it was consistent.
So did the right mouse button but different data.
was always three bytes at a time. Moving the mouse also generated a 3 byte
stream of different data for different directions.
was the break we had wanted. We finally realised that the mouse was just
sending RS232 standard data at 1200-N-8-1 to the PC's serial port and the
mouse drivers job was to read this info and pass it on to the application
running on the PC.
experience we also realised that the 3 byte stream of data must have some
international standard because we often pull out and plug in a different
brand mouse on a PC and the mouse still works. So the mouse driver software
still recognises the new mouse.
to the beginning, we now have to send this data through' an infrared beam
to the PC.
block diagram now seems to work in theory - send the serial data through'
a beam instead of wires. The mouse seems to be a one way com device and
a simple circuit can convert the serial pulses of current to pulses of
IR light and the receiver diode detects this IR pulses about 12" away and
converts it back to electrical pulses and sends it to the PC.
too simple - anyway we started our design and prototype -
we could finish it within an hour.....
wrong we were...
took us 3 days....!
we never thought of
mouse is NOT a one way device
How do you supply power to the breadboards without leaking current into
the PC and damaging it ?
Serial ports of different PCs give a voltage from -/+9 to -/+12
Since the mouse is not connected to the PC now, we have to provide a power
supply to it -
at what voltage ? should it be stabilised ?
Photo diode receivers also respond to natural and room lights besides IR.
- tube lights flicker at 100hz -
it appears as though this concept may work only in
Our demo mouse had three buttons.
we solved all the problems finally
is how we did it-
be contd......in part-II
EXCELLENT PROJECT ON PCB FOR BE-ECE STUDENTS
FOR BE-CSE STUDENTS USING BREADBOARDS.
to previous page