20911Views12Replies

555 pwm AND frequency controllable? Answered

Hello,

I've been breaking my head on this for a while now, and still couldn't find a correct solution for this.

I want to be able to adjust the duty cycle (pulse width) with one potentiometer, and the frequency with another potentiometer, using a 555 timer.
Adjusting the frequency shouldn't change the duty cycle! (which is the problem in All of the circuits I find online).

This is an example of a circuit I find online, many of the circuits look just like this one (see picture)

Now, the problem is that when you increase the resistance of the potentiometer for adjusting the frequency,
that makes sure you can never get 0% or 100% duty cycle anymore! or not even close to that.
It's because increasing that resistance, also decreases the 'discharging current' of the capacitor, so it will also increase the discharging time when that's not wanted.

Without R2 it works perfectly, from 0% to 100% duty-cycle; but with the frequency potentiometer it all gets messed up.

It's a little difficult to explain, I'll try it with another example :)

To get 0% duty-cycle (or something close to that, like 10%), you'll need to make sure the path for Discharging the capacitor goes near 0Ohm.
Increasing the potentiometer for the frequency makes that impossible because it's in series with the capacitor's charging and discharging circuit. So that would also increase the discharging time while I don't want that.

When the resistance of the frequency potentiometer increases, the duty-cycle gets variable between just something like 45% and 55% (example) so that's not good.

Is there any way do do this? :/

Elecotrials

Tags:

12 Replies

Don't do it with a 555, or at least not one on its own. The classic method is to generate a sawtooth of fixed amplitude, and then put that into a comparator, with a variable voltgae to compare it against. The sawtooth genny is variable frequency

RhesusM (author)2017-01-17

The answer is simple!!!!!!!!! JUST USE CMOS-555!! THOSE IC HAS MOSFET INSTEAD OF TRANSISTORS!! JUST DO IT!!!! NO REGRETS!!!

charlieb000 (author)2012-10-15

remember you can use a 555 and with an opamp on it's cap and get duty from the opamp. the resistors above and below the pot is the same value as the pot.

bob4analog (author)2012-06-03

Well... the 555 certainly has it's limitations, but I think it can be 'tricked' into doing what you want it to.

I've played with these chips and I even made an PWM for a transmitter, altho I did use a comparator after the 555, and the audio input was connected to the comparator reference...worked great!

The only other idea I can think of (rather than the pin-5 adjustment method), is to use a 556...or just use two 555's. the 2nd 555 can be simply set up as just a comparator.

The saw-tooth / triangle waveform from the timing capacitor can be connected to a small 1 transistor buffer, then connect to pin-6. Apply the variable bias voltage at pin 6 thru some kinda resistor; the waveform will 'ride' on the DC bias and you should be able to adjust it wherever you want.

This is theoretical at this point. I've made mine work before by using a similar method, but I gotta go back thru my drawings and find it, then I'll be glad to post it.

Yes, you can get a 'tailored' chip that'll do it all. But if yer just look'n for a simple, elegant way to do it using readily available parts, I think with a little perseverance, it can be done with an ordinary 555...or two.

mspinks (author)2012-03-26

You are precisely correct. The frequency should not change the duty cycle. Something I've thinking about for quite a long time (I'm glad I'm not the only one who was bothered by this) I believe the answers we seek lie within the poor, misunderstood pin 5 which always gets left out. Basically, from what I gather, you make an astable pulse train (the sample rate I believe) which triggers a monostable. But make sure the time period of the monostable is slightly less than the period of the astable. (Something about keeping it from retriggering.) So the duty cycle would only be about 0-95% or whatever the percent the monostable period is of the astable I think. Apply your control voltage to pin 5 and it will set the duty cycle and stay at the correct percentage no matter the frequency. You could even apply a sine wave to pin 5 if you want to. It should produce the pwm equivalent. (at least I hope) I'll would like to try experimenting a bit this weekend. I'll let you know if it works out.

bob4analog (author)2012-05-31

Good point! I've also seen 'frequency' and 'pulse width' used interchangably with referring to PWM's (such as speed controlers for DC motors). With PWM's, pulse width duty cycle changes, NOT frequency.

And pin 5- yes, this would / should make a good control point for adjusting the pulse width. Yes, adjusting control voltage to pin 5 should set the duty cycle without disturbing the RC time constant. The only caveat, is that the internal comparator (pin 5) is connected to a pull-up resistor to VCC (pin 8). So if an external voltage source is used and connected to pin 5, it should probably be a low imedance source such as found with an op-amp output in a voltage follower confiuration. Or, perhaps just a simple pot from pin 5 to ground would work for manually adjust ing the control voltage (It needs experimenting with this).

mspinks (author)2012-06-01

I was able to conduct my experiment finally. I set up a simple PWM similar to the example in the datasheet using two 555 timers and a pot to control the pulse width on pin 5. Unfortunately, it didn't work quite as well as I had hoped. If you'll recall, the comparators have two voltage thresholds: One at 1/3 Vcc and the other at 2/3 Vcc. Pin 5 only allows you to change the upper threshold voltage level. So in this case I can vary my pulse width from 33.3% to 99%. This wasn't enough for what I wanted, but it certainly did work to a certain extent.

NathanTaub (author)2011-11-30

https://www.instructables.com/id/Insanely-easy-independent-control-of-frequency-and/

It's not particularly clear -- I kinda rushed the instructable when I saw this question -- but I think that with this information you should have no trouble building the function generator you want.

steveastrouk (author)2011-10-28

Have you any op-amps ? You can do this with two of them !

Steve

steveastrouk (author)2011-10-28

Set the first 555 as a square wave generator, of variable frequency, set the second as a one shot of variable width....

Steve

Jack A Lopez (author)2011-10-27

C'est la vie. BTW, what range of frequency, and what range of duty cycle, are you looking to achieve?

Jack A Lopez (author)2011-10-27

I suggest using an IC that is intended to do this.  For example,  the SG3524