The 555 timer has been in production since the early 1970s and is still one of the most useful chips you can buy. With two resistors and a capacitor it flashes an LED, makes a tone, or produces a single timed pulse. No code needed.
What's inside
The 555 contains two comparators, a flip-flop, a discharge transistor and three equal resistors that set two reference voltages: ⅔ of the supply and ⅓ of the supply. Everything it does comes from charging a capacitor through resistors and watching its voltage:
- When the TRIGGER pin falls below ⅓ VCC, the output goes high and the discharge transistor turns off.
- When the THRESHOLD pin rises above ⅔ VCC, the output goes low and the discharge transistor turns on, emptying the capacitor.
The pins
| Pin | Name | What it does |
|---|---|---|
| 1 | GND | 0 V |
| 2 | TRIG | Starts a cycle when it goes below ⅓ VCC |
| 3 | OUT | The output |
| 4 | RESET | Active low; tie to VCC if unused |
| 5 | CONT | Control voltage (the ⅔ point); usually 10 nF to ground |
| 6 | THRES | Ends the high output when it goes above ⅔ VCC |
| 7 | DISCH | Discharge transistor, connects to the timing capacitor network |
| 8 | VCC | Supply: 4.5 to 16 V for the NE555 |
Astable: a free-running oscillator
In astable mode the 555 flips back and forth on its own. Resistor R1 goes from VCC to pin 7, R2 from pin 7 to pins 6 and 2 (joined), and the capacitor C from pins 6 and 2 to ground. The capacitor charges through R1 + R2 and discharges through R2 only:
thigh = 0.693 × (R1 + R2) × C
tlow = 0.693 × R2 × C
f = 1.44 ÷ ((R1 + 2 × R2) × C)
Worked example: R1 = 1 kΩ, R2 = 47 kΩ, C = 10 µF.
- thigh = 0.693 × 48,000 × 0.00001 = 0.333 s
- tlow = 0.693 × 47,000 × 0.00001 = 0.326 s
- f = 1.52 Hz, with a duty cycle of 50.5%. A gentle flash, about one and a half times a second.
Because thigh includes R1 and tlow doesn't, the high time is always the longer one in this basic circuit. Keeping R1 small compared with R2 gets you close to 50%. Try different values in our 555 timer calculator and watch the waveform in the 555 timer lab.
Monostable: a one-shot timer
In monostable mode the output sits low until you pull TRIGGER low briefly, for example with a push button to ground (with a pull-up resistor on pin 2). The output then goes high for a fixed time and drops back:
t = 1.1 × R × C
With R = 100 kΩ and C = 100 µF: t = 1.1 × 100,000 × 0.0001 = 11 seconds. Handy for a "lights stay on for a while" circuit or a debounced button.
NE555 or CMOS 555?
| NE555 (bipolar) | TLC555 (CMOS) | |
|---|---|---|
| Supply range | 4.5 to 16 V | 2 to 15 V, so it runs from 3.3 V |
| Supply current | Milliamps | Far lower: better for batteries |
| Output drive | Strong: up to about 200 mA | Weaker: use a transistor for heavy loads |
| Supply glitches | Large current spikes at each switch | Much smaller |
Common mistakes
- Leaving RESET floating. Tie pin 4 to VCC, or the timer may stop at random.
- No decoupling capacitor. The bipolar NE555 pulls a current spike every time it switches. Fit a 100 nF capacitor across pins 8 and 1, close to the chip, plus a larger electrolytic on the supply.
- Timing far from the formula. Electrolytic capacitors are often −20% to +20% or worse, and leak, so long timings drift. Use film capacitors for accurate timing, or trim R.
- Driving relays or motors directly. Even the NE555's output needs a flyback diode across an inductive load, and a transistor for anything above its rating. See relays explained.
Going deeper
Where 0.693 and 1.1 come from
A capacitor charging through R towards VCC follows v(t) = VCC(1 − e−t/RC). In astable mode it swings between ⅓ and ⅔ of VCC. Charging from ⅓ to ⅔ takes t = RC × ln((VCC − ⅓VCC) ÷ (VCC − ⅔VCC)) = RC × ln 2 ≈ 0.693 RC, and discharging from ⅔ to ⅓ also takes RC × ln 2. In monostable mode it charges from 0 to ⅔, which takes RC × ln 3 ≈ 1.0986 RC, rounded to 1.1. These ratios don't depend on VCC, which is why the 555's timing is so stable as the supply changes.
Getting below 50% duty
Put a diode across R2 (anode at pin 7, cathode at pins 6 and 2). The capacitor then charges through R1 and the diode and discharges through R2, so thigh ≈ 0.693 × R1 × C and tlow = 0.693 × R2 × C, and any duty cycle is possible. The diode's forward voltage makes the charging time slightly longer than the formula, especially at low supply voltages.
Using the control pin
Pin 5 sits at ⅔ VCC through the internal resistors. Driving it with another voltage moves both thresholds, which changes the frequency (in astable mode) or the pulse width (in monostable). That's how a 555 makes a voltage-controlled oscillator or a simple pulse-width modulator.
Limits on component values
Very large resistors let the comparator input currents and capacitor leakage upset the timing; very small ones make the discharge transistor sink a large current. As a working rule, keep timing resistors between about 1 kΩ and 1 MΩ, and for long delays use a larger capacitor rather than a resistor of many megohms.
Sources
The main references behind this guide. Numbers we worked out ourselves, such as the code outputs, come from running the code.