Illuminated Switch Resistor Size Question

Hi–I’m having trouble calculating the appropriate resistor for an illuminated switch. I saw the formula but am not sure where to get the value for I-LED, and I’m not sure how to interpret the V-LED. So, I asked ChatGPT, and it gave an answer, but I wanted to get confirmation before I blow up a LIon battery (hyperbole).

I will be running the switch on the Free2 pin.
This is the information I have on the switch:

Material: Aluminium Oxide
Color: Black
LED Color: Red Yellow Green Blue White (I purchased blue, yellow, and white ones–no red)
Press Distance: ≤0.5mm
Waterproof Grade: IP65 (customizable IP67)
LED Voltage: 3-6V
Operation Type: Momentary Reset (like the button of Car or Computer)
Contact structure: One normally open (1NO)
Hole size: 12mm
Current limit: ≤1A
Head shape: Flat/high/spherical (customizable)

Voltage Selection: 3-6V: 3V 5V 6V

and the answer from chatgpt:

From the provided details, it seems that the LED voltage can be within the range of 3-6V. Since you’ll be connecting it to the Free2 pin on the Proffieboard, which operates at 3.3V, it’s safe to assume the LED voltage will be around 3.3V to match the supply voltage.

R = (3.3V - 3.3V) / 0.02A = 0 Ohm

However, it’s uncommon to have zero resistance, so you may want to double-check the specifications or use a very low-value resistor like 1Ω for protection, although it may not significantly affect the circuit.

I don’t think the LED will voltage match and run at 3.3V. The documentation says 3V 5V 6V. If the LED runs at 3V, it would need 15 Ohm, assuming 0.02A ILED–but I cannot find documentation on the mAh needed, and dividing by fractions… if it’s 0.01A ILED, I would need 30 Ohm.

Does it matter if I go a over? I have 22, 47, 68, 100 Ohm resistors (and higher). I didn’t know I’d need to know that when I ordered them… i thought all I’d ever need were 330 or 470 Ohm resistors for data and 2k to 100k for blade id.

Any insight will be appreciated. Thanks.

1 Like

Iled is most likely 20mA, most small LEDs are made for 20mA.
Vled is a little trickier. You can make a reasonable guess baded on the color, but it’s better to look it up in a data sheet, or measure it with a multimeter.

A bare LED has a pretty narrow voltage range, but since yours says 3-6 volts, it probably already has a resistor in there, and that would mean you don’t need one.

2 Likes

At the risk of upsetting the technical purists, my own experience, such as it is, is that you can safely go over a calculated resistor value by some margin without any noticeable problem. For something like a switch LED, absolute brightness isn’t really that important as long as it’s bright enough. So if a calculation says you need a 50 ohm resistor but all you have in your workshop is 100 ohm, then I would say 100 ohm will work fine. Once you get up to 250 ohms, you might start to notice that the LED looks a bit dim, but at 100 ohm it will look fine.

The only caveat I personally go by is to make sure you over-resist rather than under, as under-resistoring can, in theory I gather, shorten the life of the LED.

For Proffie installs, I tend not to use that many values: 47 ohm on green and blue LEDs, 100 ohm on red, 330 or 470 on data lines, and 22k or higher for blade ID. Tri Crees for base lit hilts I think need a little more care as they are big burners and resistor wattage becomes a factor, but I reckon for any accent LEDs, you can get away with quite a lot.

But as I say, I don’t profess to be an LED expert - I’m just going on what I’ve tried and observed over the years. :slight_smile:

2 Likes

Thank you Sabersense,
I’m not worried about brightness on an illuminated switch–it just needs to light up–so knowing I can go over a bit and be safe is good to know. I was looking for a simple table with recommended resistor values–I asked here because I didn’t find one… but I just looked again, and of course, found one in the V2 Proffie manual. The link to the LED resistor calculator is broken, but it does have a table of recommended resitors which I’ll post it here in case another saber neophite reads this thread.

From the Proffie v2 Manual, P14
Recommended resistors to use for accent LEDs
– 100 Ohm for Red
– 13 Ohm for Green
– 13 Ohm for Blue
– 100 Ohm for Yellow
– 20 Ohm for White

ProffieBoard_v2_User_Manual_1.pdf (electronics123.net)

2 Likes

I usually connect to the battery and use these:

  • 330 Ohm for Red and Amber
  • 220 Ohm for Green, Blue, and White

When connecting to 3.3V, also works for battery, I use these:

  • 150 Ohm for Red and Amber
  • 100 Ohm for Green, Blue, and White

Most of the time you don’t actually needed to drive switch or indicator LEDs at 20mA, since you will only see a small difference in the brightness when compared to a lower current. Also, with these values, mixing up the resistor does not damage the Red and Amber LEDs.

If you using the LEDs to light something than you probably want to drive them at 20mA, but for a switch or indicator 2 to 5 mA will work.

2 Likes