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?
-
2What motor driver board are you using? Post your code in a code block. Post a photo of your wiring.– CoderMikeCommented 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.– foreverCommented Nov 16, 2020 at 23:42
-
1If 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.– CoderMikeCommented Nov 16, 2020 at 23:54
-
1but surely you can flip a motor using more than just a transistor?– foreverCommented Nov 17, 2020 at 0:08
-
1You can, of course, build a motor driver using discrete components. You would need 4 transistors in a bridge plus appropriate control logic.– MilliwaysCommented Nov 17, 2020 at 1:13
Add a comment
|