Light Emitting Diodes (LEDs) are one of the most fundamental output devices used in open source projects. They provide you a simple way to provide feedback to a user on the status of what’s going on in a circuit. A popular use is a power indicator to let the user know if a device is on.
But connecting an LED directly to a power source can cause an LED to burn out. You have to utilize a current limiting resistor in series with the LED for protection.
Calculating the value of the resistor will require gathering a few bits of information about your LED from its data sheet. Specifically, we will need to determine the LED’s Forward Voltage (Vf) and it’s Maximum Current Rating (Imax). Vf tells us what voltage is required to bias the LED to turn on. Imax tells us the maximum current the LED can handle. We also need to know the voltage of the power supply that will be powering the LED. With this information in hand we can apply the following formula:
Let’s assume the following:
Vsupply = 5V
Vf = 1.7V
Imax = 20mA
Now we apply those variables to the formula and we get the following:
You may be asking yourself why are you rounding up to 220Ω when the calculation comes out to 165Ω? Simply put, this is where the academic separates from the real-world. When it comes to manufacturing of components, there are no 165Ω resistors manufactured. So you have to settle for the closet value that you can actually acquire from sources such as Mouser Electronics.
So is that it? Well, not quite. Remember another important specification of a resistor is its power rating, measured in watts. To calculate the power rating of the resistor we have to use Joule’s power law:
Based on the calculation, then 1/8W resistor will work just fine, though a 1/4W resistor may be easier to get your hands on. A resistor of either power rating will work.
A word of caution when powering multiple LEDs. You may be tempted to save on board space or resistor count by using one resistor for many LEDs. Do not do this. LEDs, like most electronic components are not ideal. Some LEDs may have lower voltage drops then others, this will result in a greater current flowing through them thus possibly resulting in the LEDs destruction. Always use one resistor for each LED to compensate for the varying forward voltages. If you do need to conserve board space then consider resistor networks that offer multiple resistors in one tiny package and share one common pin. See Figure 2 for an example.
There you have it, everything you need to know to appropriately size a current limiting resistor. You will user current limiting resistors in many applications, not just for powering LEDs. Hopefully this gives you enough of a background to get started building your own LED-powered projects.
Michael Parks, P.E. is the co-founder of Green Shoe Garage, a custom electronics design studio and embedded security research firm located in Western Maryland. He produces the Gears of Resistance Podcast to help raise public awareness of technical and scientific matters. Michael is also a licensed Professional Engineer in the state of Maryland and holds a Master’s degree in systems engineering from Johns Hopkins University.
Privacy Center |
Terms and Conditions
Copyright ©2023 Mouser Electronics, Inc.
Mouser® and Mouser Electronics® are trademarks of Mouser Electronics, Inc. in the U.S. and/or other countries.
All other trademarks are the property of their respective owners.
Corporate headquarters and logistics center in Mansfield, Texas USA.