I want to use this led with my teensy 4.0. The specs are Red: 2.1-2.5V Forward Voltage, at 20mA current, Green: 3.8-4.5V, Blue: 3.8-4.5V. I can supply either 3.3v or 5v. Since it's a common anode LED I have to connect the anode to power and the others to output pins. Setting a pin high would result in no light and low would connect to ground making light. Connecting the anode to 3.3v will not work since it has a lower voltage than the forward voltage of the green/blue led according to this post. 5v would be enough but since the teensy pins are not 5v tolerant only 3.3v. Would connecting the LED to 5v and then the green pin to a 25 ohm resistor then to a pin explode the teensy since on high the teensy only outputs 3.3v? I know I can use transistors but I really don't want to as they take up a lot of space.
1\$\begingroup\$ I don't know what current the I/O pins of teensy 4.0 can sink. You need to find that out. But I would NOT assume it can sink 20 mA X 3. So you probably will have to live with less than that. You should use 5 V as your common anode voltage as (1) you must for the blue LED anyway and (2) this gives you the most voltage headroom for each resistor which improves the current regulation. You will need three resistors, though. Chances are, putting out 3.3 V on the I/O pins won't light up the LEDs. My main concern there is the protection diode limitations in the absolute specs for your teensy 4.0. \$\endgroup\$– jonkFeb 25, 2021 at 21:38
1\$\begingroup\$ Okay. It seems as though the datasheet doesn't permit anything more than 600 mV above Vcc at the pin. "Overshoot and undershoot conditions (transitions above NVCC_XXXX and below GND) on switching pads must be held below 0.6 V, and the duration of the overshoot/undershoot must not exceed 10% of the system clock cycle." Figure 3 doesn't even show protection diodes. So you may need to add them. Also, it appears that 4 mA is the most an I/O pin can sink. So that's another possible issue. \$\endgroup\$– jonkFeb 25, 2021 at 21:51
\$\begingroup\$ If you want, you could also consider the OnSemi FAN5624. There is a 4-channel version there which is more than you need. It has all the necessary circuitry (and then some.) \$\endgroup\$– jonkFeb 25, 2021 at 22:16
The LED with the lowest Vf is the red one, at about 2.1V. 5V-2.1V is 2.9V, so in theory it should not be a problem for the driver, which has a Voh of 3.3V (the 3.3V rail) and therefore not forward bias the LED.
In practice, what happens is that the LED has enough sub-threshold leakage current that even this minuscule amount will cause it light dimly, sinking current into the I/O pin protection circuit. The current is small enough that it isn't really harmful to the driver, but leakage is leakage and you don't want that.
There's also robustness to power sequence to consider too: if your 3.3V supply is off and 5V is on, leakage current can get through the LEDs to the driver and phantom-power the 3.3V parts of the circuit. This is never a good thing and is to be avoided.
Instead, consider driving the LED using an open-drain buffer like an LVC07 or discrete FETs like 2N7001 or similar. Then there's no possibility of leakage or phantom-power and you'll have plenty of current to drive the LEDs as brightly as you want.