The project I’m currently planning on using my
RaspberryPi for is a robotics
project to entertain my children. As part of that I need to be
able to control DC motors from the RaspberryPi
Now that I know how to run the ‘Pi from battery
power and get WIFI
working the next item
on the TO-DO list is controlling motors. I’ve yet to personally try any of
these methods as I’m still in the process of working out what’s the best
option for this project but I thought it might be useful to summaries the
options I know about here (in the hope that anyone who knows of other options
will say so in the comments).
One option is to develop a board from scratch based on my exact requirements. However, I’m too lazy and my electronics skills are too rusty for me to take this approach. The space constrained nature of the project means that I don’t have space for breadboard and so would have to design a PCB or use stripboard none of which appeals at the moment.
The PiBorg can control up to two motors and two solenoids. Multiple PiBorgs can be connected to allow control of larger numbers of motors and/or solenoids. It looks like a nice piece of kit and is now available for pre-order however it costs 129 and since I need to control at least 3 motors it would be a relatively expensive option.
I wondered if I could control my arduino motor shields from the ‘Pi and then found out that others had already had that idea in the shape of Ponte. This sounds like a great idea but I haven’t seen any updates to this since the end of May and I’m impatient to do something…
Arduino + motor shield
So if Ponte is not yet available why not get the ‘Pi to control an arduino connected to a motor shield? This blog post (and it’s followup post) shows it not only possible but not that hard either. Since an arduino uno costs about 25 and the motor shield also costs about the same I could potentially control 4 motors or less than the cost of one PiBorg (in fairness though the PiBorg has the ability to measure feedback from the motors and maintain a desired speed so it would still be a technically better solution). A disadvantage of this approach is the space required by two arduinos each with a motor shield mounted on them. If I connect to the arduinos using USB I’d then also need a small USB hub (as I need another USB port for the WIFI dongle).
The Gertboard is being developed by Gert van Loo who also worked on some of the Raspberry Pi hardware. It sounds like a nice board but AFAIK is not available yet.
Raspberry Pi to Arduino shields connection bridge
Not sure if this has any relation to Ponte, but the idea of using arduino shields on the Raspberry Pi is the same and it’s available now for 40 euros.
Also worth a mention is the Pi Face but this seems to use relays which rules it out for this project as I need PWM motor control rather than just a simple on/off
Since I already have an arduino and a motor shield I’ll probably experiment more with that before considering any of the other options, but in the meantime if you have any better ideas (or corrections to anything I’ve said above) please say so in the comments.
Update 9/10/2012: Added details of Raspberry Pi to Arduino shields connection bridge