Author Topic: Calculating Resistor value for blue LEDs (charlieplex shield)  (Read 5969 times)

naeger

  • Newbie
  • *
  • Posts: 7
Calculating Resistor value for blue LEDs (charlieplex shield)
« on: February 09, 2013, 08:27:44 am »
Hi,

i bought the charlieplex shield (pcb only, not the kit). Now, I would like to equip it with blue LEDs (3mm, 3.0-3.3V, 20-30mA). Can someone help me with calculating the correct resistor values?

Thank you! Chris

barnacleBudd

  • Newbie
  • *
  • Posts: 21
Re: Calculating Resistor value for blue LEDs (charlieplex shield)
« Reply #1 on: February 09, 2013, 09:06:15 am »
You can use Ohm's Law to calculate the resistor. R = E / I or resistance = voltage / current
20 mA = 0.020 A so ... R = 5v / 0.020A = 250 Ohms
You can use a standard value: 220 (red red brown) which will be bright
You could also use 470 (yellow violet brown) which will be a little dimmer

naeger

  • Newbie
  • *
  • Posts: 7
Re: Calculating Resistor value for blue LEDs (charlieplex shield)
« Reply #2 on: February 09, 2013, 09:15:35 am »
I am afraid it is not so easy. The charlieplex kit comes with red LEDs and only 47 Ohm resistors (see http://digistump.com/wiki/digispark/tutorials/led). I played around with Ohm's law but I cannot bring the spec of the red LED (typically 20mA at 1.8-2.2V) in relation with the included 47 Ohm resistors. 

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: Calculating Resistor value for blue LEDs (charlieplex shield)
« Reply #3 on: February 09, 2013, 02:34:50 pm »
LED datasheets typically have a rating for constant power supply (about 20-30ma usually), and another rating for when they're used in displays like charlieplexing - 1/10th duty cycle on for no longer than a millisecond or so, which is often around 150ma. Charlieplex Shield resistors maybe some compromise between those two spots.

naeger

  • Newbie
  • *
  • Posts: 7
Re: Calculating Resistor value for blue LEDs (charlieplex shield)
« Reply #4 on: February 09, 2013, 02:44:25 pm »
Hmm....
So basically, the 47 Ohm for the red LEDs is just a trial and error thing?
What would you advise for my blue LEDs? I only have the 20mA and 3.0-3.3V values from the specs. I have 10 Ohm and 47 Ohm resistors. Do you think 10Ohm will blow them? Or just use 47 Ohm (like with the red LEDs which have way lower voltages)?

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: Calculating Resistor value for blue LEDs (charlieplex shield)
« Reply #5 on: February 09, 2013, 02:50:02 pm »
47ohm will probably be fine. The AVR chip can't deliver much more than 40ma through it's IO pins anyway.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: Calculating Resistor value for blue LEDs (charlieplex shield)
« Reply #6 on: February 09, 2013, 02:50:58 pm »
Just try not to let it sit on one LED for too long if using a resistor lower than 100ohm. If it's glitching and stopped cycling through unplug it.

naeger

  • Newbie
  • *
  • Posts: 7
Re: Calculating Resistor value for blue LEDs (charlieplex shield)
« Reply #7 on: February 09, 2013, 02:54:05 pm »
OK. Heating up the soldering iron :)

I was just worried that I could not use the same 47 Ohm resistors while replacing the LEDs with ones which require <50% the voltage...

Thanks for your help.

barnacleBudd

  • Newbie
  • *
  • Posts: 21
Re: Calculating Resistor value for blue LEDs (charlieplex shield)
« Reply #8 on: February 09, 2013, 03:31:24 pm »
I was only thinking of one LED when calculating the limiting resistor value. I looked at http://digistump.com/wiki/digispark/tutorials/led and see that they are using one resistor for each row of 4 LEDs. I would go with the ones they provide. Typically displays like this work by turning different LEDs on and off vary rapidly so that the human eye thinks they are all on at once.