Posts: 4
Joined: Tue Jul 31, 2012 10:10 am

Pi controlled robot : which motors, battery, power options

Wed Sep 26, 2012 10:22 pm

Hi all, thanks for taking the time to read my post. Would like to point out I have no electronics experience but am not completely unintelligent.

Project: A robot that can be controlled over the internet/lan. I want to control a wheel on each side of a bot by stepper motor (remotely via wifi and pi) to drive the robot. (Software to be done at later stage.)

(nb. The camera for this bot is a seperately run wifi IP camera that does not need to interface with the Pi (got its own wifi, motors and web interface)).

Current Status:
A) got the raspberry pi (with Raspbian and wireless dongle).
B) got the wireless cam
C) finished designing my breakout board as per mike cooks page ( (see pic below).
D) bought 2x A4988 Stepper Motor Driver Carrier (see pic below). (

1) Please suggest appropriate stepper motors (Volts/amps) to drive each wheel, bear in mind this might be a relatively heavy bot (5kgs), but will operate on a flat floor (I might gear it to give less strain).
2) What is the appropriate battery for the stepper motors?
3) My pi requires 3v. USB requires its own power supply. My wireless Cam requires DC 5V/2A. I assume my stepper motor might require something else. Whats the easiest way to get all of these items onto the same battery without blowing each other up? Is there something I can buy off the shelf? (maybe I should go for 2 different batteries??)

P.s. 4) would it be possible to drive my bot into a recharging station, where the battery contacts make contact with a charger (say on the wall)?

Thank you for answering my queries.

del (Small).jpg
Breakout board on left, Motor driver carriers on right.
del (Small).jpg (55.37 KiB) Viewed 2438 times

Posts: 1
Joined: Tue Feb 12, 2013 12:23 am

Re: Pi controlled robot : which motors, battery, power optio

Tue Feb 12, 2013 12:28 am

Hey, man,

I'm undergoing a very similar project: a robot (6 axis, this time, but that's not the point) to be controlled via a WIFI-enabled Raspberry. My choice too is Polulu for the drivers, but right now I'm stuck finding out a solution to interface the drivers to the Raspberry... any ideas for that?

For the motors: it depends on what they're supposed to do. As a piece of advice: go to and check their lineup of motors. They don't sell directly, afaik, but you can certainly take a peek and learn pretty soon what stepper motors (for your project I recommend the NEMA 11 "28BYGH" series) would work best for you. Do pay attention to the spec'ed Amps of the motors - they shouldn't be more than 0.8-1A for use with Polulu.

Best of luck!

Posts: 80
Joined: Fri Aug 24, 2012 12:58 pm

Re: Pi controlled robot : which motors, battery, power optio

Tue Feb 12, 2013 2:28 pm

First of all good luck on your project it sounds really interesting! Now some experience to share. I have my own robot based on a couple of microcontrollers and stepper drive and it is not entirely trivial. The motor drivers you got are a step in the right direction but you will run into a serious limitation I think with the Pi. For my robot, driving two steppers using STEP | DIR controllers has to be offloaded to a 2nd microcontroller. I used a ChipKit Uno32 to run the steppers. That is an 80MHz mcu and it entirely consumed by delivering pulses to the motors and taking commands over an I2C link. Steppers must get pulses at very precise intervals to run at anything more than a crawl, especially if they are geared. Proper timing of acceleration is very important if you want them to run well under real loads as well. I would expect that properly driving multiple steppers, even with STEP | DIR controllers is going to be difficult for the Pi running a Linux OS and trying to pulse the pins in a userland program.

All that said I plan to retain my stepper drive as I move to the Raspberry Pi as the brain of my mobile robot. I plan to do that using these:

They allow you to use the SPI bus to send commands to the driver and the driver takes care of all the timing and housekeeping. This means the Pi need not spend its time trying to generate just the proper pulse width at just the proper microsecond intervals. It simply says how far or how fast to go and the motor starts doing that. This chip is not trivial to drive but I have a lot of the functionality wrapped up in some C++ code if you were interested. I have not yet tested it all in a working bot but I have been able to spin some motors with it and my Pi

My motors are NEMA17 frame and have a rated 70oz/in of torque. I designed a 4:1 belt reduction system that sacrificed speed for torque and two of those motors will run 10lbs in addition to the bot's own weight of over 7lbs, even on a modest incline. Don't over-do the gear ratio though on steppers. They loose torque the faster they turn so you quickly reach a point where the torque is dropping faster than gearing is increasing it.

As far as voltage, I would consider ~12V a minimum for the motors using any of the commercial stepper drives. Look for motors that have low inductance numbers. The lower the inductance the better the motor will run on sane battery voltages. If you can get up to 14 or 15 that's even better. Expect any serious motor that has some torque to draw close to 1A EACH! The irony is that steppers draw the maximum level of current when they are stopped. If you want your bot to run for more than 15 minutes then you need to make sure that you use the driver's shutdown pin to power them off when not moving. The cogging torque (that notchy feel when you turn the shaft by hand) will keep the robot from free-rolling even on a reasonable incline so there is no reason to sit there motionless and eat the battery.

I feed the motors on my bot using the raw voltage from a 3 cell Lithium Polymer battery pack 4000mAH. The rest of the bot and electronics use subsystem regulators to provide the required 3.3V and 5V power sources by stepping down the main battery power where needed. I prefer to power circuits locally rather than run one bus to everything to keep from needing parts with huge current capacity. It also provides cleaner power. Care is always required when interfacing 5v and 3.3V logic.

Hope that gives you some hints.

Return to “Automation, sensing and robotics”