555 timer PWM generator with a difference

Thread Starter

aquadog90

Joined Jun 28, 2015
4
Hi All

I am currently trying to implement a day time running light (led strips) for my car. At the moment I have built a PWM generator using a 555 timer that switches on a MOSFET. Using a potentiometer I can vary PWM and vary the intensity of the light, that bit works fine.

My next requirement is to modify the circuit so that with an input it will ramp up the duty cycle automatically and slowly increase the brightness of the lights. I have been thinking are trying different bits for 2 weeks now with no luck.

I know that a micro controller would do the job but I want to stay away from them when it comes to a car.. prefer CMOS and etc solutions.

A diagram has been uploaded and I am happy to modify the circuit or add extra components


555 pwm.gif
 

ScottWang

Joined Aug 23, 2012
7,501
Take R2 away, and disconnect pin 7 of 555, and in series with a 100K pot between pin 6 of 555 and Vg of mosfet, also in parallel a 22uf ~47uf capacitor with Vgs.

If you want the voltage going up slowly then the C1 should be increasing to 1uf or some more, it depends on how slow you want.

If this way still can't match what you want then there is other way to do that is from pin 3 of 555 and Vg of mosfet.
 

Alec_t

Joined Sep 17, 2013
15,117
I don't see how ScottWang's mod will affect the PWM duty cycle :confused:.
Do you also want the brightness to ramp down?
 

ScottWang

Joined Aug 23, 2012
7,501
I don't see how ScottWang's mod will affect the PWM duty cycle :confused:.
Do you also want the brightness to ramp down?
The TS want the fade in function, but he didn't say that he want the fade out, if he want to two functions as pwm and fade in then it should be have two pots to do the adjust.
 

ian field

Joined Oct 27, 2012
6,536
Take R2 away, and disconnect pin 7 of 555, and in series with a 100K pot between pin 6 of 555 and Vg of mosfet, also in parallel a 22uf ~47uf capacitor with Vgs.

If you want the voltage going up slowly then the C1 should be increasing to 1uf or some more, it depends on how slow you want.

If this way still can't match what you want then there is other way to do that is from pin 3 of 555 and Vg of mosfet.
There is nothing actually wrong with interchanging pin 3 & 7 in that application.

Using pin 3 to drive the C/R network is common practice for a design intending accurate 50:50 mark space ratio, and it saves the current limiting resistor that would protect the discharge transistor on pin7.

Since Vcc is stated to be 3 - 18V, there may in some situations not be enough voltage for the MOSFET gate - the open collector at pin 7 makes it possible to provide a pull up for adequate gate voltage (ie Vdd) regardless of how low Vcc is.
 

ScottWang

Joined Aug 23, 2012
7,501
You may change the C1 and C3 to suit what you want, two circuits will be as fade in and fade out, and some people will say that is a breathing light.
The pin 6 output only V6=Vcc*(2/3)
555pwm_aquadog90-01_ScottWang.gif

You may change the C1 and C3 to suit what you want.
V3=Vcc-1.4V
555pwm_aquadog90-02_ScottWang.gif
 

ian field

Joined Oct 27, 2012
6,536
The TS want the fade in function, but he didn't say that he want the fade out, if he want to two functions as pwm and fade in then it should be have two pots to do the adjust.
You don't need two pots - just buffer the capacitor voltage, but since its driving a MOSFET gate that probably isn't necessary.

I think some source degeneration (an un-bypassed resistor) might be needed to get anything resembling a ramp at the drain.

The window comparator in a 555 switches the following bistable at 1/3 & 2/3 of Vcc, so you only have the 1/3 in between for the ramp voltage range.
 

ScottWang

Joined Aug 23, 2012
7,501
There is nothing actually wrong with interchanging pin 3 & 7 in that application.

Using pin 3 to drive the C/R network is common practice for a design intending accurate 50:50 mark space ratio, and it saves the current limiting resistor that would protect the discharge transistor on pin7.

Since Vcc is stated to be 3 - 18V, there may in some situations not be enough voltage for the MOSFET gate - the open collector at pin 7 makes it possible to provide a pull up for adequate gate voltage (ie Vdd) regardless of how low Vcc is.
The TS want a fade in function, so it have to make the square wave to a triangle wave or sawtooth wave.
 

ScottWang

Joined Aug 23, 2012
7,501
You don't need two pots - just buffer the capacitor voltage, but since its driving a MOSFET gate that probably isn't necessary.

