Friday, October 9, 2009

CrashClock

Ok, so the robot is still cooking. It's hard trying to learn like 4 programming languages at once. And since the robot isn't for work or school, I'm taking a little break from it for now.

But, as a little side project, I'm building an alarm clock. Just for giggles. It'll be crazy once it's done, but for now, it ain't much. check it out:

From crashclock

Labels: , ,


Read more!

Wednesday, August 26, 2009

Robotics Crash Course, Part 3

Ok, so after some drama, some bullcrap, and a temporary bout of homelessness, I'm back. Let's try to put something on this dang blog...

So in Part 2, we had managed to find a way to get our laptop to charge from the robot. Catch was, the laptop was always charging from the robot. We don't want that. Let's fix that...

Read More!

What we need is some way of selectively connecting or disconnecting the laptop's power supply from the robot. A common light switch would do, but that kind of defeats the whole autonomous charging ability thingie we're going for. So we want some sort of computer controlled switch: a relay.

But our little OLPC laptop has no way of controlling a relay by itself. Maybe there's some sort of USB gizmo out there to do this, but screw that: let's build something. So I picked up a little Arduino microcontroller board (in this case, it's actually a Seeeduino.) Add in a breadboard, some resistors, a diode and transistor, and we have a working relay circuit. By flipping one of the I/O pins on the Arduino, we can flip the switch and charge the laptop whenever we want. And since we can control the Arduino through the laptop, the robot can do this whenever it needs to.

From crashbot

What you see up this is the setup. Here's the schematic. I simply took the power cord running from the robot to the laptop, cut one of the wires, wired the relay into the gap, and presto!

Since we got this fancy microcontroller thingie here, why not get a little more use out of it? You might notice those extra wires taped off to the side. One of those goes to the power toggle pin of the robot's cargo bay connector. By sending little pulses to this pin, we can turn the robot's power on or off. We couldn't do this before. Sounds like something that might come in useful...

Another one of them connects to the "charging source available" pin in the cargo bay connector. We can pull sensor data from the robot and tell this, but this seemed like a nifty thing to have (especially since we can't pull sensor data if the robot is off but charging.) This way, I can just poll one of the Arduino pins and can quickly tell if the robot is connected to a charging source (docking station or plugged in). I thought about using this pin to drive the relay by itself, but there's advantages to having the relay controlled via the computer.

Another one of those wires simply connects to the robot's 5v reference voltage. This allows us to tell if the robot is on or off (sounds like a stupid thing to need. It isn't.)

From crashbot


The black thing in the picture is a little piece of 3-ring binder I cut and shaped to serve as a cover/deck for the cargo bay. I tucked as many wires as I could into the cargo bay, fed them through a little hole, then screwed down the binder piece. I stuck the little arduino and breadboard to a harness that came with the arduino, and used a piece of velcro to stick it to the binder piece. I also screwed on top of all this a plastic clipboard, using long screws, some nuts and washers. This clipboard serves as the deck for the laptop. (I'm actually thinking of ditching this design in favor of a piece of sonotube, since it'd make it look nicer and might a bit better.)

From crashbot


From crashbot


And, while we're at it, let's throw a pan/tilt webcam on there. That way, we can look around with the robot. Logitech Orbit AF will do nicely:

From crashbot


From crashbot

Word of warning about the webcam: it was a pain in the butt to get the pan/tilt working with this thing. Something about the uvcvideo drivers in the newer kernel, blah blah blah. Bottom line? You need to compile and install libwebcam. You'll get a little program called uvcdynctrl that will allow you to control pan/tilt, plus a bunch of other advanced controls. Until I'm ready to start posting the code up (it's a mess at the momment: held together by digital duct tape) you'll have to poke around the libwebcam forums and documentation.


So how about that? Some nice little upgrades there. Currently, I've been debugging and cleaning up the code, and since that means I have to teach myself Python, it's taking a while. Feel free to take a look at all the crappy pictures I took while building it thus far...
crashbot

Labels: , , , ,


Read more!