Author Topic: EEVblog #392 – 555 LED PWM Hack  (Read 39802 times)

0 Members and 1 Guest are viewing this topic.

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37730
  • Country: au
    • EEVblog
EEVblog #392 – 555 LED PWM Hack
« on: November 28, 2012, 11:50:56 pm »


Dave.
 
The following users thanked this post: AlienRelics

Offline Mr Smiley

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: gb
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #1 on: November 29, 2012, 12:24:02 am »
Hi,

The advantage of the single pnp output transistor that Dave chose is that it's base resistor is simply grounded by the open collector output of pin 7. All you really have to be aware of with pin 7 is Ic max and Vce Max. Couldn’t be any simpler.  :-DD

(maybe a pull up resistor for the base of the pnp, but it seems not to need it )

Mr Smiley  :)
There is enough on this planet to sustain mans needs. There will never be enough on this planet to sustain mans greed.
 
The following users thanked this post: AlienRelics

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11859
  • Country: us
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #2 on: November 29, 2012, 03:09:41 am »
"There's nothing wrong with a bit of heat shrink"

Well maybe, but I'm not so sure. I believe a few of us would have a desire for a mounting arrangement with a little more polish. It's a fancy expensive instrument, it surely wouldn't hurt to have a nice looking box with a knob for the dimming control?
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37730
  • Country: au
    • EEVblog
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #3 on: November 29, 2012, 03:32:29 am »
"There's nothing wrong with a bit of heat shrink"
Well maybe, but I'm not so sure. I believe a few of us would have a desire for a mounting arrangement with a little more polish. It's a fancy expensive instrument, it surely wouldn't hurt to have a nice looking box with a knob for the dimming control?

Of course not, you can do whatever you want, and I support you. I'm happy with heatshrink  :-+

Dave.
 

Offline John Wilson

  • Newbie
  • Posts: 8
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #4 on: November 29, 2012, 03:39:04 am »
Hi,

The advantage of the single pnp output transistor that Dave chose is that it's base resistor is simply grounded by the open collector output of pin 7. All you really have to be aware of with pin 7 is Ic max and Vce Max. Couldn’t be any simpler.  :-DD

(maybe a pull up resistor for the base of the pnp, but it seems not to need it )

Mr Smiley  :)

Ok, here's a perhaps stupid question for you. What would be required to use an NPN transistor?
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16276
  • Country: za
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #5 on: November 29, 2012, 04:32:07 am »
Use it in place of the PNP, and heatsink it, as it will then have about 5V drop across it due to the output stage drop of the 555 and the base current limiting resistor. The PNP is used because you can have the load connected to the ground and control the positive supply, with the transistor used as a saturated switch with low voltage drop.
 
The following users thanked this post: AlienRelics

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11859
  • Country: us
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #6 on: November 29, 2012, 05:36:51 am »
So for my own edification, why wouldn't this work:



Just curious about why a PNP does better than an NPN in this application?
« Last Edit: November 29, 2012, 05:38:22 am by IanB »
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #7 on: November 29, 2012, 06:56:44 am »
Putting that circuit in series with the constant current source constantly wacks the LM317 out of regulation. Every time the transistor turns off the LM317 will try to drive its output to the maximum voltage (to keep up the current) thereby losing regulation. When the transistor turns on again it takes the LM317 a little bit of time to regulate again, i.e. drive its output voltage down so the constant current is maintained.

The result should be that you have current spikes going into the LEDs.

Now, LEDs are typically specified to deal with certain current spikes, but still it doesn't increase the lifetime of the LEDs. I would assume that LED assembly is rather expensive, so having to replace it early will cost a bit of money.

I would look for the current spikes and if they are significant either use a parallel PWM (stealing current from the LEDs by switching between on and shorting to ground), or adding a bit of inductance to limit the spikes.
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline LarsT

  • Contributor
  • Posts: 40
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #8 on: November 29, 2012, 10:21:04 am »
Perhaps a stupid question, but is there a reason a transistor was chosen instead of a mosfet in this project?
 

Offline dr_p

  • Frequent Contributor
  • **
  • Posts: 309
  • Country: ro
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #9 on: November 29, 2012, 11:43:22 am »
Perhaps a stupid question, but is there a reason a transistor was chosen instead of a mosfet in this project?

Since someone had no signal diodes and resorted to using LEDs, maybe the FET basket was misplaced as well. :))

He measured 1.7V drop on the resistors so a total of 5.5-6V from the LM317. Drop some on 555 and there's enough voltage to drive a logic N-FET. But you'd have to use a pull down resistor I think.

But what I don't get is why he didn't put this adaptation before the LM317, on the input. You would have PWM and then CC and I think it solves some possible problems. Looks maybe? (heatshrink would be visible on the bench)
 

Offline LarsT

  • Contributor
  • Posts: 40
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #10 on: November 29, 2012, 12:52:49 pm »
Perhaps a stupid question, but is there a reason a transistor was chosen instead of a mosfet in this project?

Since someone had no signal diodes and resorted to using LEDs, maybe the FET basket was misplaced as well. :))

