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.

asked Jul 4, 2020 at 4:07
5
  • you possibly destroyed the arduino output pin Commented 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. Commented Jul 4, 2020 at 4:17
  • The pin still works with leds and a small dc motor Commented Jul 4, 2020 at 4:24
  • 2
    there is a lot of info about driving motors on this site Commented 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. Commented 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.

answered Jul 4, 2020 at 11:26
4
  • Thanks. We ended up using a relay in the meantime Commented 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.) Commented 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. Commented 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. Commented Jul 4, 2020 at 19:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.