100nF

555 astable design: frequency, duty cycle and error

Size RA, RB and C for a 555 oscillator, find out why the duty cycle cannot reach 50 %, and see which of the datasheet's error terms actually dominates.

Three equations run the classic 555 astable, and the LM555 datasheet (SNAS548D) prints all three. The output is high for t1=0.693 (RA+RB) Ct_1 = 0.693\,(R_A + R_B)\,C, low for t2=0.693 RB Ct_2 = 0.693\,R_B\,C, and the period is their sum. Everything else on this page is a consequence of one asymmetry inside them: the capacitor charges through RAR_A and RBR_B in series and discharges through RBR_B alone.

That asymmetry has a consequence worth knowing before the first resistor is picked. The high time contains RA+RBR_A + R_B and the low time contains only RBR_B, so the high time is always the longer of the two. The classic astable cannot produce a 50 % duty cycle, or anything below it, at any resistor values. It approaches 50 % as RBR_B grows without bound, and pays for every step closer with discharge current. The 555 timer calculator solves both directions of this and refuses the combinations that have no solution; this article is why it refuses them.

The classic 555 astable: RA from the supply to the discharge pin, RB from the discharge pin to the joined threshold and trigger pins, and the timing capacitor from that node to ground. The capacitor charges through RA and RB in series but discharges through RB alone.
Fig 1 — The astable, and the asymmetry built into it. Charge current flows through RA and RB in series; discharge current flows through RB alone. That single difference is why the output is high longer than it is low, always.

Where 0.693 and 1.1 come from

Neither constant is a fudge factor, and neither is specific to the 555. The comparators inside the part sit at 13VCC\tfrac{1}{3}V_{CC} and 23VCC\tfrac{2}{3}V_{CC} — the datasheet gives the threshold as 0.667×VCC0.667 \times V_{CC} and the trigger as 1.67 V at a 5 V supply — so every timing interval is an RC exponential crossing between two fixed fractions of the supply.

Charging from 13VCC\tfrac{1}{3}V_{CC} toward VCCV_{CC} and stopping at 23VCC\tfrac{2}{3}V_{CC} takes

t=RCln⁡ ⁣(VCC−13VCCVCC−23VCC)=RCln⁡2t = RC \ln\!\left(\frac{V_{CC} - \tfrac{1}{3}V_{CC}}{V_{CC} - \tfrac{2}{3}V_{CC}}\right) = RC \ln 2

and discharging from 23VCC\tfrac{2}{3}V_{CC} toward zero, stopping at 13VCC\tfrac{1}{3}V_{CC}, takes RCln⁡2RC \ln 2 as well. So 0.693 is ln⁡2\ln 2, printed to three places. The monostable’s 1.1 is ln⁡3\ln 3, because there the capacitor starts at zero instead of at a third of the supply:

t=RCln⁡ ⁣(VCC−0VCC−23VCC)=RCln⁡3t = RC \ln\!\left(\frac{V_{CC} - 0}{V_{CC} - \tfrac{2}{3}V_{CC}}\right) = RC \ln 3

Both roundings are harmless — 0.693 is 0.02 % below ln⁡2\ln 2 and 1.1 is 0.13 % above ln⁡3\ln 3 — but knowing they are logarithms is what lets every other question on this page be answered. Change the thresholds and the constants change with them; that is exactly what happens when the discharge pin fails to reach ground, several sections below.

Capacitor voltage ramping exponentially between one third and two thirds of the supply, with the output square wave below it. The rising segments are longer than the falling ones, so the output high time exceeds the low time.
Fig 2 — One cycle, integrated from the RC step response for RA = 6.8 kΩ, RB = 3.3 kΩ, C = 100 nF at 5 V. The capacitor never leaves the middle third of the supply, which is why the period is 0.929 ms and not something involving the supply voltage.

The period does not contain the supply voltage

