What?
No questions, you know exactly what's up.
Ok fine... I turned Simone's car into a computer mouse by hacking an old PS/2 optical mouse.
But William, that's like gluing a pencil to your desk in your office in a skyscraper and calling it the worlds biggest pencil.
make crappy comic and put it here
Kindof! But it's not exactly THAT easy. A mouse strapped to the car will only ever detect up and down. To move the mouse sideways, you need to move the car sideways, but if your car is moving sideways you're usually having a bad time. It's a little confusing, but just know even while turning the mouse only sees forward or backward movement.
The other complication is a computer mouse only works when it's like 1mm away from the ground.
The other complication is a computer mouse only works when it's like 1mm away from the ground.
To move the focal plane I used a tiny camera lens, and to determine the direction the car is moving I use a magnetometer!
DOWNLOADS
DOWNLOADS
Why?
Viewer YesImHuman Suggested it.
Also for a while now I've been wanting to experiment with an optical mouse; they're literally the cheapest optical flow sensors you can buy. My hope is to use them as ground speed/position sensors for cool projects in the future!
Video
Materials
If you want to read the data with an Arduino DO NOT use a USB mouse.
- Optical PS/2 mouse
- Arduino Pro Micro (or Leonardo, if you want to control your computer's cursor)
- M12 lens bundle (I'm not sure which lens works best)
- 12mm lens mounts
- Magnetometer (HMC5883)
Build
You need to wire the PS/2 mouse to the Arduino. Don't trust the wire colors... This is what my wires were, but you should really double check:
red - ground
orange - vcc
yellow - data
black - clock
All the code is available in the download link up top.
Upload the "MouseTest" sketch to your Arduino and read the data coming form the mouse.
If you're planning on adding a new lens, you first need to remove the plastic lens that's already in the mouse. Once the old lens is gone you need to figure out where to put the new lens. The adjustable plastic mounts will make this easier, but it still needs to be accurately aligned. I won't be to specific since I'm no expert, but the lens needs to be only a few mm away from the camera hole, and as centered as humanly possible.
Before you glue anything, try holding the lens/mount by hand with the mouse wired to your computer. If the mouse moves when you move, you're in a good spot.
Screw the lens in and out to adjust focus. Since you can't see anything, try to find a position where the mouse feels most responsive.
Rushed ending
I'm going to come back and add more, but this should be enough info for anyone who's curious.
Great job!!! This device can be used for tracking of moving objects and take their path and distance. Am I right?
ReplyDeleteI love everything you do Will
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete