Electronic – arduino – How to drive 700mA LED cheaply

arduinoesp8266ledled-driverpower supply

I'm new to electronics and am trying to make a night vision circuit. A similar question has been asked before, but with priority on efficiency. I want to control a 700mA-1000mA IR LED using a 5v input and an ESP8266 microcontroller as part of a night camera project. The LED should be able to be switched on/off from the MCU and will be off most of the time.

One solution is to use a dedicated LED driver / constant-current power supply, which is expensive (e.g. this LED driver for $7+shipping). Another solution is to use a single high wattage resistor, which is very inefficient. See:
How to drive high powered LEDs as efficiently as possible
How to drive high power LED and Arduino by the same power source?

I'm looking for a method of driving the LED using components that I can get cheaply (typical Arduino hobbyist components – a quarter watt resistor multipack, a transistor multipack (e.g. with BC337 and 2N2222 NPN transistors), buck/boost converters, the microcontroller itself).

LED specifications
These LEDs: https://www.aliexpress.com/item/32810764742.html
Forward Voltage: DC1.4-1.6V
Forward Current: 700-1000mA

Simple resistor method
My first thought is to use a current-limiting resistor. Then, from R=V/I we get R=5/0.7=7 ohms. From P=IV we get P=0.7*5=3.5 watts. I only have quarter watt resistors (and 3.5 watts sounds like a lot of power to dissipate), so this solution is not desired.

2-transistor method
I read about a method of limiting current using 2 transistors (schematic attached below).
Source 1 http://www.physics.unlv.edu/~bill/PHYS483/current_lim.pdf
Source 2 https://www.homemade-circuits.com/universal-high-watt-led-current-limiter/

This would satisfy my requirements of being a cheap solution and using simple components. I have BC337 and 2N2222 transistors. I think the BC337 can handle 800mA, with hFE being 100-630 (info for BC337 here). In the sources, they use an hFE value of 30. How do I know what value to use?


  • How to choose hfe?
  • What values should be used for R1 and R2?
  • How much power will the BC337 transistor need to dissipate?
  • Is the sensitivity to temperature tolerable? (e.g. 0-30 celsius)
  • The ESP8266 can output a PWM signal. Would this be useful for the circuit?

Here is my attempt at a schematic. This doesn't yet incorporate switching using 3.3v logic from the ESP8266.

2 Transistor current-limiter

Best Answer

XY problem.

Your best efficiency solution from a power and cost point of view to drive a 1A LED load is to use a LED driver IC. There are many to choose from; the Diodes Inc PAM2804 seems likely to meet your needs. It supports PWM dimming. These chips are very inexpensive (about 15 cents Digi-Key price, half that in volume.) You could drive up to 3 of your IR LEDs in series with this chip since its sensing overhead is only 100 mV.

And if you think 15 cents is 'expensive', consider the thermal and efficiency issues you won't have to solve by using this IC, and their cost if you didn't use it and went linear. Way more than than 15 cents.

Regardless of the drive method you choose, there's an issue with using PWM chop to control dimming: this can interact with your frame capture, causing strobing. You will not be happy with the result if you use straight PWM: your image will have horizontal bars in it due to the interaction of sensor's rolling-shutter and the LED's pulsing light. This effect is the bane of videographers everywhere, and I'm sure you don't want that in your night-vision camera.

Instead, consider using a DC control method to modify the LED current. How to do that? The easy way is to use a current DAC like the Maxim DS4432. This device is I2C controlled, and can source or sink current to any node. It's kind of like a digital pot (another method to consider), but uses current, making it way more flexible. It's tiny. At about $1 Digi-Key, it might be a bit spendy. Microchip makes I2C digital pots that are about 50 cents Digi-Key.

A more involved, but cheaper way is to use the ESP8266 PWM output, and filter that to make a PWM-controlled current source to tweak the drive. This would mean an op-amp and a transistor and some passives. You might even be able to do it with just transistors, as a modification of your current source you're proposing.

Still another way is to choose an LED driver that accepts voltage dim control, like the MPS MP2410A. Then take the PWM and use a passive low-pass to create a dimming signal. Use a high-frequency PWM to minimize ripple and component size. The MPS part is definitely more expensive than the PAM2804 however.

Related Topic