0

I week ago, I got my raspberry pi, connected it to a DC motor, and made the DC motor spin using python. now, I'm trying to get the motor spinning both ways. I have tried but failed. What is the best way to do this?

5
  • 2
    What motor driver board are you using? Post your code in a code block. Post a photo of your wiring.
    – CoderMike
    Commented Nov 16, 2020 at 23:26
  • 1
    @CoderMike I'm not using a motor driver board.I just took a transistor, connected a GPIO pin to Base, A 3v3 pin to Collector, one side of the motor to Emitter, and connected the other side to Ground.
    – forever
    Commented Nov 16, 2020 at 23:42
  • 1
    If your just using a transistor then I don’t think you can reverse the motor. That is the point of a driver board allows full control of motor forward and reverse.
    – CoderMike
    Commented Nov 16, 2020 at 23:54
  • 1
    but surely you can flip a motor using more than just a transistor?
    – forever
    Commented Nov 17, 2020 at 0:08
  • 1
    You can, of course, build a motor driver using discrete components. You would need 4 transistors in a bridge plus appropriate control logic.
    – Milliways
    Commented Nov 17, 2020 at 1:13

0

Your Answer

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

Browse other questions tagged or ask your own question.