I've always been really interested in robotics and artificial intelligence, but because I changed majors in Freshman year from computer engineering to computer science, I missed out on the chance to get any real formal education in the field. I did take one electrical engineering class where we learned to breadboard circuits and stuff, and it was actually one of my favorite classes at Clemson. But it was only an introduction to the subject and didn't really get into detail, and so despite my longstanding interest in the field, I've never really known how to go about making the jump and actually start doing it.
I have a Lego Mindstorms kit that I've toyed with, but the inherent fragility of Legos was always a limitation. I found that if I tried to fashon an arm to pick stuff up with, I couldn't apply too much force or it'd just smash itself to pieces spectacularly. So the desire to learn to build "real" robots out of metal has stuck with me.
Finally I've started to make progress. I found some well-written, useful books on the subject, and picked up a "learning to program microcontrollers" introduction kit, which includes a microcontroller, a small circuit board, and a selection of resistors, capacitors, sensors, LEDs, etc, and a book that walks you through learning to wire up circuits, and then write programs to run on the microcontroller to interact with those circuits. I worked my way through all the lessons, and soon had a simple lightmeter working, which simply polls a photoresistor and displays a number on the LED display based on how much light it sees (crappy cell phone video). An exciting start. Well, a start, anyway.
But that can't be called a "robot" with a straight face, so my next project was to build something mobile. But I quickly realized that building a mobile platform is a lot of work and requires parts that you don't have access to at 2am on a Friday night (that's right, I was at home building robots on a Friday night), so I opted to start with something that already has wheels and motors — an R/C car. One of the lessons in the microcontroller book had explained how to control servos, so I wrote some code to let my chip control the throttle and steering on the car, then added a sonar unit and programmed it to drive forward until it finds that it's closer than 24 inches from an obstacle, then back up. It's sort of a curious-yet-skittish-puppy-bot (my friend Tony named him Herpe, so I've been calling him that. It's a good thing I don't have more than one). Here's a video. When you set him down, he'll find the nearest wall or couch and drive back and forth repeatedly at it, like a hunting dog. It's fun. For a minute or two.
Next I wanted to build something more dynamic. I found the perfect project in one of my robotics books — a small robot built from an old computer mouse, designed to run around feverishly, seeking the brightest light in the room. The best part is that a lot of the circuitry of the robot is built from the parts that came out of the mouse to begin with, and most of the rest can be scavenged from other techno-junk you've got around the house, like computer modems and motorized toys.
As a card-carrying computer nerd, I'm legally obligated to keep several old mice on hand in the closet, so one of them was sacrificed for a greater cause. It took me a few days to build that one, but this morning I got it working. The building process is documented in the photo gallery, and here's a short video of him running around in the kitchen, chasing a spot of light on the floor. I called him Feivel (aww). One interesting thing I noticed while shooting that video is that occasionally, he'd line up and run along the strip of shadow between the two sections of light on the floor. His circuitry is designed to steer him in the direction of whichever eye sees brighter light, and I guess since both sides were brighter than the line directly in front of him, he had a tendency to stay right on the line. Emergent behavior!
I learned one interesting fact while working on Feivel. The components that make up his "eyes" are actually not designed as light sensors — they're the infrared emitter LEDs from inside the mouse. That didn't make sense to me when I saw it on the circuit diagram, so I did some reading online to figure out what was up. I discovered that, just like a motor can function as a generator (and vice versa), and a speaker can function as a microphone (and vice versa), all LEDs also function as light sensors. When an LED is exposed to light, it produces a small voltage across the pins. Weird.
So now that Feivel is done, I'm trying to decide what to build next. Feivel is phototropic — he seeks out light — but he's powered by a 9V battery. There's another type of robot design called a photovore — they "eat" light (it's kind of like being a level-9 vegetarian). Not only are they designed to seek out light, they're also powered only by a solar panel, so they need to seek out light to "survive". That sounds fun. Of course, photovoric robots move much slower than battery-powered designs. Here's a YouTube video of a really simple one that I like called the Trimet. That should be a fun little project.
Aside from that, I plan to start working on something a little more capable. There's packages you can buy online that include a bare rolling chassis with four motors and wheels, to build a mobile robot on top of, but the cost is too high for me, especially while I'm just experimenting — the kit I linked costs $220. I'm sure there must be much cheaper ways to put something simple and mobile together. I'll just have to get creative.
Posted by Bryan 14 hours, 17 minutes later
This is so awesome. What codec did you use to create the videos? I get sound and no video...
Posted by Bryan 7 minutes later
Never mind, I downloaded DivX on a whim and it worked. If I didn't know it was a robot and saw it run past, I might think Fievel was a real mouse. Very mouse-like behavior.