A Beginner’s Guide to Working with LEDs
14th February 2025LEDs (Light Emitting Diodes) are a fundamental component in electronic circuits, providing a simple way to add light to your projects. In this guide, we’ll cover the basics of working with LEDs, including through hole and surface mount technology. We’ll also provide calculations for determining the required resistor value when powering an LED from 5V or 3.3V
5mm clear LEDs
These clear 5mm LEDs appear translucent when they are off and illuminate in your chosen colour when voltage is applied.…
Through Hole vs Surface Mount Technology
When choosing an LED, you’ll often come across two types: through hole and surface mount. The main difference between the two is how they’re mounted on a circuit board.
- Through Hole: This type of LED has leads that protrude from the package, allowing it to be soldered directly onto the board. Through holes are easy to work with, but can make your design more complex.
- Surface Mount: This type of LED has tiny leads that require a special tool (such as an iron or hot air gun) to solder. Surface mount LEDs are smaller and more compact, making them ideal for high-density designs.
Calculating the Required Resistor Value
When powering an LED from 5V or 3.3V, you’ll need to calculate the required resistor value to ensure the LED receives the correct voltage. The formula is:
R = (V – VLED) / I
Where:
- R is the required resistor value
- V is the voltage source (5V or 3.3V)
- VLED is the voltage drop across the LED (typically 2-3V)
- I is the current drawn by the LED (typically 10-20mA)
For example, if you’re using a 5V source and an LED with a voltage drop of 2.5V:
R = (5 – 2.5) / 0.01 = 2.5 / 0.01 = 250 ohms
So, the required resistor value would be 250 ohms.
Recommended Resistor Values for Common LED Voltages
Voltage | Recommended Resistor Value |
---|---|
5V (LED voltage: 2-3V) | 100 – 500 ohms |
3.3V (LED voltage: 1.8-2.2V) | 180 – 680 ohms |
Calculations for Resistor Value
Here are some examples of resistor value calculations:
- For a 5V source and an LED with a voltage drop of 2.5V:
- R = (5 – 2.5) / 0.01
- R = 250 ohms
- For a 3.3V source and an LED with a voltage drop of 1.8V:
- R = (3.3 – 1.8) / 0.005
- R = 300 ohms
Simulation
Have a play with this simulator, try changing the voltage and the resistor value to see how it affects the current flowing through the LED.
Conclusion
Working with LEDs can seem intimidating, but with this beginner’s guide, you’ll be well on your way to creating your own LED projects. Remember to consider both through hole and surface mount technology when choosing an LED for your design. By following the calculations provided in this post, you’ll ensure that your LED receives the correct voltage and current.