It should come as no surprise your optical mouse contains a very tiny, very low resolution camera. [Franci] decided to take apart one of his old mice and turn that tiny optical sensor into a webcam.
Inside [Franci]’s Logitech RX 250 is an ADNS-5020 optical sensor. This three wire SPI device stuffed into an 8-pin package is a 15×15 pixel grayscale image sensor. [Franci] started this project by bringing out the Arduino and Ethernet shield. After soldering a pull-up resistor to the image sensor’s reset pin, connecting the rest of the circuit was as simple as soldering a few wires to the Arduino.
The Arduino sketch sends the image data for each pixel to a computer over a serial connection. A bit of javascript and a touch of HTML takes this pixel data and turns it into a webpage with a live view of whatever is directly under [Franci]’s mouse.
Video of the mousewebcam in action below.
Um… ok?
So he’s using an Arduino with an ethernet shield… But he has to run a daemon on his computer *anyways*, then open a web browser and connect to localhost:8888 to get an image that seems to have an effective frame rate of 0.5fps?
Is this some kind of Arduino thing?
“Let’s do stuff in the most convoluted way humanly possible”?
I think that is very common for any off-the-shelf option. I always prefer write-ups that disassociates the “hack” part from the choice of MCU/platform as much as possible. But nevertheles, this still shows what one could do with a mouse-cam, leaving room for
your imagination to make it into something usefull. convoluted setup or not.
The article says he’s sending the image over the Serial line. The fact that the Arduino has an Ethernet shield on it only means he was too lazy to take it off for the video.
he sends the data serially to the ethernet shield. This build is actually using network connectivity.
I did a similar hack of this (in color :p) with direct display, and the framerate isn’t any better. If this is using one of the typical ADNS-xxxx mouse sensors, raw pixel-grabbing is done via a crude debug feature on the chip – it can only read out one pixel per frame.
That is pretty cute somehow. I can imagine there could be use for (ultra-)lowres cams in plenty of hacks. Perhaps a cheap source for the robot hobbyist crowd. Not all cams are meant for the human eye after all (just like this mouse originally). Though admittedly, higher resolution webcams are probably as cheap/available as mice.
https://code.google.com/p/arducopter/wiki/AC2_OptFlow
bigclive just found a similar chip/cam in a 1 pound optical mouse from Poundland. I used to have the same mouse here that was A$2, so about the same cost. The cheapest, crappy webcams in those stores are $10 a pop so it all depends what level of detail you need on a project. Plus as a bonus, you get 3 micro switches and a couple of other minor parts, all for a couple of bucks
Wow. Very English. Much grammar.
Wow. So comment. Very insight. Much smart.
Happy joy long time!
+wow
It’s been done before AND better. http://spritesmods.com/?art=mouseeye
I agree. And by a HAD contributor no less! Also, I’m struggling to see the point of using an arduino here. It just seems to me that it’s being used as an overly expensive serial port. Couldn’t this just directly interface to serial from the chip in the same way Sprite_tm did?
The chip Sprite_tm used only need 2 I/O lines. One *could* use use modem
handshake lines as I/O for bit-banging assuming that there is no timing
constraints on the signals. I made a serial port to I2C dongle that way
with a couple of transistors and a few resistors.
These days, you can get USB to serial dongles/cables/chips at TTL signal
level and you should be able to interface to the sensor directly.
Interesting background music…
sounded like 2girls1cup for a second
you know your stuff, man. Kudos for high quality content citation.
the new part here is the ip connectivity. Otherwise look in the archives.
Hmmm… It doesn’t seem so useless to me, my first thought would be to use something like this to check for defects, say in something like chain, or wire – some continuous process. Though I’m betting with that frame rate, you’d be ordering a real part pretty quick. What useful things could one do with this?
These sensors might be useful as motion encoders on robots etc.
But it seems that Avago has stopped manufacturing them, and I haven’t been able to find any other optical mouse sensor that can be bought as a chip and comes with a datasheet.
the old apple optical mice have nice sensors on them. direct quadrature x and y axis output, i prefered it because i could hook them up to an interrupt pin and know exactly when the sensor had moved a certain distance.
I just thought of the perfect application for this: use it as an absolute or relative position indicator for a milling machine or lathe. Print out a strip of material with a very fine-pitch binary count pattern on it and place the camera over it and have the software read the binary pattern off the strip.
This could be pretty accurate if one uses sub-pixel intensity analysis. Doesn’t need to be run at a high frame rate either, 5FPS would be enough for sure.
With a binary count pattern you can simply read off the number right in front of the camera and you know your absolue position down to a fraction of a millimeter.
Probably would have high enough resolution for a cheap hobbyist-level mill or lathe.
Tried that, it’s cumbersome and under-performing. Use a TCD1201: large frame-rate (100s of measurements per second) and accuracy down to ~20µm. Use a transparent binary encoded strip.
That’s brilliant. I wonder if a simple greyscale gradient would work? If so, I bet a square would work well for slow moving robots where you wanted to know “real” X & Y coordinates. Just mount it on a pantagraph like mechanism…
Similar sensors are used in drones for optical flow guidance systems. Even with the low resolution, they work pretty well for obstacle avoidance and holding positions. One of the interesting things about these sensors is that they have very high framerates — 1000+ fps — when accessed via their low-level interfaces.
That high fps figures apply only for position tracking. These aren’t designed for video capturing.
There’s a typo in the first sentence (now->no)
Nau there isn’t
Would love to see this done with a DVD read sensor and to have control over the focusing solenoids.
i think dvd sensors are only photodiodes. either sensing light or no light essentially.
This type of hacks are very interesting, I love the idea of using parts from computer scrap because these things are widely available. I keep a big box full of ball mice at home because I was using their optical sensors and wheels to build small robots. I started collecting optical mice now but they are still useful so people don’t get rid of them so often as they did when they transitioned from mechanical to optical.
i wonder if you could use a high resolution, or even a hd camera as the sensor for the mouse, then hold it up and use it as a camera again?
Has anyone considered the possibility to combine a hack like this with Anoto paper to achieve absolute positioning? The Anoto pens have a camera which reads dot patterns printed on paper to guess the exact position of the pen.
A good starting point is http://freedot.sourceforge.net/
The interesting thing about these sensors are not their resolution (neither spatial nor color), but their very low cost combined with absurdly high frame rates of up to 4000 FPS (high-end gaming mice) and still low data rates (1000 FPS – about 120 kb/s, most are 16×16 pixel and 4 bit grayscale or less).
Wasn’t this already done like 6 years ago? Old news!
Hmmm, infrared image sensor… Would this work as a cheap thermal imager?
as i understand these sensors are ccd types. they can see near infrared, but not far enough to see heat. like most webcams with their infrared filters removed.
would someone be able to create an android app that uses the camera on the back of the phone and connects via bluetooth to act as an optical mouse (complete with touchscreen buttons and scroll wheel)? there’s a lot of situations (mainly CAD modeling) where I’ve found myself desperately in need of a physical three button mouse. (you’d likely need to make some kind of separate lens, though, to get it to track the table)
There was a hoax many years ago about someone claiming they did that on a nokia phone: http://hackedgadgets.com/2006/08/15/nokia-cell-phone-mouse/
There was actually a software for symbian s60 phones that really worked, I had Nokia 6600 and tested the demo around 2001-2003 I guess. http://psiloc-mobile-mouse.en.softonic.com/symbian
INB4 NSA conspiracy comment.
Hackaday has turned to recycling old articles. This “news” about the ADNS hackability was out about 6 years ago, I think? Friend of mine did a Mac program that read out the pixel data and put it up on the screen back then.
Oh, wait, you mean they hooked it up to an Arduino? Ok then, stop the presses!
Waaah. If “someone somewhere did it before” were a reason not to do/publish something, this would be a pretty short site (and most of us would be out of jobs…)
He never claims to be the first. The fun part here is it’s streaming images from underneath the mouse over the internet. He happens to be doing it locally, but he could just as easily be checking in on it while on vacation in another country.
With a bit of effort making the electronics and the host software easier to hide, this could be a neat little corporate espionage trick. “Ah, you use your mouse on whatever document is lying on your desk because it works better?”
since its a grey scale image, you could use this in a robot to follow a line on the ground. when it loses its path, aka senses different scale it could readjust maybe even using multiple mouse eyes, like a spider ^^.
large corps use a similar system to deliver mail by robot to peoples desk and they move along a piece of tape on top or underneath the carpet. albeit a lot more complex but same principle.
can’t a lens be attached as such to get a useful image?
Hey guys,
is there any way to display image with 1.5K fps from this camera?
Interesting idea: hook this up to a DVDR drive sensor and read back disk quality with it.
Add this data to the readback so the drive can insert dummy data for data recovery purposes.