Post Reply 
Calculate RL resistor for LEDs diodes
12-29-2013, 07:56 PM (This post was last modified: 12-29-2013 08:49 PM by ArielPalazzesi.)
Post: #1
Calculate RL resistor for LEDs diodes
Hello!

I leave the link to a small program I wrote to calculate the current limiting resistor for a given number of LED diodes in series.

http://www.ucontrol.com.ar/forosmf/tutor.../#msg82727

It's in Spanish, but if you think you need someone can translate it to English language.
I hope you find it useful.

[Image: ?action=dlattach;attach=16081][Image: ?action=dlattach;attach=16083][Image: ?action=dlattach;attach=16079]

Code:

EXPORT resistencia_led()
BEGIN

//Declaro variables:
local RL, VLED, NLED, ILED,VCC,POT;
local lista1, lista2;

lista1 := {"Vcc:", "VLED:", "ILED:","nLED:"};
lista2 := {"Tensión de la fuente (V)","Tensión del LED (V)","Corriente del LED (A)","Número de LEDs conectados en serie"};

INPUT ({VCC,VLED, ILED,NLED},"Cálculo resistencia limitadora (Ohms)",lista1, lista2);

RL := (VCC-VLED*NLED)/ILED;

IF RL<0 THEN
  MSGBOX("El número de LEDs excede la tensión de la fuente.");
ELSE
  POT := (ILED^2)*RL;
  RL := ROUND(RL,0);
  POT := ROUND(POT,1);
  print (RL);
  print (POT);
  MSGBOX("La resistencia limitadora debe ser de "+ RL +" Ohm(s) y al menos " + POT+ " Watt(s).");
END;

END;


Greetings.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)