I think some source degeneration (an un-bypassed resistor) might be needed to get anything resembling a ramp at the drain.

The window comparator in a 555 switches the following bistable at 1/3 & 2/3 of Vcc, so you only have the 1/3 in between for the ramp voltage range.
I posted two circuits to let TS know why he wrong, there are some better solutions, but they need more parts.
 

ian field

Joined Oct 27, 2012
6,536
The TS want a fade in function, so it have to make the square wave to a triangle wave or sawtooth wave.
There will be a sawtooth on the capacitor, which would be symmetrical if the TS replaced the diodes & pot with a single resistor. But feeding it to a MOSFET with no nfb (source degeneration) will likely result in abrupt switching. Might also need a small amount of level shifting, but I'd have to prototype it to see what it does.
 

ScottWang

Joined Aug 23, 2012
7,501
This was modified from your circuit without take the R1 away, I'm afraid of you might be a little confusing, so I didn't using that method, since ian field like that way, so I modified it.
555pwm_aquadog90-03_ScottWang.gif
 

crutschow

Joined Mar 14, 2008
38,503
Below is the LTspice simulation of a variation on the 555 circuit which actually reduces the PWM duty cycle at startup.

Because the signal that needs to controlled is floating, I used a common type transistor output opto isolator to vary the duty cycle by momentarily bi-passing the side of the pot that controls the high side time of the PWM.

I reduced the PWM frequency (by increasing C2) so the plot would readily show the change in PWM with time.
This can be changed back to the desired value and PWM frequency for the real circuit.
Increasing the value of C3 increases the time to reach full brightness.

PWM.gif
 

Attachments

Last edited:

Thread Starter

aquadog90

Joined Jun 28, 2015
4
WOW thanks for all the replays guys! I have made the circuit suggested by ScotWang and although it work the blinking really annoying.. I was looking for a circuit that would control current not voltage.

I will attempt the circuit suggested by crutschow but don't expect a replay for couple of days as I need to order the opto and other bits.
 

crutschow

Joined Mar 14, 2008
38,503
I should note that my scheme with the opto does cause the PWM frequency to increase significantly as well as have the duty-cycle reduced during the startup but I don't see that as a problem.
 

ian field

Joined Oct 27, 2012
6,536
WOW thanks for all the replays guys! I have made the circuit suggested by ScotWang and although it work the blinking really annoying.. I was looking for a circuit that would control current not voltage.

I will attempt the circuit suggested by crutschow but don't expect a replay for couple of days as I need to order the opto and other bits.
A fair proportion of anything with an SMPSU has an opto you can salvage out of a scrap one. Things like old set top boxes etc.

They're used in the regulation feedback circuit - some TVs had an extra one for standby switching.

Old dial up modems usually have at least one opto - a few had AC input opto - that is there are 2 IRLEDS in inverse parallel.
 

Thread Starter

aquadog90

Joined Jun 28, 2015
4
hi guys did the circuit suggested by crutschow and it work fine!! The opt response is not very linear but it doesn't matter as its only fading the led in and out!!! Thanks very much for you help guys!
 

NurseBob

Joined Oct 6, 2008
2
I'm aware this is a very old post, but the following may be useful regarding fooling the eye for a smooth, apparent, ramp.
Our eyes/brain tend to respond following a more exponential response, so when attempting a smooth visual ramp using a sequence of increasing/decreasing by orders of 2 will look much more like a smooth ramp.
 

Ian0

Joined Aug 7, 2020
13,131
Take R2 away, and disconnect pin 7 of 555, and in series with a 100K pot between pin 6 of 555 and Vg of mosfet, also in parallel a 22uf ~47uf capacitor with Vgs.

If you want the voltage going up slowly then the C1 should be increasing to 1uf or some more, it depends on how slow you want.

If this way still can't match what you want then there is other way to do that is from pin 3 of 555 and Vg of mosfet.
The last thing you want is a big capacitor between gate and source, unless your really want to blow up the MOSFET.
The gate should be driven from pin 3 rather than pin 7 with a pullup.
@crutschow 's circuit could really do with a resistor in series with the pot wiper so that it has more than the diode between output and timing capacitor at the extremes of rotation.
Some variation in pwm can be obtained by varying the voltage on pin 5. The off time would always remain constant, but the ON time can be varied.
 
Top