• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Microcontroller Tips

Microcontroller engineering resources, new microcontroller products and electronics engineering news

  • Products
    • 8-bit
    • 16-bit
    • 32-bit
    • 64-bit
  • Applications
    • 5G
    • Automotive
    • Connectivity
    • Consumer Electronics
    • EV Engineering
    • Industrial
    • IoT
    • Medical
    • Security
    • Telecommunications
    • Wearables
    • Wireless
  • Learn
    • eBooks / Tech Tips
    • EE Training Days
    • FAQs
    • Learning Center
    • Tech Toolboxes
    • Webinars/Digital Events
  • Resources
    • Design Guide Library
    • DesignFast
    • LEAP Awards
    • Podcasts
    • White Papers
  • Videos
    • EE Videos & Interviews
    • Teardown Videos
  • EE Forums
    • EDABoard.com
    • Electro-Tech-Online.com
  • Engineering Training Days
  • Advertise
  • Subscribe

Selecting an LED and finding the correct size resistor

August 4, 2017 By Scott Thornton 1 Comment

Light Emitting Diodes (LEDs) are diodes that emit light when energized. LEDs can light a room now, whereas for decades they had been too weak to do much more than act as indicators. LEDs are fun to play with, and a fairly safe way to introduce kids to principles of circuits. There’s just a few things you need to know before you start connecting LEDs to batteries.

Selecting an LED: brightness and viewing angle

Figure 1: Through-hole indicator LEDs from Cree. (Source: Cree)

You should know how bright you want the LED to be (luminous intensity), what color (or if precision is needed, what wavelength), the viewing angle, and how physically large you want the LED to be. Brightness is actually a concern. Some LEDs are uncomfortably bright and some are meant to be very dim. It’s difficult to convey levels of brightness in an article, so you might want to familiarize yourself first by buying a few LEDs with varying luminous intensities. The example below includes a moderately bright LED at 605 mcd.

Look for an “indicator LED” or “through-hole” variety if you are working with a breadboard, PCB, or simply want the LEDs with wires you can attach to the resistor and battery with alligator clips (you don’t want to accidentally buy fixture-style LEDs). Luminous intensity is measured in millicandelas (mcd). As for viewing angle, not all LEDs can be viewed from all directions at 360 degrees like an incandescent light bulb. The viewing angle may not mean much for playing around with LEDs, but a 15-degree viewing angle is similar to only seeing the LED when looking at it straight on. Just like some LED TVs cannot be viewed that well from a recliner that’s placed too far off to the side of an LED TV, the indicator LED for your breadboard is exactly the same. Wavelength corresponds to color, but most datasheets will state the color directly, as well as include wavelength. Wavelength is handy if you are trying to match the exact color of another LED and know the wavelength, or if you are using LEDs to cure paint or nail polish. For example, curing a liquid that will only harden at a certain wavelength is not going to work nearly as well if the LED is emitting the wrong wavelength. Some nail polish will only cure with exposure to a narrow range of UV light, thus a curing lamp may not work at all for another manufacturer’s nail polish.

LEDs are polarity-sensitive. Much like a battery, they will not work if the anode (+) and cathode (-) are not biased properly. If an LED isn’t lighting up, try swapping it around.

Choosing the correct resistor

It is possible to light up an LED using a battery with no resistor at all, but if you don’t accurately match the LED to the rated voltage and current for the LED, the LED might be dim or too bright (and get hot), or the LED could even explode. Without a resistor to limit the current through the LED, the LED will inevitably wear out faster (grow dim and go out).

If you want a more permanent solution, you need a resistor in series with the LED to limit the current going through the LED. The value of the resistor is related to ohm’s law (V = IR). You need to know the power supply voltage (e.g., total battery voltage), the required voltage drop on the LED to make it light up, and the amount of current that should flow through the LED to turn it on.

The recommended operating current and voltage for the LED can be found in the LED’s datasheet. The LED’s operating voltage is usually referred to as forward voltage (). This is the voltage drop needed across the LED to get it to light up. The LED’s operating current is typically listed as forward current ().

Calculating resistor value

Use this formula to calculate the value of the resistor to be placed in series with the LED:

; where  is the supply voltage. LEDs need direct current (DC), not alternating current (AC). A battery or AC power that’s converted to DC will work.

Calculating resistor wattage

Don’t forget about wattage for the resistor. If the resistor’s rating is too low, then it will get hot as it tries to deal with a heavier flow of current than it’s rated to handle. Watts are a unit of measure for power, therefore:

P=VI; where P is the wattage of the resistor, V is the voltage drop across the resistor, and I is the expected current flowing through the resistor.

The circuit for the LED is rather simple, and looks like that in Figure 1.

Figure 2: Resistor in series with an LED and battery, polarities shown.

Example:

The Cree C4SMF-BJF-CR24Q4T2 is a blue, 4 mm through-hole LED that’s just a few cents at distributors like mouser.com. It’s bright enough for indoor work at 605 mcd. Per the values in Mouser Electronics’ parametric search for this part number, the forward current is 20 mA (or 0.02 A) and  is 3.4 V. If we have a 9V battery (), then we can calculate that we need a resistor that’s 280 ohms:

The rated wattage of the resistor is:

P = VI =  x 0.20A = 0.112

The rated watts for the resistor needs to be at least 1/10 w, but a more standard number is ¼ watt, thus we can use a quarter watt 280-ohm resistor. Higher wattage resistors will also work.

 

 

Filed Under: FAQ, Featured Tagged With: basics, FAQ

Reader Interactions

Comments

  1. toshiba laptop support says

    October 11, 2018 at 6:52 am

    The required voltage drop on the LED to make it light up, and the amount of current that should flow through the LED to turn it on. The LED’s operating voltage is usually referred to as forwarding voltage (). This is the voltage drop needed across the LED to get it to light up.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Featured Contributions

Five challenges for developing next-generation ADAS and autonomous vehicles

Securing IoT devices against quantum computing risks

RISC-V implementation strategies for certification of safety-critical systems

What’s new with Matter: how Matter 1.4 is reshaping interoperability and energy management

Edge AI: Revolutionizing real-time data processing and automation

More Featured Contributions

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center

EE ENGINEERING TRAINING DAYS

engineering
“bills
“microcontroller
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

DesignFast

Design Fast Logo
Component Selection Made Simple.

Try it Today
design fast globle

Footer

Microcontroller Tips

EE World Online Network

  • 5G Technology World
  • EE World Online
  • Engineers Garage
  • Analog IC Tips
  • Battery Power Tips
  • Connector Tips
  • DesignFast
  • EDA Board Forums
  • Electro Tech Online Forums
  • EV Engineering
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips

Microcontroller Tips

  • Subscribe to our newsletter
  • Advertise with us
  • Contact us
  • About us

Copyright © 2025 · WTWH Media LLC and its licensors. All rights reserved.
The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media.

Privacy Policy