Jump to content
Electronics-Lab.com Community

PWM using 555 timer


Recommended Posts

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

Link to comment
Share on other sites


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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Ante,
I grow hair on my face most of the time, and especially when I see a circuit with its common-mode input voltage limit exceeded.
Have you seen what happens to a TL07X? Its output suddenly inverts! It makes really bad overdrive distortion.

I relate the moon being full with Murphy's Law, and Murphy wasn't even a vampire.

Link to comment
Share on other sites

Ante and audioguru,

The voltage difference between my heat sensor and reference will be, at most, around 300 mA. I've read that, as a rule-of-thumb, that the control voltage at pin 5 should be between 45% and 90% of Vcc. Obviously, I'll have to amplify my signal if I'm going to use a Vcc of say 5V.

Given the limitations that audioguru described (with respect to the 555's PWM capability), will this still be adequate to drive my optoisolated tric driver?

----

I have another dumb question. The triac that I bought came with a mica washer. It is my understanding that the metal part that connects to the heat sink is LIVE :o. I've read that the mica washer should be installed between the metal part and the heat sink, along with some "thermal grease". What is this thermal grease and can I use silicon compound instead (or is silicone compound the same thing)? Looking at the inside of a light dimmer, I noticed that its triac had only a non-metalic washer (no grease). I've heard that there are silicone rubber washers that can replace the mica/grease. This seems a lot less messy. Can these washers be found at most electronics stores?

There is supposed to be a full moon tonight, so maybe I should hold off on building this circuit. ;)

As always, thanks for the help.

Darrin

Link to comment
Share on other sites

Thanks Ante and audioguru. I will try experimenting with a few different designs, including the one Ante simulated. I think I will also try stuffing a few of my temperature sensors (LM34) in a copper tube and use a summing amplifier to calculate an average temperature. A lot of the temp control circuits I see use only one sensor. A body of water can have a large temperature gradient (as can large pieces of metal, etc.).

Well, I better hurry and post this. We are having a big storm here in Texas and the power keeps going out. Too bad I already dismantled my UPS. :-\

Have a nice weekend. :)

Darrin

Link to comment
Share on other sites

Wait a minute, Darrin,
You mentioned, Triac. All along we thought that you were PWM'ing from a DC supply.
A TRIAC works like a latch, since once it is triggered, then it conducts and stays-on until the current through it drops very low (when the mains voltage crosses 0V for resistive loads), when it turns itself off. The TRIAC must be triggered for each 1/2 cycle of the mains. You don't need a PWM circuit, the TRIAC does it. All that you need is a circuit that is syncronized to the mains frequency, and gives a short pulse to the TRIAC's opto with a time delay from when the mains voltage crosses 0V.
With a short time delay, the TRIAC is turned-on early for each 1/2 cycle, and therefore gives nearly full power to the load. With a long time delay, the TRIAC is turned-on late for each 1/2 cycle, almost when the TRIAC will turn itself off anyway, and therefore gives a very low power to the load. The time delay must not exceed the time of 1/2 cycle of the mains frequency.
Recently, 2 other posts discussed "lamp dimmers", with circuits to do this. I would find them for you, but lately this site's navigation is very slow.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
  • Create New...