Simple LED driver for 4 LEDs with AP3019A, does it work? - Page 1
Forum section: electronics / projects

author: alcs2000au
author_rank: Contributor
timestamp: June 13, 2023, 07:28:24 pm
content: Hi everyoneI would really appreciate a quick Feedback on the circuit below. The Idea is to drive these four LED's with an AP3019A and dimm it via the feedback resistor. Goal is about 10-125ma of current, changeable via the feedback resistor. Thanks!

author: langwadt
author_rank: Super Contributor
timestamp: June 13, 2023, 07:40:17 pm
content: bad idea to have the full current through the pot wiperthink it would better to connect the wiper to the FB pin, (with a fixed resistor in series with the pot to set max current)

author: alcs2000au
author_rank: Contributor
timestamp: June 13, 2023, 08:35:14 pm
content: Thanks! I assume like the schematic below? Does the rest of the circuit look fine?

author: mariush
author_rank: Super Contributor
timestamp: June 13, 2023, 09:03:53 pm
content: The schematic shows a 3 AAA battery compartment ... that will get you 3 x 1.1v - 3 x 1.35v for rechargeable batteries, or 3 x 1.2v ..1.5v for alkaline batteries.So 3.3v - 4v for rechargeable batteries, 3.6v-4.5v for alkaline.It's low enough that you could use a linear led driver with 4 or more channels and have each channel set at 100-150mA and be done with it.For example, try a CAT4104 with it :https://www.lcsc.com/product-detail/LED-Drivers_onsemi-CAT4104V-GT3_C236266.htmlThe chip supports PWM ... you could use that to dim the leds..

author: langwadt
author_rank: Super Contributor
timestamp: June 13, 2023, 09:28:41 pm
content: Quote from: alcs2000au on June 13, 2023, 08:35:14 pmadd something like 1K between pin 1 and pin 2 on the pot, that way if the wiper has a bad connection the current is still limited

author: tooki
author_rank: Super Contributor
timestamp: June 13, 2023, 11:24:56 pm
content: Look at the bottom of page 8 of the datasheet: while they unfortunately do not provide any formulas or real explanation, they show the schematic for how you can apply a DC voltage to control the dimming.

author: DavidAlfa
author_rank: Super Contributor
timestamp: June 14, 2023, 03:45:36 am
content: Still a bad idea to pass current through a pot...better to use a fixed resistor, then feed the FB with the pot dividing the drop.

author: tooki
author_rank: Super Contributor
timestamp: June 14, 2023, 04:16:21 am
content: Quote from: DavidAlfa on June 14, 2023, 03:45:36 amif you’re responding to me: you aren’t. You use a pot to generate a voltage to apply to the DC input on the schematic.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: June 14, 2023, 04:26:11 am
content: Quote from: DavidAlfa on June 14, 2023, 03:45:36 amNot only that, just try tobuya 20 ohm pot, as on the sch.

author: Kim Christensen
author_rank: Super Contributor
timestamp: June 14, 2023, 04:58:56 am
content: Quote from: tooki on June 13, 2023, 11:24:56 pmYes... The way the OP designed his 2nd circuit is a bit wasteful of power, because at max brightness, a total of 328mW (2.67V @ 123mA) will be dissipated by R2 & R3. It's simple though and maybe the OP doesn't mind a bit of power being wasted.

author: alcs2000au
author_rank: Contributor
timestamp: June 14, 2023, 08:02:35 pm
content: Thanks for all your inputs. Yep, I don't mind the bit of power being wasted, simplicity was important in this project.

author: Zero999
author_rank: Super Contributor
timestamp: June 15, 2023, 07:40:31 am
content: The original circuit will be fine. Yes, passing the current through the potentiometer is rather crude, but the IC used has no way to adjust the reference voltage and putting the potentiometer across the sense resistor results in a higher voltage drop and wastes power. The maximum current is 125mA, which will only be passed when the potentiometer is at the low resistance setting.

author: ArdWar
author_rank: Frequent Contributor
timestamp: June 15, 2023, 09:47:22 am
content: How stable your Vin is? Assuming it's much higher than 200mV you can inject current from it to the FB pin like the datasheet in pg 8, making the pin act as summing point

