Back in high school, I found this robotic arm kicking around one of the hands-on shops (haha, hands). The teacher told me it hasn't been used in years, and no one knows why it doesn't work. Taking it home that day, I peeked around the original (very complex and consisting of many monolithic chips) circuit board. Not knowing what any of the chips did and possessing a very basic knowledge of circuits at the time, I got to work reviving this arm any way I could. Using a 4017 decade counter set to increment by one up to four, and an extremely complex set of redundant wires, it worked. Sort of. It was very basic, and very ugly. I knew I needed a more elegant solution. This sparked my interest in programming my own microcontrollers. 3 years later, I'm ready to take on the project that sparked my initial interest in programmable chips.

closed
First, the hardware (as it is actually simpler than the circuit and software). The old circuit board, power supply, and button array controlling the arm were environmentally disposed (will be used in a later experiment). Left with only the arm supports, wires and motors, I got to work on how to interface these stepper motors. A stepper motor is a rotating shaft attached to a magnet, which is surrounded by many seperate coils of wire. When current runs through one of these coils, a magnetic field is induced in the coil, and the magnet rotates until it is as close as it can be to the coil. Then the next coil in series is energized, and the magnet rotates towards the next coil. This sequence is repeated to obtain rotation of the shaft. The biggest advantage of stepper motors is precision. Each 'step' of these motors rotates the shaft 7.5 degrees. Different stepper motors have different step sizes, and will always rotate the same number of degrees. closed
In this type of stepper motor, there are 5 wires coming out; one for power, 4 for control. The only way to determine which wire is which is to grab a 9 volt battery and keep trying combinations until you get a sequence which results in consistent circular motion. For me, the power wire was red, and the sequence of wires was orange, black, yellow, brown. Note that it doesn't matter which one of the control comes first or last, just the sequence. closed
Next, I need a way to switch these coils on and off in sequence quickly. I will definitely need powerful transistors, so I chose TIP120's, as they have built-in protection diodes, and my professor left an entire box of them from a past project. I chose the Arduino again for prototyping, using the ATMega168. There are 6 motors, each with 4 wires to interface, which would require 24 outputs. The ATMega168 has only 20, so I needed a chip in between. An 8-bit shift register would require 3 chips (8 * 3 = 24), but luckily I stumbled upon the 74HC4514, a 4-16 demultiplexer chip. Simply put, a demultiplexer takes a few inputs, and translates it into many outputs. This one takes a 4 bit instruction, and translates that into turning one of 16 pins on. closed
2 of these chips gave me 32 outputs, which was more than enough. Wiring this up to the transistors on the output side, and the 4 inputs on the Arduino side, very few lines of code are required to get this simple setup to run. I chose to use a Playstation controller to control the arm, as it's comfortable, familiar, and has enough buttons to make any joint move in either direction, plus extra buttons to set speed. closed
The Playstation controller code is a bit of a black box, but the rest of the code is easy to understand. Click here for the source: http://www.soniktech.com/arm/arm.txt. Once again it was written in the Arduino IDE, with the PSX functions being integrated into the code. closed
The Playstation controller has 12 buttons to drive the 6 motors in each direction, plus another 2 for speed control. Pressing left turns the robot left, right makes it go right, up bends the shoulder, down unbends it, square pinches the hand, triangle releases, circle bends the elbow, X bends it the other way, and the shoulder buttons rotate the wrist. closed
The stepper motors themselves are connected to a series of gears and wires which manipulate the individual parts. This complex assortment of cables is precisely engineered so moving one part of the arm does not disrupt the status of the other parts, if compensated for in the code. closed
And that's it! let me know if you want to see any part up close, or if you need an explanation on anything listed here. thanks to the enthusiastic remarks I've gotten in the past, my next projects will be in 'follow me' style, so that every process is documented and reproducible. Have fun! closed