1

I tried to GPIO pin to high and I cannot see output voltage. I try every solution but no one works for me.

import RPi.GPIO as g

g.setmode(g.BOARD)
g.setup(16, g.OUT)
g.output(16, g.HIGH)

I look GPIO pins at terminal(gpio readall) number 16th pin is now output and voltage is 1 but cannot ride a dc motor

  • 2
    Ah, GPIO pin is a bit too weak to drive a DC motor. Perhaps you can ask the 2N2222 transistor for help. – tlfong01 Jun 16 at 12:37
  • You might like to read the following post to see how to drive motor using 2N2222 and L293D:"Raspberry Pi3 - Controlling 4 DC motors“: raspberrypi.stackexchange.com/questions/113393/…. – tlfong01 Jun 16 at 12:40
  • The following Rpi.org.project tutorial on how to drive a motor is newbie friendly: "Build a robot buggy using L298N - projects.raspberrypi.org": projects.raspberrypi.org/en/projects/build-a-buggy. Have a great DC motor project. Cheers. – tlfong01 Jun 16 at 12:46
1

No, the GPIO pins can not be used to drive a DC motor.

They can only supply a few milliamps of current at 3V3 which will not be enough. In addition driving any inductive load direct from a GPIO is likely to destroy the GPIO and the Pi. An inductive load is such as a DC motor or a relay coil.

You need a motor driver board or chip or discrete components (e.g. transistor plus diode) to control a DC motor via the GPIO.

| improve this answer | |

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