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.