My son is just beginning to use he Arduino Uno, but has run into a question. He has done some of the basic LED blinking projects and noticed that every time a LED is used they use a resistor. But, he can do the project without the resistor and it works fine. We understand the resistor is to protect the LED, but it there another reason?
But, he can do the project without the resistor and it works fine
..for a while.
The resistor is there to protect the LED, but more importantly, it is there to protect the microcontroller's output pin (or whatever is supplying the current), which is a more expensive resource than the LED.
It'll end in tears, so until he understands what is going on, try to dissuade him from going off-piste.
OldSwimmer1500:
My son is just beginning to use he Arduino Uno, but has run into a question. He has done some of the basic LED blinking projects and noticed that every time a LED is used they use a resistor. But, he can do the project without the resistor and it works fine.
Diodes (Including LEDs) are non-linear. Their resistance changes with applied voltage. When you apply a small voltage, the resistance is high and very little current flows. As you approach the rated forward voltage (around 2V for a typical LED), the resistance suddenly drops and you get lots of current... You'll get as much current as the source (the Arduino) can provide, or as much as it takes to burn-out the LED.
LEDs are considered "constant voltage" devices. You supply a constant current and the LED's forward breakdown voltage is held (approximately) constant by the characteristics of the LED. With components in series, the voltage is divided among the components. As long as the 5V Arduino output remains constant, and the voltage across the LED remains constant (about 2V) the voltage across the resistor remains constant (about 3V). The resistor is a linear device, so current is proportional to voltage. As long as the voltage across the resistor remains constant, the current through it remains constant. The same current flows through series components (the LED and resistor), so you have a constant current source!
And
Under normal conditions you should be getting about 5V out of the Arduino when the output is high. But if you have a multimeter, you'd find that you are only getting slightly more than the rated LED voltage, and if you measure current you'll find that you are exceeding the Arduino's rated maximum output current of 40mA.
If electronics is going to be a hobby for you son, I suggest he get a multimeter. (Here in the U.S. you can get one online starting at about $10 USD.)
He also needs to understand [u]Ohm's Law[/u] which describes the relationship between voltage, resistance, and current, and [u]Kirchhoff's Laws[/u] which describe how voltage divides in series circuits and how current divides in parallel circuits.