LEGO Robot
A few weeks ago I was at the mall and I walked by a LEGO Store. I had heard of these, but I did not realize that there was one nearby. Naturally, I had to go in. When I came out, I had $200+ worth of LEGOs, and a membership in their "Loyalty Discount Card" program.
The most interesting thing I got was a Mindstorms kit. The Mindstorms kit lets you build little LEGO robots out of electric motors, wheels, gears, and things like that. Somehow I missed out on them when I was a kid, but I have them now.
I always wanted to make a wireless rover bot that could drive around the floor and take pictures of things. I was able to make a robot like that in college, but it had a bunch of wires hooked to it for power and control, so it wasn't as cool as it could have been. Now, with the Mindstorms kit I realized I had everything I would need. I could build a little robot out of LEGOs and attach my cell phone to it. The cell phone would direct the robot and send pictures back to my laptop, where I would be controlling the whole thing.
It ended up being more difficult than it sounded, primarily because the LEGO computer could only communicate via infrared, and it was a proprietary protocol (not IrDA), so the IR port on my cell phone would not work. I solved the problem by ripping the IR PCB out of the Mindstorms transmitter, attaching it to a handy Bluetooth serial port, and hooking it up to a RC car battery pack. Unfortunately the IR transmitter required 9V and the Bluetooth receiver required 5V, so I had to add a regulator into the mix, but it turned out OK:
Now my phone could communicate wirelessly with the LEGO controller over Bluetooth. Luckily the protocol had already been previously reverse-engineered by a Stanford student with far too much time on his hands, so I didn't have to do that too.
The next thing to do was to build a robot that could house the battery and hold the cell phone up. I wanted it to be able to turn around and rotate in place, so I came up with a 3-wheeled design:
It ended up being a bit top-heavy, but it works pretty well.The last thing to do was to get a video-conferencing program to run on the phone and transmit video back to my laptop. I figured this would be the easiest part of the project, but it ended up being the most difficult, because I had to write my own by hand. I was shocked to find that there were no Pocket PC video conferencing programs that worked with Windows Mobile 5.0 over WiFi. Microsoft Portrait was almost exactly what I needed, but unfortunately it had not been updated in several years and did not work with my phone's camera.
I started from an SDK sample that captured JPEG images and made a little program that sends a stream of images to a PC over WiFi. It's a bit slow since it doesn't use a real video codec, but it's still surprisingly fast. It updates at about the speed of a USB webcam. Here's a screenshot of the PC half of the software:
Finally I had everything in place and was able to drive the robot around and see where it was going from my computer. Awesome!
Here is a video of me driving it around:
June 5th, 2006 - 16:43
This is totally awesome!!!
June 6th, 2006 - 00:52
If you need to “borrow” any legos for future projects, I have like a billion sitting in my garage at home. 🙂
June 6th, 2006 - 00:55
That is the coolest thing ever. but why isn’t the video hosted in this window??
June 6th, 2006 - 10:00
I noticed that if I embedded the WMV file, it would automatically start playing in Firefox as soon as you load the page (but not in IE). I figured it would be annoying for Firefox users if videos half-way down the page started playing without them clicking Play. 🙂
June 7th, 2006 - 11:26
Cool! Now send the video (er… JPEGs) over the mobile network, and you can control your evil machine all over the country, whilst maintaining the T-mobile/Cingular fat cats.
March 10th, 2007 - 06:58
hey man u r really good! i always wanted to do the same stuff as u are doing!!
i have the same golf GTI 5 can u tell me how i can conect the bluetooth one the car radio ?
THX
Aria
Ariacom1@gmail.com
March 10th, 2007 - 09:19
Unfortunately the Golf GTI Mk V radio does not support Bluetooth :(. You would have to get an aftermarket radio if you want Bluetooth phone support (I havn’t done that)