Two Channel PWM LED Driver - Page 1
Forum section: electronics / projects

author: Zinger
author_rank: Contributor
timestamp: July 25, 2017, 01:08:31 am
content: {Edited - Putting the LEDs closer to each other makes them easier to defuse}Can anyone suggest a simple circuit I could use to PWM two strings of LED? To stay within my batteries current limit, I need the circuit to alternate the two strings. They can't be on at the same time. Bonus points if the circuit is dimmable i.e. one pulses, both dark, second pulses, both dark for adjustable periods.I'm building a tapered, illuminated cylinder. I'm having trouble getting even brightness across the surface. The white LEDs I'm using show up as hot spots in the narrower sections. I don't have room for more diffusion material. Plus, I don't want to lose the light. Putting the LEDs closer makes diffusion easier. But I can't just jam in more LEDs due to my current limit. Hopefully, PWM on two strings will diffuse like one string.The circuit has to be small and low power. I know I could do this with a small foot print Arduino, but I'd prefer to avoid that much complexity and cost.Any other suggestions for solving this problem are welcome.

author: buck converter
author_rank: Regular Contributor
timestamp: July 25, 2017, 01:12:36 am
content: You could use a 555 astable. that has adjustable duty cycle. many scheatics online

author: Zinger
author_rank: Contributor
timestamp: July 25, 2017, 01:22:11 am
content: I've been looking at the 555. I can't figure out how to get it to alternate between the two strings. Is there something I could put between the 555 which would do that?

author: Zero999
author_rank: Super Contributor
timestamp: July 25, 2017, 08:26:32 am
content: Why not just reduce the current through the LEDs?You could use a single astable multi-vibrator and two mono-stables: one which is positive edge triggered, driving one strip of LEDs and another negative edge triggered, driving the other LEDs strip. The brightness of both strips can be controlled by adjusting the frequency and each individual strip can be adjusted by changing the delay on the mono-stable. The 74HC123 could be used as a mono-stable. It contains two and you have the option to choose between positive and negative edge triggering.

author: mikerj
author_rank: Super Contributor
timestamp: July 25, 2017, 10:10:58 am
content: Quote from: Zinger on July 25, 2017, 01:22:11 amNo way of doing this with just a 555. You could use a 555 to clock a flip flop, and then AND the Q and !Q outputs with the 555 output. The outputs of the flip flop would toggle on the falling edge, and the AND gates would apply the PWM to the active output.

author: ajb
author_rank: Super Contributor
timestamp: July 25, 2017, 11:40:16 am
content: You could do as Hero999 suggested, or use two astables: one switching between the two sets of LEDs and the other doing the PWM dimming.More realistically, given the option, I'd probably just use a 6- or 8-pin MCU. Two PWM channels on the same timer with one channel inverted would do the job nicely. This way when the timer starts from zero, channel A is on, then turns off sometime before the 50% mark, then some time after the 50% mark channel B turns on, then turns off when the timer hits its top value.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: July 25, 2017, 12:27:23 pm
content: Use a little PIC or similar - then you have full control. e.g. PIC12F1502 or 10F322For diffuser, it helps a lot to use a material that has translucency throughout, not just on the surface.

author: tooki
author_rank: Super Contributor
timestamp: July 25, 2017, 02:53:50 pm
content: Quote from: Zinger on July 25, 2017, 01:08:31 amThe complexity and cost of doing this via discrete components/ICs is far greater than the complexity and cost of doing it with a no-name arduino pro mini or nano.

author: Zinger
author_rank: Contributor
timestamp: July 25, 2017, 06:53:29 pm
content: Quote from: Hero999 on July 25, 2017, 08:26:32 amI'm pretty new to this stuff, but my understanding is that reducing current is not a reliable way to dim a string of LEDs. The string won't dim evenly across its length. Some LEDs will go dark while others shine brightly. That's why I was looking at PWM.Is this incorrect?

author: Zinger
author_rank: Contributor
timestamp: July 26, 2017, 12:03:55 am
content: Quote from: Hero999 on July 25, 2017, 08:26:32 amI'm pretty new to this, but my understanding is the reducing current isn't a reliable way to dim a string of LEDs. Some individual LEDs will go black while others still shine brightly, making my diffusion worse.Is that not correct?

author: Zero999
author_rank: Super Contributor
timestamp: July 26, 2017, 09:11:07 am
content: Quote from: Zinger on July 26, 2017, 12:03:55 amThat will only happen if the LEDs are not connected up properly. If they're in parallel without separate current limiting resistors, then it's possible that some will turn off before others as the current falls.If they're properly connected, the only issue with reducing the current, below the recommended operating value, is the colour changing slightly but this will only apply to LEDs with phosphor, such as white and some other unusual colours such as pink and purple. This will only happen if the current is much lower than the manufacturer's recommendation.PWM is normally done because it's the easiest way to control the brightness using a micro-controller. It does ensure the colour remains the same, at very low brightnesses but this normally isn't the main reason.

