Lesson 2 of 2 in Step 4 · Switching and timing
A blinking LED with the 555 timer
By Mihai Dumitru · · · 7 min read
The 555 is an integrated circuit, a complete small circuit packed into one chip with eight legs. It has been made since the 1970s and is still one of the most used chips in hobby electronics. Its best-known use is making an LED blink. This page combines two earlier ones: how a capacitor charges and choosing a resistor for an LED.
Change the values in the tool. The LED blinks at the speed the real circuit would have.
555 blinker calculator
Set R1, R2 and the capacitor. The LED blinks at the speed the circuit would really have.
- Frequency
- 1.05 Hz
- Duty cycle
- 50%
- LED on
- 478 ms
- LED off
- 471 ms
How it works
In this circuit the 555 runs in a mode called astable, which means it never settles: it switches on and off by itself for as long as it has power. A capacitor charges through two resistors, R1 and R2. When the capacitor reaches two thirds of the supply voltage, the chip switches its output off and starts discharging the capacitor through R2 only. When the capacitor has dropped to one third of the supply, the output switches on again and the capacitor charges once more.
The output pin is on while the capacitor charges and off while it discharges. The LED connected to the output therefore blinks, and the speed depends on how long the charging and discharging take.
The timing
- On time: 0.693 × (R1 + R2) × C
- Off time: 0.693 × R2 × C
- Frequency (blinks per second, in hertz): 1 ÷ (on time + off time)
With R1 = 1 kΩ, R2 = 68 kΩ and C = 10 µF, the LED is on for about 0.48 s and off for about 0.47 s, roughly one blink per second.
The share of time the output spends on is called the duty cycle. In this basic circuit the on time always includes R1 and the off time doesn't, so the output is always on a little longer than it is off. When R2 is much larger than R1, the duty cycle gets close to 50%.
Wiring the eight pins
- Pin 1 goes to ground.
- Pin 2 (trigger) and pin 6 (threshold) are joined together and connected to the plus side of the capacitor.
- Pin 3 is the output. Connect the LED's resistor to it and the LED from the resistor to ground.
- Pin 4 (reset) goes to plus. Left unconnected, it can stop the chip at random.
- Pin 5 (control) can stay unconnected, but a 10 nF capacitor from it to ground makes the timing more stable.
- Pin 7 (discharge) connects to the point between R1 and R2.
- Pin 8 goes to plus.
- R1 goes from plus to pin 7, R2 from pin 7 to pins 6 and 2, and the capacitor from pins 6 and 2 to ground.
Common problems
- R1 too small. When the chip discharges the capacitor, pin 7 is connected to ground inside the chip. A very small R1 then lets a large current flow from plus into pin 7. Keep R1 at 1 kΩ or more.
- No LED resistor. The output can deliver more current than an LED should get, so the LED still needs its resistor.
- It seems to stay on. Above about 20 blinks per second, the eye sees a steady light. Use a larger capacitor or larger resistors to slow it down.
- The capacitor is reversed. An electrolytic capacitor's minus stripe goes to ground.
Variations
Replacing R2 with a potentiometer in series with a small fixed resistor gives a blink speed you can adjust with a knob. With a much smaller capacitor, the 555 switches hundreds of times per second, and a small speaker or piezo sounder on the output plays a tone instead of blinking a light.
Check yourself
With R1 = 1 kΩ, R2 = 68 kΩ and C = 10 µF, how long is the LED on?
Show the answer
On time = 0.693 × (1,000 + 68,000) × 0.00001 = 0.48 s.
And how long is it off?
Show the answer
Off time = 0.693 × 68,000 × 0.00001 = 0.47 s. Together that is about 0.95 s, roughly one blink per second.
Which part would you change to make the LED blink twice as fast?
Show the answer
Halve the capacitor, for example from 10 µF to 4.7 µF, which roughly halves both times. Halving R2 has nearly the same effect.
Why is the output always on a little longer than it is off in this circuit?
Show the answer
The on time depends on R1 + R2, while the off time depends on R2 alone. The difference is R1, so making R1 small compared with R2 brings the duty cycle close to 50%.