2

I am working on a robot on a tight budget, I've been a bit daft as I made the DC motors go forwards and can't go backwards. So I looked at tutorials on-line and all of them suggest that you can't do it without the chip. I know it's probably not possible as the RPI can only output HIGH, LOW and OFF.

I know it's probably not possible, but is it?!

5
  • Can you indicate in your question what kind of motors you're using? DC motors, servos, big motors, small motors...?
    – goobering
    Commented Jun 1, 2016 at 8:44
  • @goobering DC motors, I've edited the question. Commented Jun 1, 2016 at 8:47
  • That kinda raises the question 'How did you make them go forwards?'. The Pi's GPIO pins don't supply enough current by themselves to drive any kind of robot motor. Did you use a transistor?
    – goobering
    Commented Jun 1, 2016 at 8:53
  • No, @goobering I didn't use a transistor. I am using motors out of an old RC racing car and connecting to ground and outputting 3.3 volts. Commented Jun 1, 2016 at 9:00
  • 2
    Never connect a motor directly to a GPIO. The back EMF will likely destroy the GPIO, which will then slowly kill the rest of the GPIO, and then the Pi.
    – joan
    Commented Jun 1, 2016 at 10:02

2 Answers 2

2

It's possible, but not recommended. The sensible course of action here is, per joan's answer, to use a pre-made motor driver board. This will be substantially easier and likely lower cost than the alternatives.

If you really really wanted to DIY this, you could breadboard an H-bridge circuit to switch the polarity of the voltage going to your motor. There's an example provided in this post by gzip on instructables.com, which could be adapted for the Pi with minimal effort.

2

Just buy a motor driver board, either a L298N based one or a L9110S based one.

They can be bought off eBay for a couple of GBP (British pounds).

They will let you drive a pair of DC motors forwards and backwards and control the speed (using Pi generated PWM).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.