author: mariush
author_rank: Super Contributor
timestamp: June 15, 2023, 09:56:49 am
content: It's a bit worse...Let's say 3 AAA batteries , 3 x 1.2v = 3.6v (rechargeable) or 3 x 1.5v = 4.5v (alkaline)Datasheet says AL3019A is at best 84% efficient. Let's say you get 80% efficiency.4 leds, 3.2v average forward voltage, 150mA => 12.8v x 150mA = 1920mW ... assuming 80% efficiency, 1920mW is 80% , so 100% would be 2400 mW , so that means the regulator would pull 2400mW / 3.6v = 666mA of current from rechargeable batteries, or 2400mW / 4.5v = 533mALet's compare with a linear driver4 leds, each with its own linear driver or one driver with the 4 leds in parallel => total current = 4 x 150 = 600mAefficiency = 3.2v / 3.6v = 88.8% , or 3.2v / 4.5v = 71%If you use rechargeable batteries, you'll get higher efficiency and lower current - batteries will like lower current. With alkaline batteries, you'll get a bit less efficiency, but who cares.So you could just get a PAM2808 for example :https://www.digikey.com/en/products/detail/diodes-incorporated/PAM2808BLBR/4033259parallel all four leds, set the max current to 600mA , and then you could PWM on the enable pin to dim things. At 600mA, the dropout voltage will be under 150mV, so your leds will work down to 3.3-3.4v in total, no problems with 3 rechargeable batteries.A small arduino or a pic10/pic12/pic16 or some padauk 15 cents microcontroller could do the pwm job (ex have 2 buttons for up and down, and based on what's pressed, change the pwm in 5-10% steps or as fine as you want)Or use a 555 chip if you can get one to work at 3-4.5v (or use a cheap voltage doubler IC to have 5-6v for the 555 chip)Seehttps://www.instructables.com/555-Timer-Universal-PWM-Controller/- for PAM2808 above you'd want the frequency relatively low, at 200 Hz

author: ArdWar
author_rank: Frequent Contributor
timestamp: June 15, 2023, 10:49:09 am
content: Dude, how do you even get from 1 chip 3 passives "simplicity is important to this project" to 4 chips 8 passives 1 microcontroller and a programming project?Maybe try circuit below. R1 is sensitive to LED Vf. Adjust it up if you have too much dead band in your potentio, adjust down if you get too much brightness at minimum setting. The key to the project here is how you inject current to FB node so it can go higher than the Vdrop alone provide.Theoretically R1 should be sized just enough to turn the circuit into constant voltage regulator at lowest potentiometer setting with Vout = Vf(total).Assuming Rpot>>Rsense and Vref = 0.2V:R1 = (Vout-0.2)Rpot/0.2

author: mariush
author_rank: Super Contributor
timestamp: June 15, 2023, 11:55:12 am
content: Quote from: ArdWar on June 15, 2023, 10:49:09 amYou have a problem reading what I write. It's solution X OR solution Y.* use a linear driver PAM2808 with a resistor to set the maximum current* OPTIONALLY use a PWM signal to adjust current.You can do PWM either using a basic microcontroller OR a 555 or some other method of generating a PWM signal.As the 555 needs a higher voltage to work, you can use a super basic voltage doubler to produce 5v-ish out of 3v...5v input.PAM2808 is 40 cents :https://www.lcsc.com/product-detail/LED-Drivers_Diodes-Incorporated-PAM2808BLBR_C780872.htmlA 555 is 5 cents :https://www.lcsc.com/products/Timers-Clock-Oscillators_11325.htmlA charge pump regulator is 10 cents :https://www.lcsc.com/product-detail/DC-DC-Converters_XDS-TX4314_C329270.htmlSo just 3 parts and some passives (ceramic capacitors, resistors) and a potentiometer to adjust the pwm signal from 10 to 100%, maybe 1$ in total when you add the potentiometer to the list.Microcontroller is alternative to 555, but this would be an excellent project to practice programming on a microcontroller... ex a cheap 6-8 pin IC, with internal oscillator, a pin for pwm out, one or two buttons (ex one button - tap button to switch between off - 20% - 50% - 75% - 100%), job done.IMHO I'd rather have this, instead of risking burning the potentiometer by passing current through the wiper, or resorting to boost regulators that could have current bursts and discharge batteries much faster.I'd also rather use 2 batteries and a step-up/boost regulator to boost to around 3.3v - 3.5v - rechargeable batteries typically charge in pairs, so it would be user friendly to use either 2 AA batteries or 4 batteries... when discharged, just replace the set.AA batteries also hold more charge - you're looking at 2500mAh for AA batteries while AAA batteries are somewhere around 1200-1500mAh.With 3 batteries it's more annoying. A microcontroller could pwm the leds by turning mosfets or transistors on and off and you could pwm the 4 leds in such a way as to have one led off while the other 3 are on, and loop through the leds, and so overall your current would be lower, which would give batteries longer life etc etc...

author: ArdWar
author_rank: Frequent Contributor
timestamp: June 15, 2023, 01:43:14 pm
content: You do not need to pass full current through potentiometer. You only need to inject a proportional (very) small current to FB node to bring it up. Using my circuit above the worst case scenario for potentio current should be only about 300uA unless you're using super high Vf led.I do agree with you regarding input current however. Alkaline batteries hate continuous high current draw. Zn cell hate it even more. Lithium cell may work better, but you'll have other much bigger thing to worry about here. And for that matter, I don't think AP3019 is even able to drive such load in the first place. Maximum switch current is only 500mA, which limit total Vf to ~3x Vbat for 125mA design current (depends on the amount of current ripple in inductor). In practice you probably want to derate even further.