He measured 1.7V drop on the resistors so a total of 5.5-6V from the LM317. Drop some on 555 and there's enough voltage to drive a logic N-FET. But you'd have to use a pull down resistor I think.

But what I don't get is why he didn't put this adaptation before the LM317, on the input. You would have PWM and then CC and I think it solves some possible problems. Looks maybe? (heatshrink would be visible on the bench)

That's plausible.

Would it be possible to use 1N4001 diodes in this circuit instead of leds?
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11859
  • Country: us
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #11 on: November 29, 2012, 03:16:22 pm »
But what I don't get is why he didn't put this adaptation before the LM317, on the input.

I wondered the same thing. But I think the answer is to have the brightness control within easy reach while looking through the scope. For that you need the control pot to be positioned close to the microscope head and not far away on the bench.
 

Offline sniti

  • Newbie
  • Posts: 1
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #12 on: November 29, 2012, 03:34:41 pm »
Putting that circuit in series with the constant current source constantly wacks the LM317 out of regulation. Every time the transistor turns off the LM317 will try to drive its output to the maximum voltage (to keep up the current) thereby losing regulation. When the transistor turns on again it takes the LM317 a little bit of time to regulate again, i.e. drive its output voltage down so the constant current is maintained.

The result should be that you have current spikes going into the LEDs.

Wondered about the same thing. Another idea for the hack would be a currentregulator before the microscope (and the internal regulator). The internal LM317 would then work in current mode only when on maximum light setting, when using the regulator on the outside it would only drop the minimum voltage.

But the LEDs seem to be easily replaceable,  so it shouldn't be that big problem, if their lifespan is decreased a little (would be still better than on cheap LEDs).  And a design without to much parts or a big heatsink has its benefits.. I'd only put in a second transistor to get 10 to 100 percent brightness.
 

Offline AlphZeta

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
    • Kerry D. Wong
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #13 on: November 29, 2012, 03:37:18 pm »
Not exactly the point of this hack. But wouldn't it be easier to just replace one of the current setting resistors with a pot in the LM317 CC circuit to achieve the CC adjustment (although I suspect that low value pot is hard to come by)?

Of course, the mod wouldn't be as exciting then  :P
« Last Edit: November 29, 2012, 03:40:59 pm by AlphZeta »
 

Offline somlioy

  • Regular Contributor
  • *
  • Posts: 128
  • Country: no
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #14 on: November 29, 2012, 04:08:58 pm »
The circuit looks very similar to one I did earlier, except that I didnt have that cap on pin 5 and I hooked the base of the transistor to pin 3 together with the diodes. Is there any advantages doing it like you over my setup?
« Last Edit: November 29, 2012, 05:03:53 pm by somlioy »
 

Offline eV1Te

  • Regular Contributor
  • *
  • Posts: 186
  • Country: se
  • Your trusted friend in science!
    • richardandersson.net
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #15 on: November 29, 2012, 04:21:20 pm »
Putting that circuit in series with the constant current source constantly wacks the LM317 out of regulation. Every time the transistor turns off the LM317 will try to drive its output to the maximum voltage (to keep up the current) thereby losing regulation. When the transistor turns on again it takes the LM317 a little bit of time to regulate again, i.e. drive its output voltage down so the constant current is maintained.

The result should be that you have current spikes going into the LEDs.

Now, LEDs are typically specified to deal with certain current spikes, but still it doesn't increase the lifetime of the LEDs. I would assume that LED assembly is rather expensive, so having to replace it early will cost a bit of money.

I would look for the current spikes and if they are significant either use a parallel PWM (stealing current from the LEDs by switching between on and shorting to ground), or adding a bit of inductance to limit the spikes.

Did I miss something, I thought that was exactly what Daves circuit was doing? Breaking the CC output with an PNP or NPN before or after the LEDs shouldn't make a difference?
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7754
  • Country: de
  • A qualified hobbyist ;)
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #16 on: November 29, 2012, 05:26:23 pm »
Putting that circuit in series with the constant current source constantly wacks the LM317 out of regulation. Every time the transistor turns off the LM317 will try to drive its output to the maximum voltage (to keep up the current) thereby losing regulation. When the transistor turns on again it takes the LM317 a little bit of time to regulate again, i.e. drive its output voltage down so the constant current is maintained.

IMHO that LM317 constant current source is a bad design anyway. A constant voltage would be better suited since each LED has got a current limiting resistor. If LEDs fail the CC would increase the voltage (up to what the power brick delivers minus the voltage drop of the LM317) to drive the CC. But that higher voltage causes more current for the remaining LEDs.

Quote
I would look for the current spikes and if they are significant either use a parallel PWM (stealing current from the LEDs by switching between on and shorting to ground), or adding a bit of inductance to limit the spikes.

Just replace the CC with a CV :-)
 

Offline Mr Smiley

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: gb
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #17 on: November 29, 2012, 07:39:17 pm »
Hi,

The advantage of the single pnp output transistor that Dave chose is that it's base resistor is simply grounded by the open collector output of pin 7. All you really have to be aware of with pin 7 is Ic max and Vce Max. Couldn’t be any simpler.  :-DD