The most useful property of the topology falls straight out of the logarithm. Both the starting voltage and the target scale with VCCV_{CC}, so the supply cancels inside the ratio and the period does not depend on it. The datasheet states the same thing twice, once for each mode: in the monostable, “since the charge and the threshold level of the comparator are both directly proportional to supply voltage, the timing interval is independent of supply”, and in the astable,

As in the triggered mode, the charge and discharge times, and therefore the frequency are independent of the supply voltage.

This is a first-order statement, not a guarantee. The datasheet’s own astable error line still allows 0.30 % per volt of drift with supply, and the saturation effect below is one of the reasons that number is not zero. But it means a 555 running from an unregulated supply keeps its frequency far better than a comparator-and-reference oscillator would, which is a large part of why the part survived fifty years.

The same capacitor waveform drawn at 5 V and at 15 V. The absolute voltages triple but the thresholds move with them, so both traces cross their limits at exactly the same times and the two periods are identical.
Fig 3 — Why the period does not contain VCC. The thresholds are fractions of the supply, so tripling the supply triples both the starting point and the target and leaves the ratio inside the logarithm unchanged. Both traces here have the same period to the last digit.

Duty cycle and frequency are not independent knobs

Dividing the high time by the period gives

D=t1t1+t2=RA+RBRA+2RBD = \frac{t_1}{t_1 + t_2} = \frac{R_A + R_B}{R_A + 2R_B}

Both RAR_A and RBR_B appear in both the period and the duty cycle, so there are two equations in two unknowns and no free choice left once frequency and duty are fixed. That is the useful way round: pick CC, pick ff and DD, and the two resistors are determined.

Solving them out, with T=1/fT = 1/f:

RB=(1−D) TCln⁡2,RA=(2D−1) TCln⁡2R_B = \frac{(1-D)\,T}{C \ln 2}, \qquad R_A = \frac{(2D-1)\,T}{C \ln 2}

and the second of those is the whole story about 50 %. RAR_A is positive only when D>0.5D > 0.5. At exactly 50 % it demands RA=0R_A = 0, which shorts the supply to the discharge pin; below 50 % it demands a negative resistance. This is why the calculator rejects a target duty at or under half, rather than returning a value that would not work on a bench.

Duty cycle plotted against the ratio of RB to RA. The curve starts near 100 per cent for small RB and falls toward 50 per cent as RB grows, approaching it as an asymptote it never reaches.
Fig 4 — Duty cycle against RB/RA, computed from the two interval equations. Fifty per cent is a floor the topology approaches and never reaches; even 55 % costs RB = 4.5 RA, and 52.6 % costs RB = 9 RA — a discharge path nine times stiffer than the charge path.

A worked example, end to end

Take RA=6.8 kΩR_A = 6.8\ \text{k}\Omega, RB=3.3 kΩR_B = 3.3\ \text{k}\Omega, C=100 nFC = 100\ \text{nF} at 5 V — ordinary E24 values, nothing chosen to make the arithmetic tidy:

t_high = ln2 x (6800 + 3300) x 100e-9  = 0.7001 ms
t_low  = ln2 x 3300 x 100e-9           = 0.2287 ms
period = 0.7001 + 0.2287                = 0.9288 ms
f      = 1 / 0.9288 ms                  = 1076.6 Hz
duty   = 0.7001 / 0.9288                = 75.4 %

Round trip that through the printed constants instead of the logarithms and the frequency comes out 1076.9 Hz — 0.02 % higher, because 0.693 sits fractionally below ln⁡2\ln 2 — three orders of magnitude below the part’s own initial accuracy. The rounding in the datasheet is not what will be wrong with this circuit.

Choose the capacitor first

Frequency is inversely proportional to CC and to RA+2RBR_A + 2R_B alike, so on a log plot the design space is a family of parallel lines and choosing CC selects which line you are on. That ordering matters because the resistors are the constrained variable and the capacitor is not: resistors are bounded below by the discharge pin’s current and above by the part’s threshold current, while capacitors are available across nine decades.

