Linear-ish simple low power LED dimmer ? - Page 1
Forum section: electronics / beginners

author: John_Edward
author_rank: Contributor
timestamp: September 02, 2013, 09:24:42 pm
content: TL;DR: Need a simple schematic for linear-ish, 0 to 100% 0.2W LED dimmer preferably using a 5k pot.____I'm looking for replacing the LEDs in mywith something I could properly dim, but can't really find anything suitable.I currently have eight 5mm white LEDs wired with a 5k pot (and a resistor to limit the max brightness), but this doesn't turn them off completely and the control is very non linear.I found a schematic thatseemed good, but I only got it to actually do anything with the pot between 60% and 80%, below the LEDs were off and over didn't make a visible change.The LM317 looks pretty promising as well, but all I found required very specific potentiometers (5ohm 2W hereand120ohm here.I would like something that would let me use the 5k pot (it's already mounted to the vivarium) to let me shut the LEDs off, and give me relatively linear brightness control, meaning 0 to 100 would actually do something, instead of 0 to 40% being really dim, 40 to 60% actually make a change, and 60-100% being just full brightness. I could always take an arduino pro mini and use that, but a microcontroller just seems overkill.Could this be done with a few transistors, should I use a variable constant current source, or is the only way to do it to use PWM ?

author: TerminalJack505
author_rank: Super Contributor
timestamp: September 02, 2013, 11:15:03 pm
content: You might trythiscircuit. Just replace the 50k pot with your 5k pot and change the left-most 100nF capacitor to 1uF so that the timing remains the same. (Although it may not matter. The frequency would just be 10x what it was designed to be, which shouldn't be an issue for LEDs.)You'd have to play with it to see how linear it is. It will probably be a bit non-linear just due to how LEDs behave. It also won't turn the LEDs off completely due to the fact that the minimum duty cycle is 5% to 10%.Another way to generate a PWM signal is to use comparators as shown in the attached circuit. This method will give you a true 0% to 100% duty cycle. You'd have to drive the LEDs with a BJT transistor in this case since comparators aren't made for driving high current, however.

author: TerminalJack505
author_rank: Super Contributor
timestamp: September 03, 2013, 12:35:14 am
content: If your LEDs are in series and you have a high enough voltage then you can use a variation of Dave's dummy load to do what you want. It's actually a pretty simple circuit and you can get all the parts you need at a Radio Shack (assuming you're in the US.)Are you going to re-use other components or just the pot? What kind of power supply do you have to work with? How are the LEDs wired-up? What is the maximum current the LEDs can handle?

author: TerminalJack505
author_rank: Super Contributor
timestamp: September 03, 2013, 03:08:58 am
content: Another way to do it.

author: TerminalJack505
author_rank: Super Contributor
timestamp: September 03, 2013, 05:55:52 am
content: And another way. Discrete components only!(I got bored.)

author: mrflibble
author_rank: Super Contributor
timestamp: September 03, 2013, 09:35:07 am
content: Should you like multiple channels, you could aTLC590x. Plus there's plenty of code for it floating out there.

author: TerminalJack505
author_rank: Super Contributor
timestamp: September 03, 2013, 06:32:20 pm
content: Here's a low-side version that can be driven from 5V. These are very common components. They should be in most hobbyists inventory. (You can get them all at Radio Shack.)The only thing that might need to be changed is that a compensation cap may need to be added to prevent oscillation.

author: TerminalJack505
author_rank: Super Contributor
timestamp: September 04, 2013, 09:08:18 am
content: I built the low-side, low voltage, constant current LED driver on the breadboard and it works extremely well. It had some oscillation that was taken care of by changing the size of the pull-up on the MOSFET's gate.I've attached the final schematic of that circuit for anyone that's interested. The circuit sinks from 0 to 60mA based on the pot's setting. It has a very linear output with regards to the pot setting.Edit: Added some notes to the schematic re:changing the maximum current and using different sized potentiometers.

author: John_Edward
author_rank: Contributor
timestamp: September 05, 2013, 09:43:37 am
content: Oo, these look pretty damn nice, thanks!Gotta go scavenge on my schools electronics lab today and see if I can build this tonight.How would the circuit scope with lower voltages and parallel LEDs ?The LEDs I have are rated at 2.9V and 20mA, if I put them in this in 2 parallel, 4 series, would it work ?And how would you get the 5V for Vcc with a diode ?

author: TerminalJack505
author_rank: Super Contributor
timestamp: September 05, 2013, 05:30:24 pm
content: Quote from: John_Edward on September 05, 2013, 09:43:37 amThe constant current schematics--as shown--wouldn't work with LEDs in parallel. They might if you take the time to carefully match the LEDs but you'd just be asking for trouble, really. The problem is that one of the strings of LEDs will draw more current than the other.You'd need some type of current mirror circuit to use the constant current method with parallel LEDs.If you have an old 24V transformer handy then you can generate the ~35V rail just with a bridge rectifier and a capacitor. You could power 10 of your 2.9V LEDs in series that way.If you can't generate a high enough voltage for the constant current method then PWM would probably be a simpler solution for running LEDs in parallel. Something like the comparator pwm schematic I posted would work. You'd have the output of the right-most comparator drive an NPN transistor and the transistor's collector would connect to the parallel strings of LEDs. You'd need a current limiting resistor in each of the strings.So far as generating the 5V Vcc rail with a resistor and a zener diode, see attached. The size on resistor R1 depends of the input voltage (Vled), the type of zener, and how much current the load draws.Another way to generate the 5V rail is to use a shunt regulator. These are easier to use then zeners since they're not as picky. Check outthe datasheetfor the TL431 for more information regarding them.

author: TerminalJack505
author_rank: Super Contributor
timestamp: September 06, 2013, 04:22:02 am
content: Here's something interesting that I've been playing around with in the simulator. It's a dimmable joule thief circuit. I haven't built it to see if it actually works but it works in the simulator so it might have half a chance.The joule thief circuit is a self-oscillating boost converter. The problem with it is you have to wind your own transformer. They're fun to play with, though.

author: Harvs
author_rank: Super Contributor
timestamp: September 06, 2013, 04:27:30 am
content: Quote from: TerminalJack505 on September 06, 2013, 04:22:02 amIf I'm not missing anything it's just a 1:1 ratio 500uH single primary and single secondary?Small transformers, or Coupled Inductors as they are often referred to, of that size are less than $1 on digikey.

author: TerminalJack505
author_rank: Super Contributor
timestamp: September 06, 2013, 04:32:07 am
content: Are they? I guess I never really looked. That's good to know. Winding your own is fun the first time or two. After that the novelty wears off pretty quick.

author: Harvs
author_rank: Super Contributor
timestamp: September 06, 2013, 06:22:04 am
content: Quote from: TerminalJack505 on September 06, 2013, 04:32:07 amYepOk I was thinking ~60c for 1k pricing, but still $1.60 isn't too bad for single quantity. Obviously the come in all shapes, sizes and ratings.http://www.digikey.com/product-detail/en/HM78D-755681MLFTR/987-1446-1-ND/2765862

author: mariush
author_rank: Super Contributor
timestamp: September 06, 2013, 07:01:20 am
content: Maybe it's time to just go with a led driver.. you can get one and the extra components needed for around 2$ :http://uk.farnell.com/diodes-inc/al8807mp-13/driver-led-buck-36v-1a-8msop/dp/2138313http://uk.farnell.com/taiwan-semiconductor/ts19371cx6-rf/led-driver-white-boost-6sot26/dp/1824780See the datasheets.

author: TerminalJack505
author_rank: Super Contributor
timestamp: September 07, 2013, 03:58:18 am
content: Here's another idea. Using the joule thief boost converter along with the constant current circuit.... And with that, I'll quit bugging you.

author: TerminalJack505
author_rank: Super Contributor
timestamp: September 10, 2013, 09:41:59 pm
content: I built the "LED Joule Booster with Adj CC" circuit and it works great. Using T5 like I am, I was expecting that the switching transistor (T6) would have pretty nasty switching losses but that's not the case. It ran nice and cool.The efficiency was only about 50% but I guess for a two transistor boost converter I can't complain. I replaced D2 with a Schottky diode and the values of R11 and R6 needed some tweaking but everything else is as shown in the schematic.The transformer's frequency varied from about 9.5kHz to 35kHz, depending on load. I'm not sure of the specs for my transformer since I wound it myself.I was able to run 9 white LEDs at 20mA without any problems. No start-up issues or cut-out issues. The simulator would cut-out unless there was a minimal load. R10 and R11 provide this minimum load--in addition to feedback.Edit: R9 (shown as 4k7 in the schematic) must be changed to 10k to avoid a start-up issue. I'll post an updated schematic with all the proper values later.Edit2: Added updated schematic.

author: Zero999
author_rank: Super Contributor
timestamp: September 11, 2013, 10:30:27 am
content: I've made a similar boost converter before and got better efficiency.In your case, the efficiency is poor because you have a linear regulator on the output.You could improve the efficiency by removing the linear regulator and adjusting the SMPs so the output is current regulated.

author: TerminalJack505
author_rank: Super Contributor
timestamp: September 11, 2013, 08:28:05 pm
content: Quote from: Hero999 on September 11, 2013, 10:30:27 amThat makes sense.I'd like to see a schematic of your circuit if you have it handy.

author: Zero999
author_rank: Super Contributor
timestamp: September 12, 2013, 05:18:47 pm
content: My original circuit was similar to your, except without the linear current regulator.The attached circuit will work, (I haven't built it, it's just a quick sketch) but the forward voltage of the LEDs must be higher than the supply voltage.