AforAlex
Posts: 85
Joined: Thu May 31, 2012 7:56 pm

Motor Controller Interface Board?

Sun Oct 21, 2012 9:52 am

Hi,

Can anyone point me in the direction of an interface board that will work with the Raspberry Pi that will allow me to drive at least 2 motors (Simple 3v & 5v DC)?

I purchased my RaspberryPi a couple of months ago and have been playing around with it, and been enjoying myself. My main goal at the moment is to get it to drive at least 2 motors (Simple 5v DC) forwards and in reverse to do a bit of simple robotics. What I have realised over the past couple of months is that I don't really care about the electronics.

I've worked through the tutorials in the MagPi magazine, purchased books on electronics and even purchased and built a gert board. I've been having fun and learning, but also have learnt that I don't enjoy electronics, I don't care about why it works or doesn't .... I don't care about levels of resistance or why something needs a certain levels of ohms resistor or voltage, it just doesn't do it for me.

I suppose the reason I am saying all this is that the world is a big place, plenty of people out there and I can't believe that something hasn't been designed/built/made available that will allow me to connect to it via a couple of GPIOs that will then allow me to simply drive some motors forwards or in reverse ......

Any help and advice as always is greatly appreciated

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: Motor Controller Interface Board?

Sun Oct 21, 2012 3:48 pm

Hate to say it, but you're NEVER be able to do what you want to do without learning and dealing with at least a LITTLE of that stuff....

There are TONS of motor controllers out there, but you have to understand at least a little of the electronics to know how to go about hooking them up and controlling them from the RPi.

For instance, you need to know about the input Voltage that the controller board requires, the max power input it can handle for the motors, and the max current draw it can handle FROM the motors.

Personally, I use a lot of pololu micro gear motors (I tend to prefer the high current ones for my applications) - www.pololu.com

For some of my bots, I use this controller board, which works well with the motors above: http://www.pololu.com/catalog/product/713. However, I don't know if that works with the RPi. It requires 5V on the control pins (doesn't the Rpi give 3.3V on it's GPIO?) It also requires PWM signals to drive things.

So as you can see, you need to be at least generally aware of the power stuff.

But like you, I don't like when it gets down into needing to figure out what size resistor to put where and when do you need a capacitor or a diode, etc. Analog stuff like that drives me crazy. If you mostly want to just deal with hooking up sensors, reading values, and then commanding motors, I'd suggest sticking with Arduino based stuff - the Rpi is serious overkill for simple robots...

User avatar
joan
Posts: 14196
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Motor Controller Interface Board?

Sun Oct 21, 2012 4:59 pm

Nice and simple.

I've used the Pi to drive motors using this board.

http://www.ebay.co.uk/itm/140743762410

User avatar
raspberrypiguy1
Posts: 379
Joined: Sun Sep 02, 2012 7:01 pm

Re: Motor Controller Interface Board?

Sun Oct 21, 2012 5:30 pm

@Joan

IT DOESN'T WORK. How do you wire it up? I have had NO success! I bought the module AND the chip on its own. Nothing.

Help!

The Raspberry Pi Guy
Matt, The Raspberry Pi Guy YouTube channel, author of Learn Robotics with Raspberry Pi, available now: http://mybook.to/raspirobots, Computer Science & Electronics Undergraduate at The University of Edinburgh

User avatar
joan
Posts: 14196
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Motor Controller Interface Board?

Sun Oct 21, 2012 5:45 pm

Choose four gpios. Name the gpio A, B, C, D.

Connect gpio A to IN1, B to IN2, C to IN3, D to IN4.

Connect the motor power source positive (battery?) to +12V power. Connect motor power source negative to power ground.

Connect Raspberry Pi ground to power ground.

Connect motor leads to terminals.

Set gpios A, B, C, D to outputs.

A high, B low: motor 1 goes forward
A low, B high: motor 1 goes backward

C high, D low: motor 2 goes forward
C low, D high: motor 2 goes backward

User avatar
raspberrypiguy1
Posts: 379
Joined: Sun Sep 02, 2012 7:01 pm

Re: Motor Controller Interface Board?

Sun Oct 21, 2012 5:47 pm

Does it have to be 12v? My motors are 5v?

Thanks

The Raspberry Pi Guy
Matt, The Raspberry Pi Guy YouTube channel, author of Learn Robotics with Raspberry Pi, available now: http://mybook.to/raspirobots, Computer Science & Electronics Undergraduate at The University of Edinburgh

User avatar
joan
Posts: 14196
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Motor Controller Interface Board?

Sun Oct 21, 2012 5:51 pm

img_2241a.jpg
img_2241a.jpg (56.05 KiB) Viewed 10516 times
Motor controller board in situ.

User avatar
joan
Posts: 14196
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Motor Controller Interface Board?

Sun Oct 21, 2012 5:55 pm

raspberrypiguy1 wrote:Does it have to be 12v? My motors are 5v?

Thanks

The Raspberry Pi Guy
No, the voltage isn't important. The spec say 5-35 for that pin. I've powered the module directly from a 14.8V lipo and through a 5V BEC.

AforAlex
Posts: 85
Joined: Thu May 31, 2012 7:56 pm

Re: Motor Controller Interface Board?

Sun Oct 21, 2012 6:53 pm

Thanks, that certainly looks like the type of thing that I am looking for, however doesn't it require 5v from the logic and the Raspberry Pi only delivers 3.3v doesn't it ??

Although it looks like you have tried it and got it set up so must be working??

I've placed an order, hopefully should arrive some point next week, I'll let people know how I get on.

Thanks

User avatar
joan
Posts: 14196
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Motor Controller Interface Board?

Sun Oct 21, 2012 7:02 pm

I have three of those boards. One I use with the Pi, the other two I use with TI launchpads. The Pi and launchpads are 3V3 devices. I've not noticed any problems controlling motors via that board.

User avatar
TonyD
Posts: 447
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: Motor Controller Interface Board?

Sun Oct 21, 2012 9:09 pm

I've made a small L293D motor controller board for the wifi controlled robot I've been building. The add-on board drives two small 5V DC motors. I'm planning on adding a second L293D board to drive 4x DC motors for better mobility.

L293D Board:
Image

Robot under construction:
Image
Tony

AforAlex
Posts: 85
Joined: Thu May 31, 2012 7:56 pm

Re: Motor Controller Interface Board?

Sun Oct 21, 2012 9:43 pm

Hi Tony, this looks exactly exactly exactly the kind of thing that I am looking for. Where does it get its power from ? is that what the centre sockets are for??

One other question, sorry if being thick, but where can I get one? I've had a look on your blog, and also on the http://www.dtronixs.com/ website, but I cant see a mechanism to actually get one.

Many thanks for the post, looks very interesting

User avatar
TonyD
Posts: 447
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: Motor Controller Interface Board?

Tue Oct 23, 2012 12:43 pm

The power can be either form the RPi 5V (but not recommended) or external power source using a 2-way screw terminal.

There still only beta's at the moment but PM me if you're interested in one.
Tony

AforAlex
Posts: 85
Joined: Thu May 31, 2012 7:56 pm

Re: Motor Controller Interface Board?

Fri Oct 26, 2012 12:32 am

Many thanks Tony, your board looks really good and can't wait for it to come out of beta.

In the mean time I thought I update this forum post in case my struggle to get a motor to go back and forwards is of any use to anyone else.

I stumbled across TB6612FNG which can drive 2 DC motors and managed to find a couple of good articles on the net about how to use. I've written it all up in my blog which you can read here: http://thingswatihavedonewithmyraspberr ... th-my.html

Return to “Automation, sensing and robotics”