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.

0
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
0

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

-3

I had the same issue , everyone said to use any motor drivers and i had one but it was damaged ( or i don't know how to use it ).

By the way, solution is to connect the maximum no. of gpio's as positive and a gnd as negative.

Note : As you are directly powering motor from pi. I don't guarantee you that your pi will be safe. I didn't come across any problem till now.

And the motor may be slower.

2
  • 1
    This answer is DANGEROUS and can damage your Raspberry Pi. A motor is an inductive load and causes flyback voltages that can damage your RPi and without knowing the current draw it can also overload the GPIO pins max current rate of "A maximum of 16mA per pin with the total current from all pins not exceeding 50mA[sic] " Nov 10 '20 at 14:52
  • Ok it may be true , I also said that it may be dangerous. I used 2x 60 rpm dc motor.And it didn't damaged my RPi 3 model B. Nov 11 '20 at 15:06

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.