(maybe a pull up resistor for the base of the pnp, but it seems not to need it )

Mr Smiley  :)

Ok, here's a perhaps stupid question for you. What would be required to use an NPN transistor?

You have three options if you want to use a npn transistor,

1/ Calculate the required base resistor and drive it from the original  Dave Cad drawing from pin 3 which if i remember correctly is a totem pole output.
2/ Calculate the required base resistor for the npn power transistor, connect that between pin 7 and Vcc, then connect the power transistor base to pin 7, problem with that is that when the power transistor is on; when pin 7 is open you draw Ib through the power transistor. And when pin 7 is on, pulled low, you still draw Ib, but this time it's just dumped to ground and wasted.
3/ A pnp driving a npn using pin 7. A pull up resistor from pin 7 to Vcc ( say 10K) a calculated base resistor from pin 7 to the base of a pnp transistor, the collector of the pnp connected to the base of the npn power transistor through a calculated base resistor for the power transistor and possibly a pull down resistor from the base of the power transistor to ground.  ::)

 :)
There is enough on this planet to sustain mans needs. There will never be enough on this planet to sustain mans greed.
 

Offline ivan747

  • Super Contributor
  • ***
  • Posts: 2045
  • Country: us
EEVblog #392 – 555 LED PWM Hack
« Reply #18 on: November 29, 2012, 09:18:02 pm »

I would look for the current spikes and if they are significant either use a parallel PWM (stealing current from the LEDs by switching between on and shorting to ground), or adding a bit of inductance to limit the spikes.

I would use the parallel PWM method. It also keeps the frequency the same. I don't like the idea of having a 555 connected to what is basically an AC source with a DC offset. It must be an EMI madness. Parallel PWM should reduce EMI because the current that goes trough the long wires is more or less constant.

I will try some variations of this circuit during the weekend. :)

Anyway, the circuit is very clever, thanks for the video, Dave.
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37730
  • Country: au
    • EEVblog
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #19 on: November 29, 2012, 10:14:51 pm »
Putting that circuit in series with the constant current source constantly wacks the LM317 out of regulation. Every time the transistor turns off the LM317 will try to drive its output to the maximum voltage (to keep up the current) thereby losing regulation. When the transistor turns on again it takes the LM317 a little bit of time to regulate again, i.e. drive its output voltage down so the constant current is maintained.

The result should be that you have current spikes going into the LEDs.

Yes it does, but it's small.
Remember the LED's all have 82ohm protection resistors, so absolute worst case with the regulated 9V DC plugpack is:
(9V - LM317drop(say2V) - 3V) / 82ohm = 48mA
(ignoring the transistor drop)
In practice the actual voltage to the LEDs peaks at around 5.5V before it starts to recover to 4.5V, see attached.
So peak current would be just over 30mA

Dave.
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37730
  • Country: au
    • EEVblog
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #20 on: November 29, 2012, 10:22:33 pm »
But what I don't get is why he didn't put this adaptation before the LM317, on the input.

I wondered the same thing. But I think the answer is to have the brightness control within easy reach while looking through the scope. For that you need the control pot to be positioned close to the microscope head and not far away on the bench.

Correct. Convenient location.
At the base, or before would suck.

Dave.
 

Offline Ajmal182

  • Newbie
  • Posts: 1
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #21 on: November 30, 2012, 07:48:34 pm »
Hi Dave, Im actually trying to build a water level sensor circuit during my semester holidays using the sensor(190 Ohms) and an 1.91Kohm resistor in a voltage divider configuration and feed the voltage across the sensor to an opamp (gain =11). Im thinking of using the 555 timer to give a pwm output to the circuit, as in yours. I was wondering if I could feed the opamp output to pin 5 of the 555 to generate the pulse width at the output, using it with the transistor. Is there anything I need to change with the circuit? Im actually a first year electrical & electronic engineering student, so its a bit new to me  ^-^
 

Offline xDR1TeK

  • Contributor
  • Posts: 47
  • Country: lb
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #22 on: December 01, 2012, 03:59:40 am »
For the PWM, how a about using a charge-discharge relaxation oscillator? Can it be done with a single supply opamp?
« Last Edit: December 01, 2012, 04:01:16 am by xDR1TeK »
 

Offline ftransform

  • Frequent Contributor
  • **
  • Posts: 728
  • Country: 00
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #23 on: December 01, 2012, 06:41:15 am »
At first I did not like a hanging thing but I realized its probably for the best. That way you can adjust it and make absolutely certain you do not nudge the optics at all. Similar to how the adjustment knobs on a telescope are attached by a "limp noodle" which dampens the mechanical vibrations.

I don't know how useful it is at 10x but it might be a useful consideration for optics which are not tightened into place or on a tripod with shoddy foundation.
 

Offline r90s

  • Regular Contributor
  • *
  • Posts: 66
  • Country: us
Re: EEVblog #392 – 555 LED PWM Hack
« Reply #24 on: December 01, 2012, 03:14:51 pm »
I really like this site, yes really.  It's provides you with education, drama, international intrigue, and never ending amusement in various topics.

  Dave cad......that's great!         Thanks Dave :-+
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf