Motor connected straight to an Arduino pin

  • DC motor
  • Pump
  • Arduino

Stay safe: Connecting a motor straight to a pin can destroy the pin or the board.

Why it happens

  • An Uno pin should give 20 mA, and never more than 40 mA. Small motors and pumps want 70 to 500 mA or more.

How to fix it

  1. Put a transistor with a diode, a relay module or a motor driver (L298N, L293D) between the pin and the motor.
  2. Power the motor from its own supply and join the grounds.

It worked if: The motor runs and the pin's wire stays cool.

From the official documentation. Pin limits from Arduino's documentation. Sources: Arduino: digital pins.

Didn't help? Search another error or ask us.