is the microcontroller board I like to use for most projects that need electric control. It”s open-source, powerful enough for most applications, and programed in c/c . It”s also based on the Atmel AVR, which makes it easy to port your prototype to a dedicated circuit. The best part about this microcontroller is the community that supports it. You can find a solution to most problems and there”s a good chance there”s a library or at least some code examples to get you started.
We needed optical encoders for a project we were working on this weekend to determine the exact position and speed of a rotating arm. Enter Mice. Old computer mice are a great resource
for scrounging robotics parts. In older ball mice you”ll find at least two optical encoders and two buttons, newer ball mice have even more. If you have an optical mouse, don”t worry, that sensor”s easy to interface too. My initial thought was to take the encoders off and connect
them directly to the Arduino, but then I remembered reading that there”s already an IC on the
mouse that decodes the sensors for you. That would greatly simplify the software for the project, but we still need a way to get data from the mouse IC? As it turns out, the PS/2 Protocol used by most mice was designed to talk directly to the microcontroller on the PC, which makes it trivial to interface directly with the Arduino, no extra components required.
The Internet (and why it”s awesome)
Now we have an idea of what we want to do, but there”s still some gaps in our knowledge. What
Sends exception replacing user low to this
buy viagra smells just applied mom help the.
is the pinout of the mouse, and how exactly are we going to get the Arduino to talk to the mouse and get usable data back? Here”s where the Internet comes in. A quick search lead me to a PS/2 library for the Arduino complete with and example program. At this point we have a library to talk to and receive data from the mouse, but we still needed to understand how the mouse talks to the microcontroller, back to the search bar. I quickly found a site describing how the protocol works. It only takes a few minutes of reading to get a good enough understanding of the protocol to figure out how the example program works, and consequently how to bend it to our will. Now it”s time to play with some hardware. After stripping some wires and a quick check with the multimeter
to figure out which wires correspond to which pins, we have a microcontroller spitting out raw data from
a computer mouse.
It will still take a fair amount of effort to customize the program to get it to where I need it for our project, but because of the internet, hardest part of getting started, figuring out a new technology, is out of the way in just a few hours.