class: center, middle, inverse, title-slide .title[ # The 555 Timer — Astable Mode ] .subtitle[ ## Programmable Electronics — Unit 2 ] .date[ ### Appendix — optional depth for Class 12 ] --- # Learning Targets .lt-box[ - Explain how the 555 turns an RC charging curve into a square wave that repeats on its own, using its two comparators and internal latch. - Locate the 555's pinout, supply-voltage range, and output-current limit in the datasheet. - Wire a 555 as an astable oscillator and calculate its frequency and duty cycle from `\(R_A\)`, `\(R_B\)`, and `\(C\)`. - Predict how changing a resistor or the capacitor changes the output, then confirm it by measurement. ] .eu-label[Essential Understanding:] The RC circuit from Class 8 does its job once — then someone has to flip the input again. The 555 wraps that same capacitor in a comparator and a latch that flip the input *for* you. A one-shot curve becomes a clock that ticks forever. You give up direct sight of the capacitor and get a repeating signal you can design with a formula. --- # Agenda .agenda-box[ 1. Recap: an RC curve happens once 2. What the 555 is — the 8-pin workhorse 3. Inside the box: two comparators and a latch 4. The astable circuit: `\(R_A\)`, `\(R_B\)`, `\(C\)` 5. The timing equations, and a worked example 6. Quick check 7. **Build (30+ min):** a 555 that blinks — then make it faster, then lopsided 8. Wrap-up ] --- # Recap: an RC curve happens once - Class 8: a resistor feeding a capacitor gives a predictable charging curve — time constant `\(\tau = RC\)`. Flip the supply to ground and it discharges on the same kind of curve. - But it does that **once**. To get a *repeating* signal — a blink, a beep, a clock tick — something has to keep flipping the input between the supply and ground. - Today: a chip that does the flipping for you, at a rate you set with **one resistor pair and one capacitor**. --- # The 555 timer .pull-left.w42[ <img src="assets/schematics/timer-555-pinout.svg" alt="555 timer as an 8-pin DIP: pin 1 GND, 2 TRG, 3 OUT, 4 RST, 5 CTL, 6 THR, 7 DIS, 8 Vcc" style="width:100%;max-height:330px;"/> ] .pull-right.w54[ - An **8-pin DIP**, in production since 1972 — one of the most-manufactured chips ever made. - Give it a supply and three timing parts and it produces clean on/off pulses. - Two modes: **astable** — a free-running square wave (today) — and **monostable** — one pulse each time it's triggered (next class). - The pins you'll wire: **Vcc, GND, DIS** (discharge), **THR** (threshold), **TRG** (trigger), **OUT**, **RST** (reset), **CTL** (control). Read them off the datasheet. - Pin 1 sits next to the notch; numbering runs counter-clockwise. ] --- class: small-font # Inside the box .pull-left.w46[ <svg viewBox="0 0 380 300" width="100%" style="max-height:330px;"> <rect x="70" y="10" width="250" height="280" fill="none" stroke="#999" stroke-width="1.5" stroke-dasharray="5,4"/> <text x="195" y="28" font-size="12" text-anchor="middle" fill="#999">inside the 555</text> <!-- internal divider --> <line x1="300" y1="45" x2="300" y2="255" stroke="#333" stroke-width="2"/> <rect x="293" y="55" width="14" height="34" fill="none" stroke="#333" stroke-width="2"/> <rect x="293" y="123" width="14" height="34" fill="none" stroke="#333" stroke-width="2"/> <rect x="293" y="191" width="14" height="34" fill="none" stroke="#333" stroke-width="2"/> <text x="312" y="48" font-size="11" fill="#333">+Vcc</text> <text x="312" y="115" font-size="11" fill="#364F6B">⅔ Vcc</text> <text x="312" y="183" font-size="11" fill="#364F6B">⅓ Vcc</text> <text x="312" y="258" font-size="11" fill="#333">GND</text> <!-- upper comparator --> <polygon points="150,95 195,110 150,125" fill="none" stroke="#333" stroke-width="2"/> <text x="140" y="102" font-size="11" text-anchor="end" fill="#333">THR +</text> <line x1="293" y1="110" x2="197" y2="110" stroke="#364F6B" stroke-width="1.6"/> <text x="150" y="138" font-size="10" fill="#999">−</text> <!-- lower comparator --> <polygon points="150,175 195,190 150,205" fill="none" stroke="#333" stroke-width="2"/> <text x="140" y="182" font-size="11" text-anchor="end" fill="#333">TRG −</text> <line x1="293" y1="208" x2="197" y2="190" stroke="#364F6B" stroke-width="1.6"/> <text x="150" y="172" font-size="10" fill="#999">+</text> <!-- latch --> <rect x="215" y="130" width="55" height="45" fill="none" stroke="#333" stroke-width="2"/> <text x="242" y="157" font-size="11" text-anchor="middle" fill="#333">latch</text> <line x1="195" y1="110" x2="215" y2="140" stroke="#333" stroke-width="2"/> <line x1="195" y1="190" x2="215" y2="165" stroke="#333" stroke-width="2"/> <!-- outputs --> <line x1="270" y1="145" x2="340" y2="145" stroke="#333" stroke-width="2"/> <text x="344" y="149" font-size="11" fill="#333">OUT</text> <line x1="242" y1="175" x2="242" y2="240" stroke="#333" stroke-width="2"/> <circle cx="242" cy="250" r="10" fill="none" stroke="#333" stroke-width="2"/> <text x="228" y="254" font-size="9" text-anchor="end" fill="#333">DIS</text> <text x="242" y="277" font-size="9" text-anchor="middle" fill="#999">discharge</text> <!-- external cap --> <line x1="20" y1="103" x2="120" y2="103" stroke="#364F6B" stroke-width="1.6"/> <line x1="20" y1="183" x2="120" y2="183" stroke="#364F6B" stroke-width="1.6"/> <line x1="30" y1="103" x2="30" y2="183" stroke="#364F6B" stroke-width="1.6"/> <line x1="18" y1="150" x2="42" y2="150" stroke="#333" stroke-width="3"/> <line x1="18" y1="160" x2="42" y2="160" stroke="#333" stroke-width="3"/> <text x="8" y="145" font-size="11" fill="#364F6B">C</text> </svg> ] .pull-right.w50[ - Three equal resistors inside the chip mark two levels: **⅓ Vcc** and **⅔ Vcc**. - Two **comparators** watch the timing capacitor's voltage against those marks. - Reach **⅔ Vcc** → the upper comparator flips the **latch**: OUT goes **low**, and the **discharge** pin connects to ground, draining `\(C\)`. - Fall back to **⅓ Vcc** → the lower comparator flips the latch the other way: OUT goes **high**, discharge releases, `\(C\)` charges again. - The capacitor voltage sawtooths between ⅓ and ⅔ Vcc **forever**. OUT is high while it charges, low while it discharges. ] --- class: small-font # The astable circuit .pull-left.w44[ <img src="assets/schematics/timer-555-astable.svg" alt="555 astable: R_A from +6 V to the discharge pin, R_B from the discharge pin to the trigger/threshold node, C from that node to ground, OUT through a resistor to an LED" style="width:100%;max-height:370px;"/> ] .pull-right.w52[ - **Charge path:** +6 V → `\(R_A\)` → `\(R_B\)` → into `\(C\)`. - **Discharge path:** `\(C\)` → `\(R_B\)` → DIS pin → ground — `\(R_A\)` **is not in it.** - So `\(C\)` charges through `\((R_A + R_B)\)` but discharges through `\(R_B\)` alone: the charging half is always slower. OUT is **high** while charging (`\(t_{high}\)`), **low** while discharging (`\(t_{low}\)`). - **TRG and THR tied together** — both comparators watch the same capacitor. - **RST** → +6 V (never reset). **CTL** → 0.01 µF to ground (keeps noise off the ⅔ Vcc mark). - OUT drives the LED **directly** — the 555 sources far more current (~200 mA) than a logic-gate output or an Arduino pin (~20 mA). ] --- # The timing equations `$$t_{high} = 0.693\,(R_A + R_B)\,C \qquad t_{low} = 0.693\,R_B\,C$$` `$$f = \frac{1}{t_{high} + t_{low}} = \frac{1.44}{(R_A + 2R_B)\,C}$$` - The **0.693** is `\(\ln 2\)`. It falls out of charging an RC network from ⅓ of the way to the supply up to ⅔ of the way. You don't derive it here — you use it. - **Duty cycle** = the fraction of each cycle OUT is high: `$$D = \frac{R_A + R_B}{R_A + 2R_B}$$` - In this circuit `\(D\)` is **always more than 50%** — OUT is high longer than it is low. Want it closer to 50/50? Make `\(R_A\)` small next to `\(R_B\)`. --- # Worked example `\(R_A = 10\ \text{k}\Omega\)`, `\(R_B = 100\ \text{k}\Omega\)`, `\(C = 10\ \mu\text{F}\)`: `$$t_{high} = 0.693\,(10\text{k} + 100\text{k})(10\,\mu\text{F}) = 0.693 \times 110{,}000 \times 10^{-5} \approx 0.76\ \text{s}$$` `$$t_{low} = 0.693\,(100\text{k})(10\,\mu\text{F}) \approx 0.69\ \text{s}$$` `$$f \approx \frac{1}{0.76 + 0.69} \approx 0.69\ \text{Hz} \qquad D = \frac{110\text{k}}{210\text{k}} \approx 52\%$$` A slow blink you can count — on for about three-quarters of a second, off for about the same. --- # Quick check Reason from the equations — no calculator needed: 1. Which pin does the LED (through its resistor) connect to? 2. You **double `\(C\)`** (swap 10 µF for ~22 µF). What happens to the blink rate? 3. You **double `\(R_A\)`** and leave `\(R_B\)` and `\(C\)` alone. What happens to `\(t_{high}\)`? To `\(t_{low}\)`? To the duty cycle? 4. Someone's 555 blinks, but OUT sits high about **90%** of each cycle. Which resistor is far too large relative to the other? Talk it over with your partner before the build. --- class: center, middle # Build (30+ min): a 555 that blinks Then make it faster. Then make it lopsided. --- class: small-font # Build instructions Partner up. Breadboard, 6 V pack, one **555**, multimeter, an LED, and from the kit: a **0.1 µF ceramic**, a **10 µF** and a **4.7 µF** electrolytic, resistors (**10 kΩ, 100 kΩ, 220 kΩ, 470 Ω**). 1. Straddle the 555 across the center trench. Find **pin 1** from the notch/dot and the datasheet. Put the **0.1 µF ceramic straight across the Vcc and GND pins**, right at the chip — the decoupling habit from this unit. 2. Wire the astable circuit from this deck: `\(R_A = 10\ \text{k}\Omega\)` (Vcc→DIS), `\(R_B = 100\ \text{k}\Omega\)` (DIS→THR), `\(C = 10\ \mu\text{F}\)` from the THR node to ground — **watch polarity**, short leg to ground. Tie **TRG to THR**. Tie **RST to Vcc**. A 0.01 µF (or spare 0.1 µF) from **CTL to ground**. 3. **LED + 470 Ω** from **OUT** to ground. Power up — a slow blink. 4. **Measure it.** Count blinks over 30 s and divide. Work out `\(f\)` from your *actual* `\(R\)` and `\(C\)` values. Within ~15%? If not, walk the Debug Ladder — measure the supply rail first. 5. **Predict, then swap:** replace the 10 µF with the **4.7 µF**. The rate should go up by about 2×. Count blinks over 30 s again and check. 6. **Predict, then swap:** 10 µF back in; now replace `\(R_A\)` (10 kΩ) with **220 kΩ**. The formula says `\(t_{high}\)` grows a lot and `\(t_{low}\)` barely moves. Watch the LED — it should now sit **on far longer than off**. Time each half with a stopwatch. --- class: center, middle # Wrap-up — in your notebook .hw-box[ - The Unit 2 milestone is a traffic-light controller. Sketch how a 555 astable could be its **clock**. Roughly what `\(R\)` and `\(C\)` would give a **2-second period**? Show the calculation. - One or two sentences: the 555 hides the capacitor's voltage from you and hands you a clean square wave instead. **What did you give up, and what did you gain?** (One of the course's essential questions.) - Bring your Class 8 notebook page with the RC curve on it — next class we put the 555's sawtooth right next to it. ]