1

I was wondering if I can control a DC 3-6v Gear Motor without any thing but my Raspberry Pi. I have provided an image of what I have done and it does not seem to work but when I plug the positive side in to the 5v on my breadboard, it works just fine. I am also running the code to work on the GPIO (BCM) 17 pin.

Here is the image of what : have done that does not work

enter image description here

this is the image of what works

enter image description here

Please help me, is there a way I can do this or do I need some kind of driver such as the L298N driver module?

2

You can not power a motor from the few milliamps at 3.3V that a GPIO can supply.

In fact it is potentially dangerous to try to do so. The back EMF caused by a collapsing magnetic field can damage or destroy the GPIO and the Pi.

The 5V (and 3V3) power pins can supply more current but they are not switchable - they are always on when the Pi is powered.

There are many methods to drive a motor. All require external hardware. E.g.

  • a L9110S based board
  • a L298N based board
  • a L293D chip
  • a ULN2003A chip
  • a transistor, some resistors, and a diode.

Have a look at a L9110S based board. You can get one for a pound or so from eBay.

2

Short answer: No

Given the limits of GPIO pins (16 mA each, and 50 mA in sum of all pins) it is highly unlikely to find a motor working with such a low current. Not to mention the missing protection against flyback voltages across the inductive load the motor represents. Both these issues may lead to non-reversible damage of GPIO pins on the Pi.

See here for a simple circuit to make it work: How can I control a 12V motor?

0

Direct control is more current draw than the Pi should be pushing. A better idea would be to use a relay.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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