1

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
    Nov 16 '20 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
    Nov 16 '20 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
    Nov 16 '20 at 23:54
  • 1
    but surely you can flip a motor using more than just a transistor?
    – forever
    Nov 17 '20 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
    Nov 17 '20 at 1:13

Your Answer

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

Browse other questions tagged or ask your own question.