Just wondering how to figure out resistor values for different LED colours

My Shruthi-1 came with yellow LEDs and 220 ohm resistors, and I put blue LEDs on my new/used XT with the stock 220 ohm resistors and wow are they bright! I’m thinking about doing blue or green LEDs on the new XT but I’m not sure how to figure out which resistor value to use. Anyone care to offer an idea?


There are two things to check in the datasheet: the curve giving the voltage/current characteristic of the LED (you’ll probably find tutorials on the web showing how to use them to find out the operating voltage/current for a giving supply voltage/current limiting resistor combo) ; and the curve giving the relationship between current and brightness (most of the time linear, and sometimes just listed as “30 mcd at 10mA”). Brightness above 30 mcd starts being violent for the eyes.

Or, do what I did and throw some dice. I put some 4.7k’s in for blues and it worked out great. Although, Frank’s way is much cooler

Thanks Olivier, I just need to try and understand what it was you wrote. Research, research. Frank is always cool I think. I’ll probably end up doing it qp’s way. For the existing XT, I made a bezel to cover the LEDs at home, but my son wanted the ceiling to light up on a gig!

just take one of the type of leds and make a little circuit maybe breadboard or crocos and try some different resistors till you think it’s ok

OK, I’ll try to work an example…

For example, you want to check how much light you’ll get out of this LED with 5V and a 220R resistor.

You take the first small graph on page 3, the one giving forward current as a function of forward voltage. The goal is to find at which point in this curve the circuit operates with a 5V supply and a 220R resistor.

  • Let’s make a first guess : 1.5V / 0mA. This means the resistor has a 3.5V drop across its terminals, so 16mA flows through it and this contradicts the 0mA.
  • 1.7V? This means the resistor has a 3.3V drop, 15mA flows through it, and this contradicts the 1mA read on the curve.
  • 1.9V? The resistor has a 3.1V drop, 14.1mA flows through it, and this contradicts the 5mA read on the curve.
  • 2.1V? The resistor has a 2.9V drop, 13.2mA flows through it, and this contradicts the 15mA read on the curve, but in a different direction, we step back…
  • 2.0V? The resistor has a 3.0V drop, 13.6mA flows through it, and this contradicts the 10mA read on the curve.
  • 2.05V? The resistor has a 2.95V drop, 13.4mA flows through it, and this is more or less what we read on the curve.

Obviously, I have described the tedious manual process here, but you can directly solve this by plotting the characteristic curve of the power supply (i = (5 - V) / 220) and find the intersection on the graph.

Now that you know that 13.4mA will flow through the LED, you go to the second graph on that page, which simply tells you that luminous intensity is directly proportional to current (it’s rarely different). Now you go to page 2, and you read that luminous intensity is typically 6mcd at 10mA. So here it will be 6 * 13.4 / 10 = 8 mcd.

It’s good to know how to do that, when you have to do it for super tiny SMD LEDs, or when you have to pick a LED bright enough given a limited current budget.

Wow, thanks Olivier!

If I want to experiment with different values, would a 9V battery be a representative power source?

It doesn’t matter how you power the Shruthi-1, you’ll always get +5V to power the digital board.

Wow, that’s an interresting post ! Thx olivier !

I was thinking about just powering a quick breadboard circuit with the 9V, but Olivier, you have answered my question.

A quick and easy way to get +5V on a breadboard is to cut up an unused USB cable. In most cases the red wire is the +5V and the black wire is ground.

Thanks. I tried one resistor and one green LED on the Shruthi board, 510 ohm seems to work fine. That’s what the supplier of the blue LEDs included but they work well with green too.

if you take 5v from an usb cable connected to your computer be aware that your computers psu might not like it if you draw lots of current (for example by making shorts).
i always use a little 7805 setup for 5v to be safe because i am stupid enough to connect 5v to ground and stuff like that…

even easier, if you’re trying to find out which resistor works with your leds directly on your shruthi, just solder 1 led and try different resistors just by holding them in place. after decision you can match a few with your multimeter