The practical rule is to pick the largest capacitor that keeps the resistors inside 1 kΩ–100 kΩ, and to prefer C0G/NP0 for anything whose frequency is supposed to stay put. A 100 nF X7R part is not a 100 nF part at temperature or under bias — see the DC bias capacitance loss that class 2 ceramics carry — and in a timing circuit that loss appears directly as frequency error, ahead of every term the 555’s own datasheet lists.

A log-log plot of oscillation frequency against timing capacitance, with one line for each of several resistance sums. Frequency falls as capacitance rises, and the usable band is bounded below by the smallest sensible resistance and above by the datasheet twenty megohm ceiling.
Fig 5 — Frequency against timing capacitance for a range of RA + 2RB, computed from the period equation. Pick the capacitor first: it moves the whole family of lines, while the resistors only slide along one of them.

Getting to 50 % and below: the diode across RB

The standard fix puts a diode across RBR_B, anode at the discharge pin, so that charge current bypasses RBR_B through the diode while discharge current still has to go through it. The two intervals become independent: RAR_A sets the high time, RBR_B sets the low time, and any duty cycle between the two extremes becomes reachable.

The diode is not free, and the usual textbook version of the modification — “now D=RA/(RA+RB)D = R_A/(R_A + R_B)” — is the version that fails on the bench. A silicon diode drops something like 0.6 V, and that drop comes off the charging asymptote: the capacitor is no longer heading for VCCV_{CC} but for VCC−VFV_{CC} - V_F. The high time becomes

t1=RACln⁡ ⁣(VCC−VF−13VCCVCC−VF−23VCC)t_1 = R_A C \ln\!\left(\frac{V_{CC} - V_F - \tfrac{1}{3}V_{CC}}{V_{CC} - V_F - \tfrac{2}{3}V_{CC}}\right)

which is no longer ln⁡2\ln 2 times anything. At 5 V with a 0.6 V drop, setting RA=RBR_A = R_B and expecting a square wave gets 57.6 % instead; equal times need RA≈0.74 RBR_A \approx 0.74\,R_B. The error shrinks as the supply rises, because VFV_F is a fixed voltage subtracted from an amplitude that scales — which is the same reason a Schottky helps and a 12 V supply helps more.

The astable with a diode across RB, anode at the discharge pin. Charge current now bypasses RB through the diode and flows through RA alone, while discharge current still flows through RB, so the two intervals become independent.
Fig 6 — A diode across RB separates the two paths: charge through RA and the diode, discharge through RB. The two intervals become independent, at the cost of a forward drop that the charging exponential now has to be solved with.
Duty cycle against the ratio of RA to RB for the diode variant, drawn once for an ideal diode and once with a 0.6 volt forward drop at a 5 volt supply. Both curves sweep through fifty per cent, but the real diode shifts the crossing to a different resistor ratio.
Fig 7 — With the diode, duty sweeps through 50 % instead of stopping above it. The forward drop is not cosmetic: at 5 V a 0.6 V diode moves the equal-time point from RA = RB to RA ≈ 0.74 RB, so setting RA = RB and expecting a square wave gets 57.6 % instead.

What the discharge pin is being asked to do

The discharge pin is an open collector. The datasheet describes it as an “open collector output which discharges a capacitor between intervals (in phase with output)”, and at the instant the output goes low it has to sink whatever 23VCC\tfrac{2}{3}V_{CC} across RBR_B demands. For the worked example that is 1.01 mA, which is nothing. Drop RBR_B to 100 Ω at 15 V and it is 100 mA — half of what the part’s output stage is rated to source or sink, flowing instead through a pin that has no current rating at all. The 200 mA in the datasheet belongs to pin 3. The only thing SNAS548D says about pin 7 current is footnote (6) to the saturation specification:

No protection against excessive pin 7 current is necessary providing the package dissipation rating will not be exceeded.

That rating is 613 mW absolute maximum for the VSSOP, derated above 25 °C, and the pin itself is specified at just two points: 180 mV with 15 mA flowing at 15 V, and up to 200 mV with 4.5 mA at 4.5 V. Worked back through 23VCC/RB\tfrac{2}{3}V_{CC}/R_B, both of those points correspond to RB≈670 ΩR_B \approx 670\ \Omega. Below that the pin is in territory the specification table does not cover, and the datasheet’s typical curves for it (Figures 9 and 10) show why that matters: the saturation voltage climbs from tens of millivolts at 1 mA to about a volt at 100 mA at 15 V, and the 5 V curve stops at around 30 mA.

This sets the lower wall of the design space, and it is the reason small resistors are not simply a way to reach high frequencies. Two things go wrong long before the package dissipation does:

  • The saturation voltage stops being negligible. The next section is about what the two specified points — and the curve beyond them — do to the timing.
  • The dissipation is real. Each cycle the energy the capacitor gives up is dissipated in RBR_B and the discharge transistor, split in proportion to their voltage drops, so as the saturation voltage climbs the transistor’s share climbs with it. The LM555 in a VSSOP package has a junction-to-ambient thermal resistance of 204 °C/W — the same θJA-is-a-property-of-the-test-board problem every other small package has.
Peak discharge current against RB, drawn for three supply voltages, on log axes. A guide at RB of about 670 ohms marks the two currents at which the datasheet specifies the discharge pin saturation; left of it the pin is limited only by package dissipation, and the output pin two hundred milliamp rating is drawn for scale.
Fig 8 — The current RB asks the discharge pin to sink at the instant the output goes low, computed as ⅔VCC/RB. The datasheet specifies pin 7 at only two points, 15 mA and 4.5 mA — both RB ≈ 670 Ω — and sets no current rating on it: footnote (6) asks only that the package dissipation not be exceeded. The 200 mA line is the output pin's rating, drawn for scale; at 15 V, RB = 50 Ω would ask the discharge pin for the same current. Below a kilohm the saturation voltage is no longer negligible.

The error nobody budgets for: the discharge floor

Every derivation above assumed the capacitor discharges toward 0 V. It does not. It discharges toward the saturation voltage of the transistor on pin 7, and that changes the ratio inside the logarithm:

t2=RBCln⁡ ⁣(23VCC−VSAT13VCC−VSAT)t_2 = R_B C \ln\!\left(\frac{\tfrac{2}{3}V_{CC} - V_{SAT}}{\tfrac{1}{3}V_{CC} - V_{SAT}}\right)

Put the datasheet’s 200 mV worst case into that at a 5 V supply and the low interval is 9.5 % longer than ln⁡2⋅RBC\ln 2 \cdot R_B C. At 15 V the same 200 mV costs 3.0 %, and with the typical 80 mV at 5 V it is 3.6 %. Those figures are for the low interval alone; the high interval charges toward VCCV_{CC} and is untouched, so on the period the error scales by 1−D1 - D. For the worked example, with D=75.4D = 75.4 %, the 9.5 % becomes about 2.3 % of the period and the typical 80 mV about 0.9 % — the worst case is the whole of the 2.25 % initial accuracy the same datasheet quotes, spent on one mechanism.

The shape of that curve is the point. The error is a fixed voltage measured against a threshold that scales with the supply, so running a 555 at 5 V rather than 15 V roughly triples the timing error the discharge floor contributes. Two qualifications keep that honest. The 200 mV maximum is specified with 4.5 mA flowing into pin 7; the worked example sinks 1 mA, so its floor is lower, and 200 mV is an upper bound rather than a prediction. And the datasheet’s 2.25 % is not blind to the mechanism: footnote (4) says the timing error was tested at both 5 V and 15 V, with RAR_A and RBR_B down to 1 kΩ, so whatever saturation error exists under those conditions is already inside that figure. What the curve shows is how much of it this one mechanism can account for at 5 V, and why a circuit that sinks more pin 7 current than the test condition — a smaller RBR_B, or a larger capacitor at the same frequency — can see more than the datasheet quotes. If the duty cycle of a 5 V 555 measures a few per cent away from the calculated value, this is a likely place it went, and no amount of resistor precision will recover it.

The lengthening of the low interval caused by the discharge pin never reaching zero volts, plotted against supply voltage. The error is nearly ten per cent at four and a half volts and falls to about three per cent at sixteen volts.
Fig 9 — What a 200 mV saturation floor on the discharge pin does to the low interval. The capacitor is aiming at that floor rather than at ground, so the ratio inside the logarithm changes: +10.7 % at 4.5 V, +2.8 % at 16 V. These are errors in the low interval alone; on the period they scale by 1 − D, about 2.3 % for the worked example. The datasheet's 2.25 % was measured at 5 V and 15 V with RB down to 1 kΩ, so it already carries this effect at those currents.

The error budget the datasheet does publish

For the astable, SNAS548D specifies, over RA,RB=1 kΩR_A, R_B = 1\ \text{k}\Omega to 100 kΩ with C=0.1 μFC = 0.1\ \mu\text{F}:

TermAstableMonostable
Initial accuracy2.25 %1 %
Drift with temperature150 ppm/°C50 ppm/°C
Accuracy over temperature3.0 %1.5 %
Drift with supply0.30 %/V0.1 %/V

Two things are worth reading off that table. First, the astable is roughly twice as bad as the monostable on every line, because it uses both comparators and both thresholds instead of one. Second, the numbers are per cent, not parts per million: over 0 to 70 °C with a ±5 % supply the total band reaches ±3.0 % at the 70 °C end — 25 °C is not the middle of the range, so the cold end stops at ±2.7 % — matching the datasheet’s own “accuracy over temperature” line, and that is before the capacitor’s own tolerance and temperature coefficient join it.

For scale, a 20 ppm crystal is a thousand times better, and what it takes to get a crystal to start is the price of that. A 555 is a fine choice for a blinker, a PWM ramp, a watchdog kick or a delay; it is the wrong choice for anything whose frequency has to agree with another device’s — the baud rate error calculator shows how little margin an asynchronous link leaves before framing fails.

A stacked frequency error budget across the commercial temperature range, showing the datasheet initial accuracy, the temperature drift term and the supply drift term as widening bands around the nominal frequency.
Fig 10 — The astable error budget from the datasheet's own numbers: 2.25 % initial, 150 ppm/°C, 0.30 %/V. Over 0–70 °C and a ±5 % supply the band reaches ±3.0 % at the hot end — wider than a resistor tolerance, which is why nobody clocks anything that matters from a 555.

The upper wall: threshold current and 20 MΩ

At the other end of the resistance range the limit is leakage. The datasheet specifies a threshold current of 0.25 µA maximum, and attaches an unusually direct footnote to it:

This will determine the maximum value of RA + RB for 15 V operation. The maximum total (RA + RB) is 20 MΩ.

The reasoning is that the current flowing into the threshold pin has to be small compared with the current charging the capacitor through RA+RBR_A + R_B; at 20 MΩ and 15 V, the charging current is well under a microamp and the comparator’s own input current is a significant fraction of it. Past that, the timing stops being set by the RC at all.

So the astable’s usable design space has a hard wall at each end — the discharge current on the left, 20 MΩ on the right — and a narrower strip in the middle, 1 kΩ to 100 kΩ, which is the only region where the timing error figures above were actually measured. Designing outside that strip is allowed; quoting those error figures while doing it is not.

The region of capacitance and resistance that a 555 astable can actually use, bounded on one side by the discharge current rating and on the other by the twenty megohm resistance ceiling, with contours of constant frequency crossing it.
Fig 12 — The usable corner of the design space. The left wall is the discharge current of Fig 8, the right wall the 20 MΩ ceiling the datasheet sets from threshold current, and the strip between is where RA and RB are both inside the 1 kΩ–100 kΩ range the timing error is actually specified over — 3 kΩ to 300 kΩ in RA + 2RB. The wall is drawn at its conservative end: RA + RB ≤ 20 MΩ lands between 20 and 40 MΩ on this axis, depending on how the two resistors split.

The monostable, and its one trap

In the monostable, the same part becomes a one-shot: a trigger falling below 13VCC\tfrac{1}{3}V_{CC} releases the discharge transistor and drives the output high, and the pulse ends when the capacitor reaches 23VCC\tfrac{2}{3}V_{CC} — ln⁡3⋅RAC\ln 3 \cdot R_A C later. The datasheet’s own example is RA=9.1R_A = 9.1 kΩ with C=0.01 μFC = 0.01\ \mu\text{F}, which computes to 100.0 µs.

The trap is retriggering. During the timing cycle, a further trigger pulse has no effect — but only conditionally:

During the timing cycle when the output is high, the further application of a trigger pulse will not effect the circuit so long as the trigger input is returned high at least 10 μs before the end of the timing interval.

A trigger input still sitting low when the interval expires holds the output high past its calculated width. That makes a bare pushbutton on the trigger pin a poor idea for any pulse shorter than the time a finger stays down, and it is why the datasheet’s own LED example wires the button through a pull-up and relies on the pulse being five seconds long. An RC differentiator on the trigger input fixes it properly.

The monostable circuit beside its waveform: a trigger pulse falling below one third of the supply starts the output pulse, the capacitor charges from zero toward the supply, and the pulse ends when it reaches two thirds of the supply.
Fig 11 — The one-shot, and why its constant is 1.1 rather than 0.693. The capacitor starts at zero rather than at ⅓VCC, so the interval is ln 3, not ln 2 — the same RC crossing arithmetic, over a longer stretch of the exponential.

The pins nobody wires up, and why they bite

Two pins are routinely left floating on a schematic that then behaves oddly.

Reset, pin 4. A low on it disables the timer. The datasheet is explicit: “when not used for reset purposes, it should be connected to VCC to avoid false triggering”. A floating reset pin on a board with a switching supply nearby is a board that stops oscillating intermittently.

Control voltage, pin 5. It is the 23VCC\tfrac{2}{3}V_{CC} reference brought out, and the datasheet notes an external voltage there “can also be used to modulate the output waveform” — which is the whole basis of 555 pulse-width modulation. Left unconnected it is a high-impedance node sitting at the reference, wired directly into a comparator input: exactly the arrangement guard rings exist for. The conventional 10 nF to ground on pin 5 is not decoupling in the supply sense; it is holding a comparator threshold still.

The supply pin needs the usual treatment for a different reason. The output stage can source or sink 200 mA and switches in about 100 ns, and that current has to come from somewhere in that time. This is the ordinary case for a 100 nF close to the pin, placed with the via right at the pad — a 555 driving a load hard enough to matter is a 555 that can disturb its own thresholds through the supply.

Where the 555 stops being the right part

A short list, since the failure modes are all predictable from the above:

  • A duty cycle at or below 50 % — impossible without the diode, and with the diode the forward drop has to be in the arithmetic.
  • Frequency accuracy better than a few per cent — the datasheet says 2.25 % before the capacitor is even considered.
  • Long timing at low current — the 20 MΩ ceiling caps the resistance, so long intervals need large capacitance, and large capacitance at low leakage is electrolytic, whose own leakage then sets the interval.
  • Sub-microsecond pulses — the output’s 100 ns rise and fall are a significant fraction of the interval, and the propagation delay through the comparator is not in any of the equations.
  • A clean supply — 200 mA switching in 100 ns is a noise source sharing a rail with whatever else is on the board.

Everything else it does well, cheaply, and with parts that have been in distribution since 1972. Work the values out with the 555 timer calculator, which solves in both directions and flags the resistor range the datasheet’s error figures actually cover, then check the duty cycle against Fig 4 before ordering the board.