Author Topic: Two Channel PWM LED Driver  (Read 4675 times)

0 Members and 1 Guest are viewing this topic.

Offline ZingerTopic starter

  • Contributor
  • Posts: 28
  • Country: us
Two Channel PWM LED Driver
« on: July 25, 2017, 01:08:31 am »
{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.
« Last Edit: July 27, 2017, 02:16:54 am by Zinger »
"It's better to ask a stupid question than to make an expensive mistake."
 

Offline buck converter

  • Regular Contributor
  • *
  • Posts: 165
  • Country: us
Re: Two Channel PWM LED Driver
« Reply #1 on: July 25, 2017, 01:12:36 am »
You could use a 555 astable. that has adjustable duty cycle. many scheatics online
Just me and my scope.
 

Offline ZingerTopic starter

  • Contributor
  • Posts: 28
  • Country: us
Re: Two Channel PWM LED Driver
« Reply #2 on: July 25, 2017, 01:22:11 am »
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?
"It's better to ask a stupid question than to make an expensive mistake."
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19514
  • Country: gb
  • 0999
Re: Two Channel PWM LED Driver
« Reply #3 on: July 25, 2017, 08:26:32 am »
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.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3238
  • Country: gb
Re: Two Channel PWM LED Driver
« Reply #4 on: July 25, 2017, 10:10:58 am »
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?

No 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.
 

Online ajb

  • Super Contributor
  • ***
  • Posts: 2601
  • Country: us
Re: Two Channel PWM LED Driver
« Reply #5 on: July 25, 2017, 11:40:16 am »
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.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13745
  • Country: gb
    • Mike's Electric Stuff
Re: Two Channel PWM LED Driver
« Reply #6 on: July 25, 2017, 12:27:23 pm »
Use a little PIC or similar - then you have full control. e.g. PIC12F1502 or 10F322
For diffuser, it helps a lot to use a material that has translucency throughout, not just on the surface.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11500
  • Country: ch
Re: Two Channel PWM LED Driver
« Reply #7 on: July 25, 2017, 02:53:50 pm »
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.
The 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.
 

Offline ZingerTopic starter

  • Contributor
  • Posts: 28
  • Country: us
Re: Two Channel PWM LED Driver
« Reply #8 on: July 25, 2017, 06:53:29 pm »
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.

I'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?
"It's better to ask a stupid question than to make an expensive mistake."
 

Offline ZingerTopic starter

  • Contributor
  • Posts: 28
  • Country: us
Re: Two Channel PWM LED Driver
« Reply #9 on: July 26, 2017, 12:03:55 am »
Why not just reduce the current through the LEDs?

I'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?
"It's better to ask a stupid question than to make an expensive mistake."
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19514
  • Country: gb
  • 0999
Re: Two Channel PWM LED Driver
« Reply #10 on: July 26, 2017, 09:11:07 am »
Why not just reduce the current through the LEDs?

I'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?
That 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.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11500
  • Country: ch
Re: Two Channel PWM LED Driver
« Reply #11 on: July 26, 2017, 10:24:07 am »
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.

I'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?
If 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.
 

Offline ZingerTopic starter

  • Contributor
  • Posts: 28
  • Country: us
Re: Two Channel PWM LED Driver
« Reply #12 on: July 26, 2017, 01:18:28 pm »
If 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.

I'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.
"It's better to ask a stupid question than to make an expensive mistake."
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11500
  • Country: ch
Re: Two Channel PWM LED Driver
« Reply #13 on: July 26, 2017, 01:44:55 pm »
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.
 

Offline ZingerTopic starter

  • Contributor
  • Posts: 28
  • Country: us
Re: Two Channel PWM LED Driver
« Reply #14 on: July 26, 2017, 01:51:48 pm »
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.

Thanks 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.
"It's better to ask a stupid question than to make an expensive mistake."
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3238
  • Country: gb
Re: Two Channel PWM LED Driver
« Reply #15 on: July 26, 2017, 02:22:28 pm »
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).
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19514
  • Country: gb
  • 0999
Re: Two Channel PWM LED Driver
« Reply #16 on: July 26, 2017, 10:17:58 pm »
Those will dim just fine by reducing voltage (which in turn reduces current). But PWM is definitely more efficient.
I 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.

« Last Edit: July 26, 2017, 10:31:43 pm by Hero999 »
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11500
  • Country: ch
Re: Two Channel PWM LED Driver
« Reply #17 on: July 26, 2017, 11:26:24 pm »
Huh? How is PWM less efficient than burning off the extra voltage in current-limiting resistors or voltage regulators?
 

Offline ZingerTopic starter

  • Contributor
  • Posts: 28
  • Country: us
Re: Two Channel PWM LED Driver
« Reply #18 on: July 27, 2017, 02:01:31 am »
Those will dim just fine by reducing voltage (which in turn reduces current). But PWM is definitely more efficient.
I 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.

I'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 object
  • Battery life
  • Recharge time


I'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.
 
« Last Edit: July 27, 2017, 02:10:33 am by Zinger »
"It's better to ask a stupid question than to make an expensive mistake."
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19514
  • Country: gb
  • 0999
Re: Two Channel PWM LED Driver
« Reply #19 on: July 27, 2017, 08:51:02 am »
Huh? How is PWM less efficient than burning off the extra voltage in current-limiting resistors or voltage regulators?
Suppose 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 have 1/2A and the power lost in the cables drops to 1/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 is 1/2W, double what you'd have by simply halving the current.

Those will dim just fine by reducing voltage (which in turn reduces current). But PWM is definitely more efficient.
I 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.

I'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 object
  • Battery life
  • Recharge time


I'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.

Then 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.
 

Offline strawberry

  • Super Contributor
  • ***
  • Posts: 1161
  • Country: lv
Re: Two Channel PWM LED Driver
« Reply #20 on: July 28, 2017, 07:18:34 am »
How about this, its 555 have output to connect flip-flop.[ebay]302375968418/ebay]
 

Offline ZingerTopic starter

  • Contributor
  • Posts: 28
  • Country: us
Re: Two Channel PWM LED Driver
« Reply #21 on: August 03, 2017, 03:22:53 pm »
The 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.

Thanks, 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?
"It's better to ask a stupid question than to make an expensive mistake."
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19514
  • Country: gb
  • 0999
Re: Two Channel PWM LED Driver
« Reply #22 on: August 03, 2017, 03:30:11 pm »
The 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.

Thanks, 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? 
If you have a logic level MOSFET and the frequency isn't too high, than directly.

Quote
Would a diode provide enough protection?  Would I need an optocoupler?
I'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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf