I have an LED with a 3.3v supply and 3.2v forward voltage. The cathode is being grounded (very sparingly) by an STM32 which can sink up to 20 mA. Can I get away without a resistor?
-
3\$\begingroup\$ the LED does not 'have a forward voltage of 3.2 V'. It has a nominal forward voltage somewhere around that. Small changes in the difference between the drive and forward voltages, with LED temperature, batch, MCU supply voltage, will cause huge changes in current. \$\endgroup\$– Neil_UKCommented Jun 28 at 13:26
1 Answer
While it’s technically possible to connect the LED directly to the STM32 output pin without a current-limiting resistor, I recommend using a resistor for safety and reliability.
LEDs are current-driven devices. The STM32 can sink up to 20 mA, but the LED might not require exactly 20 mA. A small variation in LED forward voltage or STM32 output voltage could lead to excessive current, potentially damaging the LED or the STM32 GPIO.
Running an LED at its maximum current continuously can reduce its lifespan. A current-limiting resistor ensures a safe current level, extending the LED’s life.