Hacked Mouse
intro
the hacked mouse project is something i've been thinking about for a while. i needed the ball out of a PS/2 ball mouse for the
SolarPendulum and i hung on to the mouse because i keep everything whether it's useless or not. that's just my way, but i digress. the idea is to turn a mouse into a hopefully more useful pointing device.
i may or may not get around to this project. i have an old busted optical USB mouse too and since my laptop doesn't have a PS/2 port i'll probably just
hack that instead.
hardward haxorizing
power
5V is supplied to the mouse by the computer. the COM header in this mouse is labeled so there is no real guess work there!
buttons
the buttons are trivial to hijack. some quick probing has told me that the switches are normally open and are pulled high when clicked. therefore a uC can be used to toggle the switches.
direction control
in most ball mice (as in this one) the ball controls two encoder wheels which interrupt an IR beam. the wheels are orthoganal to each other to generate a up/down and left/right signal. the recievers have 2 channels each so the generated waveform is slightly shifted depending on the direction the encoder is turning. using the two channels the driver chip on board can determine a speed (one channels frequency) and direction (which channel lags the other) to drive the mouse cursor. this informaion is packaged up and sent over the PS/2 serial connection to the computer.
i hooked up the mouse to our oscilloscope and found that the channels produced perfect sine waves. i expected square waves and hope they will do because that is what i will be driving the circuit with from a uC.
For each encoder sensor
- each channel has the same frequency
- one channel always leads the other
- the lead/lag time is on the order of .3 ms
- the waveform has an amplitude of 5V
the hack
i am going to generate the waveforms (4 channels, probably in software PWM) and let the onboard chip do the work. this means i need a way to generate the waveforms and ensure that one signal is shifted per channel.
stay tuned!
research
from the research i've done i have decided to attempt to make a tilt mouse using accelerometers and generate a varying frequency signal (per channel). each channel's signal will be fed into two phase shifting circuits with variable phase shifting set by a digital potentiometer. the appropriate shifter will be shifted more than the other shifter to generate the 2 signals expected by the mouse controller chip. if you have followed so far you will see that each channel (x and y direction = 2 channels) will use 2 op-amp phase shift circuits.
the signals that are fed into the phase shifting circuit could be generated by PWM onboard the uC or by using something like a 555 timer with the frequency controlled by digital potentiometers.
A. {accelerometer} => {uC: ADC -> PWM} => {phase shifters} => {mouse encoder inputs}
B. {accelerometer} => {uC} => {555 timer} => {phase shifters} => {mouse encoder inputs}
--
ChristopherPepe - 17 Mar 2006