I have to switch on for a short time a series of 6 or 7 LEDs with 24 VDV.
Some details:

  • Power supply: 24 VDC
  • LED: 1W CREE XRE Q5 link
    • Power: 1 W
    • Voltage: 3-3.7 V
    • Current: 300-500 mA
  • This small circuit with an IRF520 MOSFET

enter image description here

  • Camera GPIO configured as output as follows. I'd like to use this output to drive the MOSFET.

enter image description here

enter image description here

Is the IRF520 suitable in this case?

How do I connect the camera output to the MOSFET?

Do I have to put a resistor in series with the LED, and if yes, what value and power?

estimate the resistor


2 Answers 2


I've to switch on for a short time a series of 6 or 7 leds

Camera GPIO configured as output

If this is a photo flash application, where the LEDs will only be switched on for a very short time like a couple tens of milliseconds, then you can be quite reckless, even at 2x rated current/power it should be fine. Also you can use a smaller and lighter heat sink.

However if you use a resistor to limit current, then the current (and light output) will depend quite a lot on LED forward voltage, and therefore on LED temperature. So if you take several pictures in quick succession, light output and color temperature may vary between pictures, which can be a problem if you need repeatability, like in a photo studio setting.

So you might want to use an opamp-based current source like this one. Just google "opamp current sink". This circuit has a very low voltage drop which should be useful in your case. Simply drive the input of the opamp to turn the LEDs ON, or drive it to 0V to turn them off. If the flash duration is above a couple milliseconds, then you really don't need speed, any standard opamp like LM358 will be plenty fast enough to do the job.


In general, high power leds can't be "driven" with a constant voltage and series resistor like one would do with signal leds, because the power dissipation in the resistor will be rather high. Consider 500mA through 50 Ohm will result in 25W being dissipated.

Driving an led usually refers to providing the led with a constant current, which typically requires some kind of closed-loop regulation.

In your case (assuming 6 leds @3.7V,500mA) you would need 3.6 Ohms as series resistance (voltage overhead is 24V-6×3.7V=1.8V, R=1.8V/0.5A=3.6Ohm). The power dissipation would be 1.8W, which is still pretty much.

  • \$\begingroup\$ Thank you Sim, this could be a good starting point? instructables.com/id/Circuits-for-using-High-Power-LED-s \$\endgroup\$
    – addebito
    May 30, 2020 at 19:50
  • \$\begingroup\$ @addebito sounds good, there seems to be some useful info on that page. I don't see how all the provided options differ from each other, though. In the end it boils down to either waste unneeded power or go the more elegant way of using some kind of regulator (preferably a current regulator/constant current source). \$\endgroup\$
    – Sim Son
    May 30, 2020 at 20:24
  • \$\begingroup\$ Consider .5 A through 50 Ω will result in 25 W I consider that off by a factor of 2. But if the 6 LEDs had a \$V_f\$ of 3 V, the current with a 3.6 Ω resistor would be 1.7 A - a tad much. The question to ask is which part of the voltage to burn when the variance in \$V_f\$ is 1/6th? 6 LEDs just is too many for a conservative design limiting current with just a resistor even before figuring in supply voltage tolerance. 5 LEDs, 3.3 V, 400 mA is about 18 Ω - and 5 W. \$\endgroup\$
    – greybeard
    Jan 23, 2023 at 10:37
  • \$\begingroup\$ (@addebito: That instructable looks quite useful.) \$\endgroup\$
    – greybeard
    Jan 23, 2023 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.