PWM using 555 timer

darrins

Jun 29, 2004
82
Joined
Jun 29, 2004
Messages
82
I read several datasheets and application notes on 555 timers, but I can't seem to find the information I'm looking for.

Specifically, I'd like to use the 555 as a pulse width modulator by using the control voltage (pin 5). The datasheets indicate that in monostable mode, the output pulse width can be varied by modulating the voltage at pin 5 (V5). They also indicate that in astable mode, modulating V5 will modulate pulse position.

What I'm wondering is this: What is the relationship between the control voltage, V5, and the values of the timing resistors and caps? There are standard formulas for timing based on these resistors and caps. How are those formulas affected by the introduction of V5?


Thanks.

Darrin

 

ante1

Jan 24, 2004
4,138
Joined
Jan 24, 2004
Messages
4,138
Darrin,

It is very rare to use pin 5 on the 555, I can remember once I have used it and this was for the purpose of detecting missing pulses. However I found one example but it does not provide and formulas.

Ante ::)

View attachment 35600

 

audioguru2

Apr 6, 2004
12,026
Joined
Apr 6, 2004
Messages
12,026
In the 556 PWM circuit that I recently posted, I think that pins 2 and 3 of the LM311 should be reversed.

Here's another 555 PWM circuit that uses diode steering to vary the charge/discharge of the timing capacitor. Note that its output is not the output pin of the 555:

View attachment 35602

 

audioguru2

Apr 6, 2004
12,026
Joined
Apr 6, 2004
Messages
12,026
Darrin,
I am sorry that I am not giving you a formula for the 555's control input to produce PWM.
The control input's voltage range is limited in both polarities by the common-mode input range of the comparators, which the manufacturer doesn't specify. And I can't find my slide-rule!
But you can calculate it yourself, since the capacitor simply charges and discharges exponentially towards the supply voltage and to ground. National Semi's datasheet shows a Pulse-Width-Modulator circuit and a Pulse-Position-Modulator, both operating on a 5V supply, and they limit the control voltage range from 1V to 4V. If you use a higher supply voltage, then the range will probably be greater. See figures 8 to 11 of their datasheet here:
http://www.national.com/ds/LM/LM555.pdf

 

darrins

Jun 29, 2004
82
Joined
Jun 29, 2004
Messages
82
Thanks for the advice guys. I read in one of my textbooks that the control voltage affects the reference voltages of the IC's internal comparators (normally 2/3 and 1/3 of Vcc), but it doesn't say exactly what this effect is.

Here's what is said about pin 5 on Tony van Roon's tutorial page:

"Pin 5 (Control Voltage): This pin allows direct access to the 2/3 V+ voltage-divider point, the reference level for the upper comparator. It also allows indirect access to the lower comparator, as there is a 2:1 divider (R8 - R9) from this point to the lower-comparator reference input, Q13. Use of this terminal is the option of the user, but it does allow extreme flexibility by permitting modification of the timing period, resetting of the comparator, etc. When the 555 timer is used in a voltage-controlled mode, its voltage-controlled operation ranges from about 1 volt less than V+ down to within 2 volts of ground (although this is not guaranteed). Voltages can be safely applied outside these limits, but they should be confined within the limits of V+ and ground for reliability. By applying a voltage to this pin, it is possible to vary the timing of the device independently of the RC network. The control voltage may be varied from 45 to 90% of the Vcc in the monostable mode, making it possible to control the width of the output pulse independently of RC. When it is used in the astable mode, the control voltage can be varied from 1.7V to the full Vcc. Varying the voltage in the astable mode will produce a frequency modulated (FM) output. In the event the control-voltage pin is not used, it is recommended that it be bypassed, to ground, with a capacitor of about 0.01uF (10nF) for immunity to noise, since it is a comparator input. This fact is not obvious in many 555 circuits since I have seen many circuits with 'no-pin-5' connected to anything, but this is the proper procedure. The small ceramic cap may eliminate false triggering."

I may take a look at the 555 internals and see if I can derive timing formulas that include the control voltage. If I figure it out, I'll post it. It seems like it would be useful information. After all, the "standard formulas" are what I use to select "reasonable" values of resistors and caps. Otherwise, I'm selecting them by trial and error.

I want to use PWM to send pulses to an optoisolated triac driver to control a heater (you guys have already answered many of my questions on this topic). I have a reference voltage set by a potentiometer and another voltage from a heat sensor. If there is a large differnence b/n these 2 voltages, I want to sent longer pulses (or more frequent pulses). If there is a small difference, I want to send shorter pulses (or less frequent pulses). If my heat sensor has a higher voltage than reference, I don't want to send any pulses (or at least only short, infrequent pulses). I don't necessarily have to use a 555 if there is a better option.

Thanks for the feedback. This group is quickly becoming my best source of information. :)

Darrin

 

darrins

Jun 29, 2004
82
Joined
Jun 29, 2004
Messages
82
I found a website that describes using the 555 as a voltage controlled oscillator.

