Build the PWM Dimmer
A 555, a potentiometer and two steering diodes: smooth 0–100% LED brightness from a knob, at a frequency your eye can't see.
Builds on: 3.3 The 555 Timer4.1 Build the Blinker5.3 Impedance & RC Filters7.3 Memory & Counters
The idea: dim by blinking fast
How do you make an LED half as bright? A resistor wastes power as heat, and LEDs dim unevenly with current. The modern answer is sneakier: blink it faster than the eye can see and control the ratio. On 30% of the time → 30% brightness, with the switch (a transistor) either fully on or fully off, wasting almost nothing — the same cutoff/saturation efficiency argument from Lessons 1.4 and 3.2. This is pulse-width modulation: fixed frequency, adjustable duty cycle. Your capstone blinker at 14 Hz (the flicker-fusion experiment) was already teetering on this idea; now we push it to 1.4 kHz and add a knob.
The circuit: your blinker, upgraded
Start from the astable you already understand (Lesson 3.3) and change the timing network. The output pin itself now charges and discharges the capacitor through the two halves of a potentiometer, with two small diodes steering the traffic: charging current flows through the upper half (Ra) via D1, discharging current returns through the lower half (Rb) via D2.
Turn the knob and you slide the wiper: more Ra, less Rb — longer highs, shorter lows, same total. Duty from ~5% to ~95%, frequency rock steady. Every lesson is on stage: RC timing (2.3), the divider-as-knob (2.2), diode steering (3.1), the 555’s thresholds (3.3), and duty cycle as digital-analog bridge (Unit 7 meets Unit 5 — a low-pass filter on this output would literally turn duty into a DC voltage).
Shopping list (beyond the blinker kit)
| Part | Spec | Qty | ≈ Cost |
|---|---|---|---|
| Potentiometer | 100 kΩ linear, breadboard-friendly legs | 1 | $1.50 |
| Signal diodes | 1N4148 (glass body, black band = cathode) | 2 | $0.20 |
| Capacitor | 10 nF ceramic — marked “103”; no polarity | 1 | $0.20 |
| Reused from the blinker: breadboard, 555, 470 Ω, LED, 9 V battery + clip, jumpers. Optional: a TLC555/LMC555 (CMOS 555, ~$1) makes the duty and frequency match the math exactly; for the motor experiment: 2N2222 transistor, small DC motor, 1N4007 diode, 1 kΩ. | |||
The wiring, precisely
Strip the old timing parts (R1, R2, big capacitor) off your blinker but keep the 555, its power wiring and the LED branch. Then:
| # | From | To | With |
|---|---|---|---|
| 1 | 555 pin 8 + pin 4 | + rail | jumpers (unchanged from blinker) |
| 2 | 555 pin 1 | − rail | jumper (unchanged) |
| 3 | pin 2 | pin 6 | jumper (unchanged) |
| 4 | pin 2 | − rail | C 10 nF ceramic (“103”) — either way round |
| 5 | Potentiometer | three separate columns | all 3 legs in their own strip |
| 6 | pot middle leg (wiper) | pin 3 | jumper |
| 7 | pot outer leg A | pin 6 | D1 — band toward the 555 |
| 8 | pot outer leg B | pin 6 | D2 — band toward the pot |
| 9 | pin 3 | LED anode via 470 Ω, cathode to − rail | unchanged from blinker |
① Diode bands: D1 and D2 must point opposite ways relative to pin 6 — one band toward the chip, one toward the pot. Same direction = no oscillation. ② The wiper is the middle leg. Wire an outer leg to pin 3 by mistake and the knob does nothing.
Power up
The LED lights immediately — at 1.4 kHz it looks perfectly steady. Turn the knob: brightness glides smoothly from near-dark to full. There is no flicker to see, but there is one to hear about: wave the board (or your eyes) quickly and you’ll catch a dotted-line trail — your own flicker-fusion experiment at 1.4 kHz.
If it misbehaves
| Symptom | Likely cause | Fix |
|---|---|---|
| LED stuck at full brightness | A diode reversed, or oscillation dead | Check the two bands point opposite ways relative to pin 6 |
| Knob does nothing | Wrong pot leg on pin 3 | The middle leg is the wiper |
| Visible flicker | Wrong capacitor (µF instead of nF) | Use the ceramic “103”; your 10 µF blinker cap makes ~1.4 Hz! |
| Dead entirely | Power pins | Re-check pins 8 & 4 to +, pin 1 to − (blinker rules apply) |
Experiments
- Slow-motion PWM: swap C back to 10 µF — the dimmer becomes a blinker whose knob adjusts on/off ratio at ~1.4 Hz. PWM and blinking are the same circuit at different speeds.
- Drive a motor: pin 3 → 1 kΩ → 2N2222 base, motor from + rail to collector, flyback diode across the motor (Lesson 2.4 — the coil will kick!). The knob is now a speed control.
- PWM → analog: feed pin 3 through your Lesson 5.3 low-pass filter (10 kΩ + 1 µF, fc ≈ 16 Hz) and measure the output with a multimeter: a steady DC voltage that follows the knob. You’ve built a digital-to-analog converter.
Where you stand
You’ve now completed the core and advanced courses: from a balloon rubbing on hair to a knob-controlled switching power stage — the exact technique inside EV motor drives and phone-screen dimming. And the mountains this course kept pointing at are now on the map: the expert course starts next — resonance and radio, power electronics, and finally a microcontroller that puts your PWM under software control.
⚡ Lab — Digital Twin — the Knob Before the Build
The exact dimmer you’re about to wire, knob included.
- Sweep the knob: duty slides 5–95% while frequency pins near 1.4 kHz.
- Compare “the LED itself” (slowed strobe) with “what your eye sees”.
- Note t_high + t_low never changes — the pot is a fixed total, split two ways.