Close
0%
0%

Why I built an LED luminosity tuner

It was always annoying to guess at the brightness of an indicator and calculate the LED resistor

Similar projects worth following
The problem: LEDs are annoying 5mA is very different from LED to LED. What works for one LED doesn't work for another.

But problem at the end isn't to calculate the current but to actually get the brightness you want. None of the calculations give you the results.

Each situation demands a different approach. Whether it's a UI or perhaps some indicators inside an enclosure, you're trying to ensure visibility in bright environments. I'm sure you've seen examples of non-ideal implementation.

Have you ever tried to explain how to calculate this to a non engineer? I'm sure there are makers, artists and hobbyists that wouldn't mind an easier way.

My solution is a constant current dimming circuit with a self-calibrating ADC that measures and calculates for you. What you see is what you get.

The problem:

Here is a comparison for forward voltage and luminosity (mcd) at 20mA for an 0603 green LED that might be used for indicators, note the variance in forward voltage and the amount of light produced.  There are also variations between different components from the same manufacturer!  So picking 10mA isn't always a good option for designing indicators. 

Our eyes have a logarithmic response to light.  

Source: https://www.telescope-optics.net/eye_intensity_response.htm

LED IV curve is non linear.  

SOLUTION:

Design a device that lets you adjust the luminosity of the LED while giving me all the measurements at that brightness for whatever system voltage I'm working with.  Simply put, light an LED, dim it and measure for the current to determine the current limiting resistor for a given system voltage. 

The Dimming Circuit:

The original circuit was designed built around the Analog Devices LT3085 (diagram below) to provide the constant current dimming circuit.  It worked well but was expensive and since it's integrated, limited to what can be done with it.

So I designed my own constant current dimming circuit. 

The final design is within 70PPM error between 10-80C by compensating the thermal coefficient. 

The LED forward voltage is within 0.04V of my calibrated FLUKE 87!

The curve is linear for the entire throw of the dimming potentiometer.  

To simulate the changing resistance of a variable resistor in LTSpice.  Place this in the RESISTANCE fileld:    R=100k-(100k*time)

This project was challenging in many ways:

1. Originally was designed as 2 PCBs sandwiched with standoffs but my wife said it looked unfinished.  I like the exposed look of it.  This took my usual 2 dimensional design into 3 dimensions and took a few iterations to get right.

2. The analog design is challenging and very touchy.  Many simulations and test circuits brought me to my final design.

3. To get precision from the ADC required some interesting solutions.  The debugging was fun also. 

4. Final design to improve accuracy and make calibration easy as well as put it into a nice case.

(this post in being worked on... adding data and notes over time)

THE JOURNEY :

The journey was long with a lot of mistakes and challenges.  For instance

I was wondering why I was not getting a good reference for the ADC, and it was because I forgot to connect AVCC to the MCU.  I placed a LC filter and it is now referencing an external 5V from an LDO.  

Initially the software caused a lot of headaches.  With INT and FLOAT math with all the divisions, cause a lot of truncation (and later, overflows). I multiplied values to increase the resolution.  Then I needed to create conditional statements to output the correct values... no one wants to see 10000 Ω, so conditional if else statements now show as 10k.

There were so many things I learned along the way it's hard to list them all.  The design keeps improving and hope that one day it gets into the hands of people who can use it to simplify their LED design. 

The results are much better than I had originally intended and it really is a sum of many ideas I've had over the years. 

eeZ-LED Datasheet.pdf

Datasheet

Adobe Portable Document Format - 1.23 MB - 05/02/2026 at 18:00

Preview

  • Updates

    charlie.h.kim5 hours ago 0 comments

    UPDATES:

    5/3/26  -     Software update: 

    Show the true values of 1% resistors available on the market -  next highest 1% E96 value.  

    Implemented 96 value array was saved to flash (free up RAM)

    const int E96_TABLE[] PROGMEM = { 100, 102, 105, 107, 110, 113, 115, 118, 121, 124, 127, 130, 133, 137, 140, 143, 147, 150, 154, 158, 162, 165, 169, 174, 178, 182, 187, 191, 196, 200, 205, 210, 215, 221, 226, 232, 237, 243, 249, 255, 261, 267, 274, 280, 287, 294, 301, 309, 316, 324, 332, 340, 348, 357, 365, 374, 383, 392, 402, 412, 422, 432, 442, 453, 464, 475, 487, 499, 511, 523, 536, 549, 562, 576, 590, 604, 619, 634, 649, 665, 681, 698, 715, 732, 750, 768, 787, 806, 825, 845, 866, 887, 909, 931, 953, 976 };

    The measured resistance is converted to 100's value and is compared with a switch case.  Then the value is changed back to show the correct decade. 

    5/5/26 -   Reconfigured the hardware dimming circuit, improved dimming, it now gets into the nA range now.  To compensate I've increased sampling to get 14 bit resolution.  That gives me 2.2uA resolution.  We are now running into the limits of what the potentiometer can do and it's own resistance.  Practically, we are able to measure down to about 10-30 uA.  Had a lot of math overflow issues to contend with, have had to use 32bit UL casting to ensure no overflow. 

    5/6/26 -  Schematics and layout updated for the next generation of design.   The device is now becoming a precision instrument. 

View project log

Enjoy this project?

Share

Discussions

Ken Yap wrote 4 days ago point

It's interesting that you picked the green LEDs for your example. You'll find that you actually have two types of green LEDs in your table. The Wurth, Feztek and Vishay green LEDs have a different material which is more efficient and the forward voltage is around 3V compared to the 2+V of the others. They cost more and the colour is usually described as emerald.

  Are you sure? yes | no

charlie.h.kim wrote 2 days ago point

That's a great point! You run into the same issues with other colors.  I'm not a semiconductor designer, GaAsP RED LEDs have different qualities than GaAlAs RED LEDs.  Usually we just filter by red LED and read datasheets when we look for one.  Where this device comes in handy is to just for setting luminosity for LEDs (brightness or power conservation).   

  Are you sure? yes | no

Does this project spark your interest?

Become a member to follow this project and never miss any updates