Coathangers breed in closets. In drawers, it’s chopsticks. In pockets, at least until recently, pennies. Presumably the universe avoids breaking the laws of physics through some complicated system involving lost socks. These mysteries have yet to be solved.
When you deal with computers, it’s mice and wall warts. They fill boxes and desks and spill out onto floors and it continues to boggle the mind that people buy new ones while they’re still knee-deep in the last batch.
There’s a certain visual symmetry with mice and wall warts, too, so as a palate cleanser while I’m scratching my head over larger projects I decided to build the Wartmouse.
I started with a little compact Logitech USB mouse (which I neglected to photograph before murdering). The guts look like this:
The transparent plastic houses the optical section, in this case an LED laser and a CCD sensor. By pulling off the plastic housing (watch for finicky tabs holding two parts together) you can see the CCD sensor, basically a small digital camera:
For the chassis, I used an IKEA wall wart; its shape is vaguely mouse-ish and it’s fairly compact. It’s screwed together, making disassembly easy without marring the plastic. My only regret is that it only has a two-prong power jack, and I kind of wanted to make a 3-button mouse.
The wart is as simple as they get — it only contains a transformer:
Once both are shelled one can begin the extremely demanding process of holding the mouse circuitry up against the wall wart chassis and squinting. It was apparent that the board was too long for the shell. Luckily, looking at the button end of the circuit board…
…it is apparent that all this real estate is taken up exclusively with buttons and related wiring (e.g. the LED and sensor for the scroll wheel, which incidentally is exactly the same mechanism ball mice used before CCD-based ones took over). I traced the wires back to the interface IC, brought out some very unsubtle sidecutters, and circumcized the circuit board:
I saved the microswitches from the removed portion of the board and glued them into position beside the interior portion of the power prongs:
These prongs are molded into place in the plastic shell; they can be freed by heating them up with a soldering iron and pulling carefully. I used a Dremel to gently bore out the resulting holes so that the prongs, when re-inserted, are held in place but have enough side-to-side motion to active the microswitches. This is a little finicky.
…drilled a hole in the bottom of the shell to correspond with the laser and CCD…
…replaced the USB cable with something closer to what a power jack would look like (a white cable from an old iPhone is close enough)…
…and that’s all there is to it.
The optics in optical mice are so tremendously flexible that there is really no need to worry about alignment, tolerances, etc. Just get it somewhere near the surface it needs to track and it’ll take care of the rest. That’s excellent news for a guy who tends to botch the hardware and work around it in code.
There are a few tweaks I’d still like to make to this before it’s convincing: adding some weight in the empty space inside the chassis (it feels too light) and adding a label to the bottom of the mouse, with the standard voltage/amperage details from a power supply, that can cover the fairly obvious hole in the bottom. It should be possible to use a material that’s transparent to the laser and CCD but not to the visible spectrum.
Categorized as: Uncategorized