
So was thinking about putting together a small autoimous vehicle (rc car size) with a SunSPOT as the main processor.. Issue number 1: how do you know where the car has gone or is going? So far I am thinking an optical mouse sensor would be a reasonable solution (coupled with a compass, but that will be next week :)). I realize the whole additive error issue when trying to dead reckon, but what the hey..
So I decided that I would give it ago and hookup a mouse long story short, asked Al and scored a sweet apple wireless mouse to destroy.. Few minutes later it was part and simply by reading the serial number on the main chip, A2030 and a quick google i found the data sheet and was away.. The chip is actually a Agilent ADNS-2030 Low Power Optical Mouse Sensor and the data sheet had an example circuit for the chip, with some closer inspection and conferring with Mark we figure that the apple mouse has this functionality, but what was interesting was that everything we need was on the small board, and all the stuff we didn't need was on the top board.

And chances are that we could hook straight up to the connecting wires.. After some more hardware guidance from hardware man mark, i ohmed out the chips pins that i was interested in (from the data sheet) to the connecting wires see the diagram below.

From there it was quite straightforward really.. We hooked it up to a scope to check it was working.. it was :) then hooked it up to a SunSPOT (using the EDemoboard which comes as standard with a SunSPOT).
Gnd -- > Gnd
Vdd --> +3
SDIO --> D2
SCLK --> D3
PD --> D4
It was then a simple software problem... Started bit banging away and with some adjustments of the old toggling high low and once again conferring with the data sheet to get the operation addresses and SCLK SDIO timing, i have a functioning SunSPOT mouse.. And the cool thing is it seems pretty accurate with zero jitter (sensor is 1500fps with res at 400 or 800dpi), and by using the serial port it can be queried to get a number of properties, e.g. has there been motion since last time i checked and if there was then I can read the x delta and y delta.. This is cool because i don't need to monitor the sensor constantly to check for movement (although i can if i want as it has quad outs as well).
So hopefully this just goes to show how powerful a SunSPOT is.. I had no knowledge of optical mouse sensors however was easily able to hook it up and drive it with a SunSPOT. This just means that pretty much any sensors you can think of should be able to be driven by this crazy powerful little hog a computer which is just brilliant for prototyping these problems. What is also cool is that now it is hooked up I can process this onboard to control other functionality like motors/servos, and even radio this info home or to other devices (think swarms :)).....
EDIT: here is a link to the code to get this working...










