2

I have a question. I've attached dc motors to gpio's and after running python program it won't turn. Attaching LED's would make them light very low. Attaching both of them to pin 1 or pin 2 would make them both work. Could the problem be withthe card or maybe the output is to small for turning the motors? How can I solve this? I want to give enough output to turn them while the gpio's will control the PWM. Thanks.

  • 2
    Welcome to StackExchange! Can you attach a diagram showing your setup (and/or pictures of your actual setup)? This will help us address your questions. – Phil B. Aug 10 '15 at 4:33
  • 1
    Indeed, a diagram showing how you've wired this together would allow us to give useful feedback. – WineSoaked Aug 10 '15 at 5:49
  • 4
    DO NOT EVER POWER MOTORS FROM THE RAPBERRY PI'S GPIOS You should always have a motor driver board between the Pi's gpios and the motor (or the equivalent in discrete components). You can destroy the gpios and/or the Pi. The same goes for relay coils or any inductive load as well as motors. – joan Aug 10 '15 at 7:25
2

The Pi GPIO can only output a tiny amount of current (15ma) -enough to power an LED, but not a motor.

For anything more than an led, use a transistor at minimum, or motor controller.

E.g. http://javatutorial.net/raspberry-pi-control-motor-speed

You may have already broken your Pi by connecting a motor directly to it....

  • 3
    While not advisable (and it won't drive a motor) connecting the GPIO to a motor is extremely unlikely to do any damage, as the Pi's GPIO outputs are current limited and if the motor won't be able to generate any back emf if it doesn't start. – Milliways Aug 10 '15 at 11:52
  • @Milliways Good point. I wonder what would happen if you were like me and if a motor didn't start you manually spun the shaft? – joan Aug 10 '15 at 13:34
  • @joan The problem with excessive voltage comes from the energy stored in the magnetic field if this suddenly collapses. Spinning the motor (or connecting then disconnecting) will generate a spike, but the energy from <15mA is small, and the chip has effective diodes to the substrate which dissipate this small amount. Still not best practice though. – Milliways Aug 11 '15 at 5:58

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.