26

Making a blinking light seems to be one of the most common beginner projects with Arduino. A typical approach is to connect an LED + resistor (in series) to an IO pin, and connect the other end to ground. In code, you make the pin an output, and bring it HIGH and LOW repeatedly to flash the LED.

What happens if you leave that resistor out? Obviously you're going to wreck the LED, but will it also damage the Arduino in some way?

The Guy with The Hat
5,2927 gold badges30 silver badges51 bronze badges
asked Feb 14, 2014 at 12:06

3 Answers 3

19

From page 411 of the ATmega328P data sheet, we have a graph of the output current vs voltage.

Output current graph

We can see over the the 20mA range of output currents, we drop ~0.5V, giving an approximate internal resistance of 25Ω.

A typical LED has a forward voltage of about 2V. Therefore, we end up in the situation where we will drop 3V over the 25Ω internal resistance of the ATmega328P, giving an output current of 120mA.

I = (5-2)V / 25Ω = 120mA

This is a simplification, but this 120mA is far larger than the recommended maximum current per pin of 40mA of the microcontroller, and far in excess of what a normal LED should take.

That said, most LEDs and the ATmega328P seem to survive this kind of abuse, especially for short periods. In general, if the pin continues to work after this is done, it should be fine.

answered Feb 14, 2014 at 13:02
15

Leaving series resistors out will definitely greatly (exponentially) shorten lifetime of both the controller and the LED. Absolute maximum ratings for most AVRs are (a.o.):

  • max. 40mA per GPIO pin
  • max. 200mA per package.

A new Arduino sets you back 20ドル or more, a fist full 220 ohm resistors sets you back 1$. When treated within spec, an Arduino (and LEDs for that matter) can survive a lifetime.

answered Feb 14, 2014 at 13:30
0

I have done this once (being a beginner concerning electronics). The LED died, luckily the Arduino survived (without any pin problems).

Wouldn't recommend this as it is not good for the Arduino.

answered Mar 24, 2017 at 16:37

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.