http://www.analog.com/library/analogDialogue/archives/29-3/single.html

At the bottom of the page, they have a formula for output frequency.

Charge time, Tc = (R5 + R6)*C5 * ln [ (1-Vin/6.8V) / (1-Vin/3.4V) ]
Discharge time, Td = 0.69 * R6*C5

Frequency, f = 1 / (Tc + Td)

---------------

In the formula, I'm not exactly sure where the 6.8V and 3.4V come from. These values may be specific to their circuit. Anyway, the formula is nonlinear function of control voltage.

I'm very sceptical of this formula, (at least the charge time) because when the control voltage is 0, the formula should reduce to Tc = Tc = (R5 + R6)*C5 ln(2).

Any thoughts?

Darrin

 

ante1

Jan 24, 2004
4,138
Joined
Jan 24, 2004
Messages
4,138
Darrin,

Interesting, I will try to set it up in Isis and simulate it.

Ante ::)

 

audioguru2

Apr 6, 2004
12,026
Joined
Apr 6, 2004
Messages
12,026
Darrin,
The 3.4V is the reference output voltage of the other chip which is being used to power the 555.

That is a VCO circuit which varies the 555's frequency with voltage changes. It will give pulses that are "more frequent", but also narrower, so the end result isn't PWM because the duty-cycle doesn't change much.

 

darrins

Jun 29, 2004
82
Joined
Jun 29, 2004
Messages
82
I found a circuit that is very close to what I am trying to do:

This is from http://www.saburchill.com/tech/electronics/elect039.html

dh111.jpg


This circuit uses a sound sensor to vary the brightness of a lightbulb.

I also figured out some timing formulas based on threshold voltage (Vth) and triggering voltage (Vtr). As you know, normally, Vth = 2/3Vcc and Vtr = 1/3 Vcc. These values result in the "standard" timing formulas. Applying the control voltage, Vc, to pin 5 directly affects these values. It is applied directly to the 2/3 point on the voltage divider. 3 equal-valued resistors make up this voltage divider. The reference voltage for the threshold comparator is b/n the first and second resistor (hence 2/3Vcc) and the ref voltage for the trigger comparater is b/n the 2nd and 3rd resistor (hence 1/3Vcc). If I can figure out how the control voltage affects these reference voltages, the following formulas should work.

In monostable mode:
(pulse width) T = [ln(Vcc) - ln(Vcc-Vth)] * R * C

In astable mode:
T1 = -ln[1 - (Vth - Vtr)/(Vcc - Vtr)] * (R1 + R2) * C
T2 = [ln(Vth) - ln(Vtr)] * R2 * C
(pulse width) T = T1 + T2
(frequency) f = 1 / (T1 + T2)
(duty cycle) % = T1 / (T1 + T2)

-------

I plugged in values Vth = 2/3Vcc and Vtr = 1/3Vcc and got the same values that would result from using the "standard" formulas (discounting some roundoff errors).


Thanks again. :)

Darrin

 

ante1

Jan 24, 2004
4,138
Joined
Jan 24, 2004
Messages
4,138
Darrin,

I tested the circuit in Isis and it seems to work fine. The pulse width is variable from 0 to 100% by varying the voltage at pin 5 from ground to supply voltage.

Ante

View attachment 35605

 

darrins

Jun 29, 2004
82
Joined
Jun 29, 2004
Messages
82
Ante,

I downloaded the shareware version of Proteus (Proteus 6 Lite). Would it allow me to simulate this circuit? I don't know how to use the program, but I'm sure I could learn. Heck, I used SPICE in college (pre-Windows days).

Is it possible for Proteus lite to load the model you have created? If so, is there a way for you to upload the model to this forum (if you're willing)?

Thanks.

Darrin

 

darrins

Jun 29, 2004
82
Joined
Jun 29, 2004
Messages
82
Ante,

Cool. It worked!!! 8)

This will help me greatly. :D

Modeling and simulation are great time savers (not to mention money).

Thanks again.

Darrin

 

ante1

Jan 24, 2004
4,138
Joined
Jan 24, 2004
Messages
4,138
Darrin,

Good to know, You are welcome ;D!

Ante ::)

 

audioguru2

Apr 6, 2004
12,026
Joined
Apr 6, 2004
Messages
12,026
Ante and Darrin,
Do your simulation programs know what happens to the 555's comparators when the pin 5 voltage exceeds their common-mode voltage limit? I think that the comparators won't work if pin 5's voltage is higher than 1 or 2 volts below the supply voltage, or lower than 2 or 3 volts above ground. Look at the comparators' darlingtons and current-sources that will run out of operating voltage.
Therefore the PWM range may be only from 30 percent to 80 percent, which isn't much.
If you adjust pin 5's voltage range to where the circuit barely works at each end, then it will probably fail when the moon is full (or temperature change, or supply voltage, or resistor values drift, etc.).

 
Top