TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Calculating Current Limiting Resistor Values for LED Circuits

51 pointsby lightlyusedover 3 years ago

7 comments

ameliusover 3 years ago
Digikey has some nice in-depth articles about driving LEDs, e.g.:<p><a href="https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;articles&#x2F;driving-leds-to-cap-or-not-to-cap" rel="nofollow">https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;articles&#x2F;driving-leds-to-cap-or-n...</a><p><a href="https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;articles&#x2F;optimizing-led-performance" rel="nofollow">https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;articles&#x2F;optimizing-led-performan...</a><p><a href="https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;articles&#x2F;maximizing-led-luminosity-to-drive-down-system-cost" rel="nofollow">https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;articles&#x2F;maximizing-led-luminosit...</a><p><a href="https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;articles&#x2F;driving-leds--choosing-between-analog-and-digital-topologies" rel="nofollow">https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;articles&#x2F;driving-leds--choosing-b...</a><p><a href="https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;articles&#x2F;driving-leds-how-to-choose-the-right-power-supply" rel="nofollow">https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;articles&#x2F;driving-leds-how-to-choo...</a><p><a href="https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;articles&#x2F;ac-leds-gain-in-popularity" rel="nofollow">https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;articles&#x2F;ac-leds-gain-in-populari...</a><p><a href="https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;articles&#x2F;how-to-drive-multicolor-leds" rel="nofollow">https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;articles&#x2F;how-to-drive-multicolor-...</a>
po1ntover 3 years ago
This is nice article but every engineer would say this is oversimplification for simple usecases like status LEDs on router. LEDs are tricky to make behave predictably as they are non-linear components, sensitive to temperature and no two LEDs are made the same. This really shows when connected in parallel. Also different colors of LED have different efficiency.<p>These issues are more prevalent if you&#x27;re trying to make high-power LED circuits or some RGB circuit with accurate representation of colors.<p>Always thought LEDs are my friend but they made me lose some hair in last years.
评论 #29011708 未加载
评论 #29014301 未加载
评论 #29011349 未加载
评论 #29015252 未加载
评论 #29012173 未加载
londons_exploreover 3 years ago
It&#x27;s worth noting that while it isn&#x27;t within spec, and certainly isn&#x27;t good engineering practice, in most cases connecting an LED directly to a microcontroller output pin with no resistor works just fine.<p>Most microcontrollers have effectively a fixed output drive current of something between 10 milliamps and 50 milliamps (which depends on the size of the drive mosfet on the output pin, and might be different for pull-high vs pull-low mosfets). Most LED&#x27;s can handle that just fine.<p>The energy that would have been dissipated in the resistor ends up dissipated in the microcontroller instead, but that normally doesn&#x27;t lead to issues.
评论 #29012524 未加载
unwindover 3 years ago
It seems to be an article-length piece, leading up to a downloadable spreadsheet. That&#x27;s ... not so accessible. I quickly found [1] at Digi-Key which is a simple online calculator. It also features a handy table of reference voltages for various colors of LED, which I appreciated.<p>Ideally I guess the color should be choosable and used to populate the voltage, but that seems to be Super-Advanced Thinking in this area.<p>The full set of calculators [2] seems quite impressive and useful, too.<p>[1]: <a href="https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;resources&#x2F;conversion-calculators&#x2F;conversion-calculator-led-series-resistor" rel="nofollow">https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;resources&#x2F;conversion-calculators&#x2F;...</a><p>[2]: <a href="https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;resources&#x2F;online-conversion-calculators" rel="nofollow">https:&#x2F;&#x2F;www.digikey.com&#x2F;en&#x2F;resources&#x2F;online-conversion-calcu...</a>
评论 #29014065 未加载
compumikeover 3 years ago
Even when you apply the formulas in the linked spreadsheet, you can get into trouble because it seems to assume V_led is fixed.<p>For an example of how quickly this can go wrong, see my accepted answer to “Why is my LED circuit drawing 50% more mA than I calculated?” <a href="https:&#x2F;&#x2F;electronics.stackexchange.com&#x2F;questions&#x2F;572739&#x2F;why-is-my-led-circuit-drawing-50-more-ma-than-i-calculated" rel="nofollow">https:&#x2F;&#x2F;electronics.stackexchange.com&#x2F;questions&#x2F;572739&#x2F;why-i...</a>
评论 #29013498 未加载
phkahlerover 3 years ago
While we&#x27;re talking LEDs:<p><a href="https:&#x2F;&#x2F;gist.github.com&#x2F;phkahler&#x2F;1ddddb79fc57072c4269fdd6716bfb72" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;phkahler&#x2F;1ddddb79fc57072c4269fdd6716...</a><p>In 6 lines we smoothly blink (fade on and off) an LED on a regular GPIO pin. Uses some fixed-point math and pulse-density modulation.
评论 #29014915 未加载
linker3000over 3 years ago
<a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;AskElectronics&#x2F;wiki&#x2F;design&#x2F;leds" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;AskElectronics&#x2F;wiki&#x2F;design&#x2F;leds</a>