The first mouse we tried to use was also a PS/2 mouse. Without knowing about the PS/2 connector we attempted to solder the wires directly to our Arduino. While we did get various signals from these connections none of them were readable in that they didn’t actually correlate with the clicking or scrolling of the mouse. Upon reflection, we might have figured out how to read these signals were we using the PS/2 Arduino library from the start!
After looking at the mice more closely we decided that we would first worry about getting a reading from the rotary encoders. Almost all of the mice we looked at had a similar rotary encoder structure. There were two wheels, one on the right side of the roller ball and one on the bottom side of the roller ball. Each encoder has a wheel attached to the end of it. As the ball moves, the wheel spins. Each wheel has a series of small holes around its perimeter. Underneath each wheel there are infrared LEDs and infrared sensors that are interrupted by the holes in the wheel. The structure looks something like the image below:
We decided we would solder directly to the rotary encoder sensors inside the older Apple mouse. After checking for continuity (using a multi-meter) between the sensors and power we marked out the pins that we would need to connect to. The soldering process itself was fun but alas, another fail. After many tests with an oscilattor we still could not get a clear reading from the rotary encoders.
Finally we found this trusty part. The PS/2 connector. This allowed us to get a reading directly from the connector’s wires which we could then pass into the PS/2 Arduino mouse library.
Next we had to make sure communication between the mouse, the node server, and the browser extension was solid.
The main idea for communication was that the browser extension would send an ajax request to the node server whenever the mouse hovered over or past an advertisement.
When the node server received the request from the browser extension it would write a piece of data over Serial.
The Arduino code would be waiting for this Serial data and when it was received a vibrating motor would be turned on.
There were a lot of issues opening the serial port at the right time, closing it, sending serial data and waiting for it. Not to mention the fact that the serial port gets clogged and nearly unusable after a lot of testing.
See the next post for the working documentation !