author: tooki
author_rank: Super Contributor
timestamp: July 26, 2017, 10:24:07 am
content: Quote from: Zinger on July 25, 2017, 06:53:29 pmIf you're talking about putting them in parallel, then it is correct. If they are in series, however, then they will dim in unison since the current through them is the same.

author: Zinger
author_rank: Contributor
timestamp: July 26, 2017, 01:18:28 pm
content: Quote from: tooki on July 26, 2017, 10:24:07 amI'm using a commercial LED strip with cuttable sections. Each section is 3 LEDs and a resistor in series. There are multiple sections then wired in parallel.

author: tooki
author_rank: Super Contributor
timestamp: July 26, 2017, 01:44:55 pm
content: Those will dim just fine by reducing voltage (which in turn reduces current). But PWM is definitely more efficient.Just be aware that regular 12V LED strips do waste a certain amount of energy as heat in the current limiting resistors. If battery life is a concern, constant-current LED strips (harder to find and more expensive) would be more efficient, or bare LEDs and a constant current driver.

author: Zinger
author_rank: Contributor
timestamp: July 26, 2017, 01:51:48 pm
content: Quote from: tooki on July 26, 2017, 01:44:55 pmThanks for this. I knew the resistors generated waste heat, but I wasn't up to wiring my own bare LEDs.I wasn't aware of constant current LED strips. I'll look into them.

author: mikerj
author_rank: Super Contributor
timestamp: July 26, 2017, 02:22:28 pm
content: Rather than having to alternate the PWM through two strips to average current demand, why not smooth out the current demand using an LC filter, i.e. make yourself a switching regulator? (or buy one ready made).

author: Zero999
author_rank: Super Contributor
timestamp: July 26, 2017, 10:17:58 pm
content: Quote from: tooki on July 26, 2017, 01:44:55 pmI think you're confusing PWMing the load with using an inductor and freewheeling diode i.e. a buck regulator.PWM is not more efficient, than just reducing the current, by upping the value of the series resistor. In fact it's slightly less efficient, as there will be higher I2R losses in the conductors.

author: tooki
author_rank: Super Contributor
timestamp: July 26, 2017, 11:26:24 pm
content: Huh? How is PWM less efficient than burning off the extra voltage in current-limiting resistors or voltage regulators?

author: Zinger
author_rank: Contributor
timestamp: July 27, 2017, 02:01:31 am
content: Quote from: Hero999 on July 26, 2017, 10:17:58 pmI'm pretty new to this kind of design. I don't know what a buck regulator is."Efficiency" is only meaningful when compared to the goals of the project.In this case, my goals are:Even illumination across the whole objectBattery lifeRecharge timeI'm building a prop for conventions. I need it to give me the aesthetics I want i.e. an even white surface whether it is illuminated or not. I'm working on the "is illuminated" part by experimenting with the resins I'm using.Here I'm really asking for help about evening out the LEDs when it is on.After that, I'd like it to last an entire day (e.g. 12 hours with a 10 minute on/ 50 minute off duty cycle) and if possible be rechargeable during downtime at the con. I'm not going to sit in a session for an hour with it burning. So how quickly could I recharge it during those times?I'm also very concerned about recharge safety. I don't want to be the guy that caused a hotel evacuation because his prop blew up.

author: Zero999
author_rank: Super Contributor
timestamp: July 27, 2017, 08:51:02 am
content: Quote from: tooki on July 26, 2017, 11:26:24 pmSuppose you have 1A and the resistance of the cables is 1 Ohm in total, thus dropping a total of 1W. If you reduce the current by half, by increasing the resistance of the circuit, you have1/2A and the power lost in the cables drops to1/4W. If you halve the power using PWM, you have 1A flowing through the cables, but for 50% of the time, so the loss in the cables is1/2W, double what you'd have by simply halving the current.Quote from: Zinger on July 27, 2017, 02:01:31 amThen you need to consider how much illumination you need. Can you use different LEDs? Perhaps you can get some ones which don't use as much power or output the same amount of light less power input. That will determine how much power you need and the battery capacity.

author: strawberry
author_rank: Super Contributor
timestamp: July 28, 2017, 07:18:34 am
content: How about this, its 555 have output to connect flip-flop.302375968418/ebay]

author: Zinger
author_rank: Contributor
timestamp: August 03, 2017, 03:22:53 pm
content: Quote from: tooki on July 25, 2017, 02:53:50 pmThanks, I looked into this more deeply. You're right a $4 Nano would be smaller, cheaper and easier.My LEDs are 12V. I control them with a MOSFET. How best would I connect a 5V output pin on the Nano to the gate on the MOSFET? Would a diode provide enough protection? Would I need an optocoupler?

author: Zero999
author_rank: Super Contributor
timestamp: August 03, 2017, 03:30:11 pm
content: Quote from: Zinger on August 03, 2017, 03:22:53 pmIf you have a logic level MOSFET and the frequency isn't too high, than directly.QuoteI'm not sure why you'd want to add a diode.An opto-coupler is only necessary if you want isolation and if you do, there are better solutions than opto-couplers nowadays.