0

My friend and I are repurposing an old rc car for a project. When we connect the dc motors to 5V and ground, the motors spin. However, when we power the motors from 5v and ground it in the digital output pin set to LOW, nothing happens. The identical circuit works in tinkercad. We are using a nano, but have tried an uno and mega as well.

5
  • you possibly destroyed the arduino output pin
    – jsotola
    Jul 4, 2020 at 4:16
  • An output pin can't handle that sort of current. I would suggest you do some reading on Ardunio and motors. If you google as much you'll be hit right off the bat with the idea of a motor driver since the pins can't drive motors by themselves. You've probably damaged your Arduino now.
    – Delta_G
    Jul 4, 2020 at 4:17
  • The pin still works with leds and a small dc motor Jul 4, 2020 at 4:24
  • 2
    there is a lot of info about driving motors on this site
    – jsotola
    Jul 4, 2020 at 4:29
  • You shouldn't try to source or sink more than 20 mA from an Arduino pin. The absolute max is 40 mA, but 20 is the recommended limit. Also you should never hook an inductive load directly to an Arduino pin. When you disconnect an inductor from power, there is a large reverse rush of current as the magnetic field collapses. This is known as back-EMF, and even if you don't exceed the current limits of a pin, the back-EMF may fry the pin, or the entire board.
    – Duncan C
    Jul 4, 2020 at 18:45

1 Answer 1

1

Never directly connect a motor to an Arduino IO pin

You will destroy the Arduino.

An Arduino cannot source (or sink in your case) enough current to drive a motor, and if the motor did manage to turn the huge amounts of EMI it generates would literally blast holes in the silicon inside the chip.

You must use a motor driver of some form. If you only want one direction that driver can be a single NPN Bipolar transistor or N-channel MOSFET. If you need it to change direction then an H-bridge is what you want.

4
  • Thanks. We ended up using a relay in the meantime Jul 4, 2020 at 17:43
  • To the OP: If you do end up powering your motors with transistors, make sure to add a "flyback diode" to protect the transistor from back EMF. (This is a suitably rated diode wired backwards across the motor terminals. They're needed for any inductive load, not just motors.)
    – Duncan C
    Jul 4, 2020 at 18:48
  • Use that diode for the relay, too. As it is an inductive load, it will generate flyback spikes when switched off. Jul 4, 2020 at 19:13
  • Good point on the relay. I assumed the OP was using a "digital relay module" which has a transistor, diode, and usually an optic-isolator built into it.
    – Duncan C
    Jul 4, 2020 at 19:32

Your Answer

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

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