Every circuit that makes its own rhythm — a blinking LED, a clock, a tone, a heartbeat for a microcontroller — is an amplifier wired with positive feedback. This chapter builds that idea from the RC charge curve up to the 555 timer, the most-used chip in the history of electronics, and shows you how to pick real R and C values for a target rate.
You are building a status indicator. You want a single LED to blink about twice a second — slow enough that a human reads it as "alive and working," fast enough that it does not look broken. On your bench you have a 555 timer chip, an assortment of resistors, and a box of capacitors. Nothing else.
What values do you pick? You cannot just wire the LED to power — that gives a steady glow, no blink. You cannot tap it off the wall — that is 60 Hz, a hundred times too fast and invisible. You need a circuit that makes its own time: something that goes on, waits, goes off, waits, and repeats forever with no one pressing a button. That is an oscillator.
And here is the twist that this whole chapter pays off. Suppose you later want the LED to flash briefly and stay dark for a long stretch — a short "blip" once a second, like a low-battery warning. With the textbook 555 wiring, you will find you cannot get the on-time shorter than the off-time, no matter how you choose the resistors. The duty cycle refuses to drop below 50%. Then someone tells you to solder a single diode across one resistor, and suddenly it works. Why? By the end of Chapter 6 you will know exactly why — it falls straight out of which resistors the capacitor charges and discharges through.
Drag the rate slider to see how the LED's on/off pattern changes. This is the square wave we are trying to generate. At 2 Hz the LED reads as a calm, deliberate blink; crank it up and it blurs into a steady glow.
The slider above is just an animation — it knows nothing about resistors. The rest of this chapter builds the actual machine that produces this waveform, then hands you the formula to dial in any rate you want. We start with the deepest question: why does a circuit oscillate at all?
An amplifier takes a small input and makes a bigger copy at the output. By itself it does nothing on its own — no input, no output. The magic happens when you take a piece of that output and feed it back to the input. There are two ways to do it, and the difference decides everything.
Negative feedback sends the output back out of phase (inverted). It fights the input, settling the circuit down to a stable, well-behaved operating point. This is what makes op-amp amplifiers and filters precise. Positive feedback sends the output back in phase — reinforcing the input. The output drives the input, which drives the output harder, which drives the input harder still. The circuit runs away from any resting point. If you arrange it so the runaway hits a limit, flips direction, runs away the other way, and repeats, you have an oscillator.
The Barkhausen criterion makes this precise: a loop will sustain a steady oscillation when, around the full loop, the signal comes back in phase (a total phase shift of 0° or 360°) and with a loop gain of at least 1. Less than unity gain and the oscillation dies out; the in-phase condition is what positive feedback guarantees.
There are two great families of oscillator, and they differ in what sets the timing. Relaxation oscillators charge a capacitor through a resistor until a threshold is crossed, then dump it and start over — the timing comes from the RC charge curve, and the output is a square or triangle wave. Resonant oscillators ring an LC tank or a quartz crystal at its natural frequency — the timing comes from resonance, and the output is a clean sine. The 555 timer, our workhorse, is a relaxation oscillator.
Imagine a non-inverting amplifier with gain A = 3.2 feeding a feedback network that returns a fraction β = 0.33 of the output, in phase. The loop gain is Aβ = 3.2 × 0.33 = 1.06. Because 1.06 ≥ 1 and the feedback is in phase, any tiny noise voltage grows cycle by cycle until the amplifier saturates against its supply rails. If instead β = 0.30, then Aβ = 0.96 < 1, and the same noise shrinks toward zero — dead silence. Real oscillators deliberately set the small-signal loop gain a hair above 1 so they start reliably, then rely on saturation to hold the amplitude steady.
A tiny seed voltage is multiplied by the loop gain Aβ each cycle. Set the gain and watch: above 1 the signal explodes until it clips against the rails (an oscillation is born); below 1 it dies away.
Before we open up the 555, let us build an oscillator from parts you already understand: one op-amp, two resistors, and a capacitor. This circuit is the 555 in miniature, and seeing it work makes the 555 obvious.
Wire an op-amp as a comparator with positive feedback. The output can only be at the positive rail (+Vsat) or the negative rail (−Vsat). A resistor divider feeds a fraction of the output back to the non-inverting (+) input — that is the positive feedback, and it creates two switching thresholds (this is a Schmitt trigger). Meanwhile the output also charges a capacitor through a resistor R1, and the capacitor voltage drives the inverting (−) input.
Now watch the dance. Say the output is high. The capacitor charges up toward +Vsat along the familiar exponential curve. The moment the cap voltage climbs above the upper threshold on the (+) input, the comparator flips: output slams to the negative rail. Now the capacitor discharges and charges the other way, toward −Vsat, until it falls below the lower threshold — and the comparator flips back. The capacitor is forever chasing a rail it never reaches, because crossing the threshold yanks the rail out from under it. The output is a clean square wave; the capacitor traces a triangle-ish ramp.
With the feedback divider set to equal resistors (Ra = Rb), the thresholds sit at ±⅓ of Vsat, the logarithm becomes ln(3) ≈ 1.0986, and the period simplifies to the tidy rule of thumb T ≈ 2.2 R1C. Notice it does not depend on the supply voltage at all — the rails cancel out, because both the charging target and the threshold scale with Vsat. That supply-independence is a huge practical win.
You want roughly 1 kHz, so T = 1 ms. Pick C = 10 nF. Rearranging T ≈ 2.2 R1C:
So R1 ≈ 45 kΩ (a standard 47 kΩ gives T = 2.2 × 47k × 10n = 1.034 ms, or f ≈ 967 Hz — close enough). The op-amp relaxation oscillator is elegant, but op-amps are slow and the thresholds drift with the part. The 555 packages this exact idea with rock-solid internal thresholds — which is where we go next.
The blue curve is the capacitor voltage chasing each rail; the dashed lines are the upper and lower thresholds (±⅓·Vsat). The orange square wave below flips every time the cap crosses a threshold. Adjust R·C to speed it up or slow it down.
The 555 timer, introduced by Signetics in 1972, is the most popular integrated circuit ever made — billions per year, still. And it is just the relaxation oscillator of Chapter 2, drawn in silicon with bullet-proof thresholds. Crack it open and you find five blocks: a three-resistor voltage divider, two comparators, an SR flip-flop, a discharge transistor, and an output buffer.
Inside is a string of three 5 kΩ resistors in series from Vcc to ground — that is where the name comes from. Three equal resistors split the supply into thirds, creating two reference voltages: ⅔·Vcc at the top tap and ⅓·Vcc at the bottom tap. These two voltages are the fixed thresholds the whole chip lives by, and because they are ratios of Vcc, the timing is supply-independent just like the op-amp version.
Two comparators watch a single external timing capacitor:
The comparator outputs drive an SR flip-flop — a one-bit memory. Set makes its output Q high; Reset makes Q low; in between, it remembers. The flip-flop's inverted output drives two things at once: the output pin 3 (through a buffer that can source or sink ~200 mA) and a discharge transistor on pin 7. When the flip-flop says "high," the transistor is off and the cap charges; when it says "low," the transistor switches on and yanks pin 7 to ground, dumping the cap. That is the positive-feedback loop: the cap voltage decides the comparators, the comparators set the flip-flop, the flip-flop controls the transistor, and the transistor controls the cap voltage. Round and round.
Watch the signal travel the loop: capacitor → comparators → SR flip-flop → discharge transistor → back to the capacitor. The active stage lights up as the cap crosses each threshold. This is the heartbeat of the whole chip.
"Astable" means "no stable state" — the circuit never rests, it free-runs forever, flipping between high and low on its own. This is exactly the mode we want for a blinking LED. The wiring is the classic 555 oscillator that appears on a million breadboards.
Connect two resistors and one capacitor: R1 from Vcc to pin 7, R2 from pin 7 to pins 6/2 (tied together), and the timing capacitor C from pins 6/2 to ground. Pins 6 and 2 are joined, so the same cap voltage drives both comparators. Now the asymmetry that defines everything appears:
This is the crux of the whole chapter, so say it out loud: the capacitor charges through R1+R2 but discharges through R2 alone. The charge path always has more resistance than the discharge path. Charging is slower than discharging. Output-high lasts longer than output-low. The duty cycle is always above 50%. Hold onto that — it is the seed of the diode-trick puzzle from Chapter 0.
How long does each leg take? Each leg is an RC exponential crawling between ⅓Vcc and ⅔Vcc — a swing across one-third of the way to the target. The exponential math gives the same ln(2) ≈ 0.693 factor for both legs:
Charging from ⅓Vcc toward Vcc (the cap aims at the full supply) and stopping at ⅔Vcc: the fraction of the remaining gap closed is (⅔−⅓)/(1−⅓) = (⅓)/(⅔) = ½. The time to close half the gap on an exponential is τ·ln(2) = 0.693τ where τ = (R1+R2)C. The discharge leg drains from ⅔Vcc toward 0, stopping at ⅓Vcc — again exactly half the remaining gap, again 0.693τ with τ = R2C. Same constant, different resistor — and that single difference is the whole story.
The capacitor voltage (blue) ramps up to ⅔Vcc, gets dumped down to ⅓Vcc, and repeats. Dashed lines mark the two thresholds. The orange square wave underneath is pin 3, synced to the cap. Notice the up-ramp is slower than the down-ramp — that is R₁+R₂ vs. R₂.
Now we cash in the two leg-times into the numbers an engineer actually quotes: frequency and duty cycle. Add the two legs to get the period, invert for frequency, and divide to get duty.
Look hard at the duty formula. The numerator R1+R2 is always smaller than the denominator R1+2R2 by exactly R2, and it is always larger than half the denominator. So duty is mathematically pinned between 50% and 100% — you can approach 50% by making R1 tiny and R2 huge, but you can never cross below it. (Why the "1.44"? It is just 1/0.693 = 1/ln(2). The whole astable is the ln(2) charge time wearing different clothes.)
Take R1 = 10 kΩ, R2 = 20 kΩ, C = 680 nF. Step through it:
Cross-check with the direct frequency formula: f = 1.44 / ((10k + 2×20k) × 680n) = 1.44 / (50{,}000 × 680×10−9) = 1.44 / 0.034 = 42.4 Hz. The two routes agree to rounding. A 60% duty means the LED is on 60% of each cycle — visibly "more on than off."
We finally solve the opening problem. Target f = 2 Hz, duty ≈ 0.5. Start by choosing the capacitor — for slow blinks you want a big one, so pick C = 10 µF. Now solve the frequency formula for the resistor combination:
To push duty toward 50%, make R1 small. Pick R1 = 1 kΩ. Then 2R2 = 72,000 − 1,000 = 71,000, so R2 = 35.5 kΩ. The nearest standard value is 33 kΩ (or 36 kΩ). Use R2 = 33 kΩ and recheck:
Done. R1 = 1 kΩ, R2 = 33 kΩ, C = 10 µF gives a ~2.15 Hz blink at ~51% duty — exactly the calm, even status blink we set out to build. Wire the LED (with a current-limiting resistor) from pin 3 to ground and you are watching the waveform from Chapter 0 in real silicon.
The full design tool. Set R₁, R₂, and C; the live oscilloscope trace shows the real square wave, and the readout computes f, thigh, tlow, and duty using the exact formulas above. Try to recreate the 2 Hz blinker, then chase a 50% duty — watch how it asymptotes but never crosses.
Here is the Chapter 0 puzzle, ready to crack. You want a short "blip": LED on briefly, off for a long stretch — a duty cycle below 50%. But we just proved the standard astable's duty is locked between 50% and 100%. The fundamental reason: the capacitor charges through R1+R2 (output high, the long leg) and discharges through R2 (output low, the short leg). The charge path always has at least as much resistance as the discharge path, so thigh ≥ tlow, always.
To get duty below 50% you must make charging faster than discharging — you must separate the two paths so charge skips R2 entirely. The fix is one diode.
Solder a diode across R2, anode toward pin 7 (the charging side), so it conducts only while charging. Now during charge, current takes the easy route through the diode and bypasses R2 — the cap charges through R1 alone. During discharge the diode is reverse-biased and blocks, so the cap still drains through R2 alone as before. The two paths are now independent resistors:
Now if R1 < R2, duty drops below 50% — the long-sought blip. The two legs are finally decoupled.
Take R1 = 10 kΩ, R2 = 47 kΩ, C = 1 µF, with the diode across R2:
The LED is on for just 6.9 ms out of every 39 ms — a crisp 18% blip, impossible without the diode. (One caveat: the diode adds a ~0.6 V drop in the charge path, so for very low supply voltages the timing shifts slightly; use a low-drop Schottky if it matters.)
Same astable, R₁ small and R₂ large. Toggle the diode in and out. Without it, duty clamps at 50%+ no matter what. Add the diode and the same resistors give a duty below 50% — the long-sought blip.
Same chip, one rewire, completely different personality. In monostable ("one stable state") mode the 555 sits quietly with its output low — that is its one stable rest state — until you poke it. A trigger pulse fires a single, fixed-length output pulse, then it settles back to rest and waits. This is a one-shot: press a button, get a clean pulse of exactly the length you designed, no matter how long or bouncy the press was. Perfect for debouncing switches, timed relays, "press to start a 30-second timer," and pulse stretching.
Now there is just one resistor R from Vcc to pins 6/7, and the capacitor C from pins 6/7 to ground. Pin 2 (trigger) is held high by a pull-up and tapped by a normally-open button to ground. At rest, the discharge transistor clamps C to 0 V, output low. Press the button: pin 2 drops below ⅓Vcc, the trigger comparator sets the flip-flop, output goes high, and the transistor releases C. Now C charges through R toward Vcc. When it reaches ⅔Vcc, the threshold comparator resets the flip-flop: output snaps low, the transistor dumps C, and we are back at rest. The pulse length is whatever it took C to climb from 0 to ⅔Vcc.
Charging from 0 toward Vcc and stopping at ⅔Vcc means closing ⅔ of the gap. The exponential time to close ⅔ is τ·ln(3) = 1.0986·RC, conventionally rounded to 1.1·RC:
Notice the constant is 1.1, not 0.693. The astable legs only swing across the middle third (⅓ to ⅔, closing ½ the gap, ln(2)); the monostable swings from empty all the way to ⅔ (closing ⅔ the gap, ln(3)). Different start point, different constant — same exponential underneath.
Pick R = 15 kΩ, C = 1 µF:
Every button press — whether you tap it for 1 ms or hold it for a full second — produces one clean 16.5 ms output pulse (as long as the trigger has released before the timeout). That is the one-shot's whole value: it turns a messy human action into a precise, repeatable interval. Scale R and C up and you get long timers: R = 100 kΩ, C = 10 µF gives t = 1.1 s.
Hit Trigger to pull pin 2 below ⅓Vcc. The cap (blue) charges from 0 toward Vcc; the instant it hits ⅔Vcc the output (orange) drops and the cap resets. Output stays high for exactly 1.1·RC regardless of how the trigger was pressed.
The 555 owns the low-frequency, square-wave, "good-enough" world. But when you need a clean sine, a precise frequency, or a voltage you can tune, you reach for other circuits. They all obey the same Barkhausen rule from Chapter 1 — in-phase feedback, loop gain ≥ 1 — but set their timing differently.
A Wien-bridge uses an op-amp with an RC network in the positive-feedback path that passes exactly 0° phase shift at one frequency. At that frequency the network attenuates by exactly ⅓, so the amplifier needs a gain of +3 to satisfy Aβ = 1. The result is a low-distortion sine wave, the classic for audio test oscillators.
Example: R = 16 kΩ, C = 10 nF gives f = 1/(2π × 16{,}000 × 10×10−9) = 1/(0.001005) ≈ 995 Hz — a ~1 kHz tone.
Instead of an RC ramp, an inductor and capacitor swap energy back and forth at the tank's natural frequency — current sloshing between magnetic field and electric field, like a pendulum trading height for speed. Colpitts and Hartley topologies sustain this ring with an amplifier. LC oscillators reach radio frequencies where RC timing is too imprecise.
Example: L = 10 µH, C = 100 pF gives f = 1/(2π√(10×10−6 × 100×10−12)) = 1/(2π√(10−15)) ≈ 5.03 MHz.
A quartz crystal is a mechanical resonator that behaves like an LC tank with an absurdly high quality factor (Q in the tens of thousands). Quartz's resonance barely drifts with temperature or supply, so a crystal oscillator nails its frequency to about 0.001% — which is why every clock, microcontroller, and radio uses one. The crystal substitutes for the LC tank in an otherwise ordinary amplifier loop.
A VCO (such as the NE566) makes its output frequency a function of an input control voltage. Feed it a slowly rising voltage and the tone rises; this is the heart of FM synthesis, phase-locked loops, and frequency modulation. It is a relaxation oscillator whose charging current is set by the control voltage.
| Oscillator | Output | Timing set by | Typical stability |
|---|---|---|---|
| 555 relaxation (RC) | square | R, C charge curve | ~0.1% |
| Wien-bridge | sine | RC, gain = +3 | ~0.1% |
| LC (Colpitts/Hartley) | sine | L, C resonance | ~0.01% |
| Crystal | sine/square | quartz resonance | ~0.001% |
| VCO (NE566) | square/triangle | control voltage | tunable |
Left: an LC tank's resonance peak sharpens as Q rises — a crystal is a tank with enormous Q, hence its razor-sharp frequency. Adjust L·C to move the resonant peak and Q to sharpen it.
We started with a blinking LED and ended with the full theory of self-timing circuits. Every formula you need is in one place below.
| Quantity | Formula | Notes |
|---|---|---|
| Barkhausen criterion | Aβ ≥ 1, phase = 0° | In-phase feedback, unity loop gain |
| Op-amp square wave | T ≈ 2.2 R1C | Equal feedback resistors (thresholds ±⅓Vsat) |
| 555 astable thigh | 0.693 (R1+R2) C | Charge through R1+R2 |
| 555 astable tlow | 0.693 R2 C | Discharge through R2 only |
| 555 astable f | 1.44 / ((R1+2R2) C) | 1.44 = 1/0.693 |
| 555 astable duty | (R1+R2) / (R1+2R2) | Always > 50% without diode |
| Diode-trick thigh | 0.693 R1 C | Diode across R2 → duty can drop < 50% |
| Diode-trick duty | R1 / (R1+R2) | Separate charge / discharge paths |
| 555 monostable t | 1.10 R C | Charge 0 → ⅔Vcc, 1.1 = ln(3) |
| Wien-bridge sine f | 1 / (2π R C) | Needs amp gain +3 |
| LC resonant f | 1 / (2π √(LC)) | Colpitts, Hartley, crystal tanks |
| 555 thresholds | ⅓Vcc (trig, pin 2), ⅔Vcc (thresh, pin 6) | From the three 5 kΩ divider |
You can now pick R and C for any blink, tone, or one-shot, explain the diode trick from first principles, and choose the right oscillator for the precision you need. Next, in Chapter 11, we put these timing circuits to work chopping power.