Let's Make Robots!


IMAG0195.jpg632.06 KB
bot3.jpg79.07 KB
bot7.jpg84.96 KB
bot3.jpg79.07 KB

My first robot project.

I realized my Raspberry Pi had been collecting dust in a drawer, for some time. I started thinking about suitable projects, and stumbled upon this site. Building a robot seemed like a nice challange, as I usually only do software projects. A chance to expand my knowledge about electrical components, and to make use of my Pi.

I decided early that I wanted to do everything in Python, as that's my langauge of choice. I started doing some research, and it turned out that the Pi is rather limited when it comes to controlling robots. It only has one pin capable of hardware PWM, no analog inputs, etc. There are lots of available addons which makes it easier, but I decided to try to use as few additional components as possible; mainly to keep the cost down.

So, I ended up using a L293D for motor control. Two 50:1 ratio gear motors, powered by 4x2500 mAh AA's. I salvaged a LiPo battery from an old tablet, hoping to use that to power the Pi. Unfortunately, the output of the LiPo seems to be 3.2v, and the only voltage regulator I have is a step-down (the Pi needs 5v). I tried using the 4 AA's powering the motors, and they seem capable of powering the Pi and the usb wifi dongle I use. So, I guess my best option is to get another 4xAA holder, as I happen to have another 4 2500 mAh AA's lying around.

I also need to find a better front wheel (caster?). At the moment I'm using a small pair of lego wheels. This project has been alot of fun, and more challanging than I originally thought. It is very much a work in progress - I intend implement some sort of sensors in the future, making it as autonomous as I can - but as I'm about to move, I most likely won't be able to spend alot of time on it for a while.

Update - I solved the power issue, by getting a 6xAA battery pack for the motors. The 4xAA battery pack that used to power the motors, is now used to power the Pi.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


So, do you have a web server running on the Pi, and that's how you control it? I'm looking to do something similar, but am having issues with the control interface. 

Good to see another pi project here! cant wait to see your robot moving around.

I never did anything in python, so i have no idea of its capabilites, but software PWM will work fine. The Pi runs so fast, you can PWM from a shell script if you want and still get pretty good results. 

Hey, thanks for posting.

I'll definitely upload a video of it in action, as soon as I solve the power issue.

Yes, software PWM was surprisingly easy to implement. When I was researching the matter, I read several posts from people saying the only solution involved compiling kernel modules designed for software PWM. I guess It's a recently added feature in the RPi.GPIO library. 

Python is a very powerful - yet easy to learn - language. I've coded in a few languages, but python is the one I always return to. You should try, if you get a chance :) 

I'm also working on a pi bot, didnt do any work today otherwise I think it would probably be finished almost (I dont have any batteries to run it from :P).

If your rolling with python then seriously check out the RPIO library. Drop in replacement for RPi.GPIO but also has DMA based software PWM on all pins, pretty accurate too.

Could you not use the tablet battery for motors and AA's for pi or is the tablet battery just not quite powerful enough?


I'm aiming for a start here robot clone with ultrasound personally. Using CD's and alot of sticky tape for construction :P 


Nice to see others making use of the Pi. I heard about RPIO, but I never tried it.RPi.GPIO has software PWM for all pins too, now. Works really well for my gear motors.

My gear motors want 7.2V, so the 3.2 from the LiPo is a bit low. It might work if I get a step-up voltage regulator, as it's a nice battery. I'm still considering whether I should try that, or just get another 4xAA holder and power the Pi with that. Both should work.

Good luck on your project!