I'm curious if anyone has used an IR mouse circuit for a motion sensor, since that's basically all it is. On a low profile vehicle it would be easy to mount and should provide X, Y data. I'm just starting to research the subject and haven't found any projects using this and wonder if anyone knows of one I can reference. Thanks!
My mouse only senses movement from small distances. If I lift my mouse only a few millimeters from my desk, it stops moving.
I think you need something else. but, someone else might give you better information.
Good point. It would have to drag under the machine close to the ground to get a reading, unless there is a good way to modify the design of the optic using lexan or something like that. I was just thinking it would a be a super cheap sensor! :o
Maybe a Wii Nunchuck can be of use. You can get them pretty cheap here (Only US$ 7.15).
A nunchuck would not provide accurate xy data. The mouse should be more suitable, but only if the surface is relatively smooth.
I have done some experiments using a mouse to monitor the position of a disc being rotated by a servo and it worked reasonably well.
I used an old USB mouse with code based on this: Arduino Playground - Ps2mouse
@mem how did you implment the HID host controller interace to the USB mouse with the Arduino, are you sure you werent using a PS/2 mouse?
@ Robbie.The Interesting idea but it won't work as a motion sensor.
I investigated IR mice a long time ago. They basically have a very cheap and an extremely low resolution black and white CCD or "digital camera" if you are unfamiliar with what a CCD is.
The red LED illuminates the surface on which the mouse is sitting and then the CCD takes a snapshot through the little lens, creating a little bitmap image in its memory. This happens many times per second and each frame is compared with the previous frames to determine how much the image has shifted up, down, left, right. This is then used to compute how far the mouse has moved and of course generate the datastream that the PC expects from a mouse.
All of this processing is integrated into a ASIC dedicated for the job with a USB interface on board as well.... Perhaps there are changes but that is how I understand it to work based upon one manufacturers solution for optical mice.
So unless your project is in constant contact with a surface its going to be difficult to use a mouse. And if it is possible to use you still need a USB host controller and you need to implement the HID protocol in your firmware and it quickly becomes rather complex.
However if you could access some debug mode on the mouse ASIC where you can pull raw data out of it, this could open up some interesting applications for USB mice.
mem how did you implment the HID host controller interace to the USB mouse with the Arduino, are you sure you werent using a PS/2 mouse?
You don't need USB HID if you use one of the PS2/USB mice like this one:
http://www.amazon.com/Microsoft-IntelliMouse-Optical-Mouse-optical/dp/tech-data/B0004EUTF8
It has a USB connector but uses the PS2 protocol so works with the arduino PS2 code
Ok I see those mice are the ones that have both the USB and PS/2 hardware interfaces and signalling.
But for a generic plain USB only mouse like most of the cheap ones it won't be possible to control with PS/2
But for a generic plain USB only mouse like most of the cheap ones it won't be possible to control with PS/2
Its probably more likley to find cheap mice that are usb/ps2 compatible. If the mouse has an plug adapter from usb to PS2 then it should work.
Cool. This is turning into an interesting conversation. Even using one for a wheel encoder would be kinda cool. I was also thinking about using the encoder wheel for something, either odometer function or wheel encoder since the rubber wheel should provide some decent contact.
@mem, thanks for he link, I'll have to study that some more.
@zageek, thanks for the data too!
However if you could access some debug mode on the mouse ASIC where you can pull raw data out of it, this could open up some interesting applications for USB mice.
I've never played with one of these sensors, but I remember reading about experiments done with them; from what I understood from those pages, they had removed the sensor and interfaced with it directly, pulling out the raw data like you note.
Now, I am not sure if this is possible with today's optical mice; it may be that back then many mice used one of a few sensors made by a few companies, so it was easy to get the spec-sheet for the sensor to figure out how to pull the data. Today, it may be that such parts are house-numbered or otherwise obscured (or even complete custom) to prevent this kind of hacking (which boils my blood).
Regardless, what I remember most about such hacking was that such a sensor, internally, would do the conversion really rapidly, then output deltas for x/y position - but dumping the raw image data took much longer (you could get maybe 2-3 fps tops), even though it was a fairly small matrix. Apparently, the on-board processor in the sensor could sample the frame much more quickly, but the "debug/raw" mode was a slower mode, and real direct access to the data wasn't possible.
That didn't make it useless, just less useful than what it could've been...
Isn't the plural of mouse "mouses" when used in context of a computer?
Just read this thread, spent half an hour applying different lenses to the optical sensor of the mouse and finally ended up with a CD-player lens attached very close to the sensor. It sees the surface when it is 1 to 2 centimeters above. That's just what might be needed in a small vehicle. The surface must be illuminated.
Now that's the definition of a hack, if there ever was one - great job, err - hack, VT!
I'd love to get a little more detail about what you did to make that work. Also, what about the data flow being slow as crOsh mentioned? Did you just run the circuit in as a mouse via usb to test the lens? Super cool either way, just want to figure out how to use it! lol
Also, I'm new to Arduino, but is there no HID library? Any way to access that higher level data through TTL or SPI?
is there no HID library? Any way to access that higher level data through TTL or SPI?
If you mean the low level image data, I don't its available on HID so a HID library won't help.
But accessing the low level data was discussed in this thread:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1233519712
Cool, thanks. I should've searched better. :-X
This is indeed interesting. I like that mod with the CD lens. I think most of the cheap mice are using the same ASIC from possibly the same manufacturer or knock offs the same IC.