class: center, middle, inverse, title-slide .title[ # One Shot — and Building Operation ] .subtitle[ ## Programmable Electronics — Unit 2 ] .date[ ### Class 13 ] --- # Learning Targets .lt-box[ - Explain the difference between a 555 that free-runs and one that fires once, in terms of where the trigger comes from. - Wire a 555 as a monostable and predict its pulse length from `\(R\)` and `\(C\)`. - Describe what happens when a one-shot is triggered again mid-pulse, or held down — and why. - Wire two timers so that one controls the other, and describe each one's job in a sentence. - Size a series resistor so a speaker doesn't ask a chip for more current than it has. ] .eu-label[Essential Understanding:] Last class the 555 ran forever whether you liked it or not. Today you take the trigger away from the capacitor and give it to a person — and then to *another timer*. The last build is two timers doing one job each, wired together — and it happens to be the game Operation. That's not a coincidence dressed up as a lesson: one block deciding *how long* and another deciding *what happens* is how everything from here to the end of the course gets designed. --- # Agenda .agenda-box[ 1. Recap: it never stops 2. Move one wire — the one-shot 3. How long? `\(t = 1.1RC\)` 4. **Build 1:** one second, then half a minute 5. **Build 2:** two experiments, no rewiring 6. Two timers in one package — the 556 7. Why the speaker needs a resistor 8. **Build 3:** Operation 9. Your game, your story — and open house 10. Homework ] --- # Recap: it never stops Last class you built the astable and made it faster, slower, and light-sensitive. But notice what you could never make it do: - **Start when you say so.** It starts when the battery goes on. - **Do something once.** Every blink is followed by another blink. - **Stop.** That's fine for a clock. It's useless for "when someone presses this button, turn the light on for five seconds." .emphasis-center[ Same chip. **One wire moves.** ] --- class: small-font # The one-shot .pull-left.w46[ <img src="assets/schematics/timer-555-monostable.svg" alt="555 monostable: R from +6 V to the tied THR and DIS pins, C from that node to ground, TRG held high by a 10 kilohm pull-up with a pushbutton to ground, OUT through 470 ohm to an LED" style="width:100%;max-height:340px;"/> ] .pull-right.w50[ Compare it to last class's schematic. Three differences, and that's all: - **THR (6) and DIS (7) are tied together**, with **one resistor R** from there up to +6 V and C from there down to ground. *(Last class those pins were separate, with two resistors.)* - **TRG (2) is no longer tied to THR.** It's yours now. - **TRG sits HIGH** through a 10 kΩ **pull-up**, and a **pushbutton** drags it down to ground. **At rest:** OUT is LOW and stays there. It has one resting state — **mono**-stable. **Press the button:** OUT snaps HIGH, stays high for a length of time you chose, then drops back on its own and waits for the next press. ] --- # How long? `$$t = 1.1 \times R \times C$$` One resistor, one capacitor, one multiplication. Compare to last class's formula — this one is *easier*, because there's only one resistor to worry about. **Example.** `\(R = 100\ \text{k}\Omega\)`, `\(C = 10\ \mu\text{F}\)`: `$$t = 1.1 \times 10^5 \times 10^{-5} = 1.1\ \text{seconds}$$` **Want longer?** Make either one bigger. `\(R = 100\ \text{k}\Omega\)` with `\(C = 220\ \mu\text{F}\)`: `$$t = 1.1 \times 10^5 \times 2.2\times10^{-4} \approx 24\ \text{seconds}$$` .font-small[ Same unit anchor as last class: `\(1\,\text{k}\Omega \times 1\,\mu\text{F} = 1\,\text{ms}\)`, so `\(100\,\text{k}\Omega \times 10\,\mu\text{F} = 1\,\text{second}\)`. ] --- class: center, middle # Build 1: one second, then half a minute --- class: small-font # Build 1 (12 min): the one-shot **Don't tear down last class's board — rewire it.** You need: your 555, a **100 kΩ** and a **10 kΩ**, a **10 µF** and a **220 µF** electrolytic, a **pushbutton**, LED + **470 Ω**, and the 0.1 µF decoupling cap already on the board. .pull-left.w40[ <img src="assets/schematics/timer-555-monostable.svg" alt="555 monostable: R from +6 V to the tied THR and DIS pins, C from that node to ground, TRG held high by a 10 kilohm pull-up with a pushbutton to ground, OUT through 470 ohm to an LED" style="width:100%;max-height:300px;"/> ] .pull-right.w56[ 1. **Power off.** Take out R<sub>A</sub> entirely. **Join THR (6) and DIS (7)** — same breadboard row. 2. From that joined row: **R = 100 kΩ up to +6 V**, and the **10 µF down to ground** (striped leg to ground). 3. **Untie TRG (2) from THR.** Give it its own row: **10 kΩ up to +6 V**, and the **pushbutton down to ground**. 4. Leave RST → +6 V, the CTL cap, the decoupling cap and the LED on OUT (3) exactly as they are. 5. Power up. The LED should be **off and staying off.** Press and release — it lights about a second, then goes out by itself. **Time it** against your calculated 1.1 s. 6. **Predict, then swap** the 10 µF for the **220 µF**. Work out the new time first, then press, **start a stopwatch and carry on with Build 2** — come back and check. ] .font-small[ **Nothing happens when you press?** Check TRG really is untied from THR, and that the button goes to **ground**, not +6 V. **Light comes on by itself?** Your pull-up is missing. ] --- class: small-font # Build 2 (5 min): two experiments, no rewiring Put the 10 µF back so you're at ~1.1 seconds again. Now try these and **write down what happens** — both results are worth knowing. .pull-left.w48[ **Experiment A — press it again mid-pulse.** Press the button. While the LED is still lit, press it again. And again. *Does the pulse restart? Get longer? Ignore you?* ] .pull-right.w48[ **Experiment B — hold it down.** Press and **keep holding** for five seconds, then let go. *When does the LED go out — after 1.1 s, or when you release?* ] .emphasis[ Then explain both. The chip is not being clever; in each case it's doing the simple thing. What is it? ] .font-small[ **A bonus you got for free:** a pushbutton doesn't make one clean contact — the metal **bounces**, connecting and disconnecting several times in the first millisecond. Your circuit ignored every bounce after the first, because of exactly the behaviour you just found in Experiment A. Remember this. In Unit 3 you'll press a button into a microcontroller, which has no such protection, and you will see every single bounce. ] --- class: small-font # Two timers in one package .pull-left.w50[ There's a second chip in your kit you haven't touched: the **556**. It is **two complete 555s in one 14-pin package**, sharing only the power pins. Two of everything else — two TRGs, two OUTs, two sets of timing pins. Which raises the obvious question: **what would you do with two?** ] .pull-right.w46[ .emphasis[ Give each one **one job**, then wire the first one's output to the second one's **RESET** pin. ] Hold RESET low and a 555 is switched off — frozen, output dark and silent. Let it go high and the timer runs. So: **timer A decides *when* and *for how long*. Timer B decides *what happens* during that time.** ] .center[ Build that, and you've built **Operation**. ] --- class: small-font # Operation — the circuit you're building .center[ <img src="assets/schematics/operation-game.svg" alt="Two 555 timers side by side: timer A wired as a monostable triggered by a wire loop and ring, driving a caught LED and timer B's reset pin; timer B wired as an astable at about 690 Hz driving a speaker through a 100 ohm resistor" style="width:96%;max-height:315px;"/> ] .pull-left.w48[ - **A** is your Build 1 one-shot. Only the **trigger** changed — a wire loop instead of a button. - **B** is last class's blinker with a **0.01 µF ceramic** in place of the electrolytic. Same circuit, 1000× faster: too fast to see, exactly right to hear. ] .pull-right.w48[ - **A's output does two jobs at once** — lights the "caught" LED, *and* releases B's reset so the speaker buzzes for exactly as long. - **100 Ω in series with the speaker.** Not optional — next slide. - Keep touching and it keeps buzzing. You found out why in Build 2. ] --- # Why the 100 Ω matters .pull-left.w50[ A speaker coil is about **8 Ω**. Put that straight across a 6 V output and Ohm's law says: `$$I = \frac{6\ \text{V}}{8\ \Omega} = 750\ \text{mA}$$` The 555 can supply **200 mA**. You would be asking it for nearly four times what it has. ] .pull-right.w46[ With **100 Ω** in series: `$$I = \frac{6\ \text{V}}{108\ \Omega} \approx 56\ \text{mA}$$` Comfortably inside the limit, and still plenty loud for a classroom. .font-small[ This is the same calculation you did in Class 2 to size an LED resistor. Different part, identical reasoning — and this time skipping it costs you a chip. ] ] --- class: small-font # Build 3 (20 min): Operation Swap the **555 for the 556** — a 14-pin chip, so read its pinout first. Each half has its own TRG, OUT, RST, THR, DIS and CTL; pins **7 (GND)** and **14 (+6 V)** are shared. Parts: **220 kΩ, 100 kΩ, 10 kΩ, 470 Ω, 100 Ω**, a **10 µF** electrolytic, a **0.01 µF** ceramic, an LED, the **speaker**, **0.1 µF** decoupling, and stiff wire. 1. **Power off.** Seat the 556 across the trench, pin 1 at the notch. **0.1 µF across pins 14 and 7.** 2. **Build timer A as a one-shot** on A's pins — 220 kΩ from A's joined THR/DIS up to +6 V, **10 µF** down to ground, 10 kΩ pull-up on A's TRG. Instead of a button, run **two wires** from TRG and from ground; touching them together is your trigger. 3. **LED + 470 Ω from A's OUT to ground. Test A alone:** touch the wires, the LED holds for about 2.4 seconds. *Don't move on until this works.* 4. **Build timer B as an astable** on B's pins — 10 kΩ, 100 kΩ, and the **0.01 µF** ceramic, B's TRG tied to B's THR. **Speaker + 100 Ω** from B's OUT to ground. **Tie B's RST to +6 V** for now and check you get a steady tone. 5. **Now the one wire.** Take B's RST **off** +6 V and connect it to **A's OUT** instead. 6. Power up. Silence. **Touch the wires** — LED and buzz together, then both stop. 7. **Now make it a game.** Bend stiff wire into a wiggly course, make a ring or use tweezers, and run it end to end without getting caught. Fastest clean run wins. 8. **Tune it.** A harsher penalty: swap A's 10 µF for the **47 µF**. A more annoying pitch: try a smaller ceramic in B. --- class: small-font # Your game, your story .pull-left.w50[ The circuit is finished, and it is **the same for every group**. What you build around it is not. Operation is a patient on an operating table — but that's a *choice somebody made*. The electronics would work exactly the same if it were anything else. **Pick a story and build the thing.** **The next two classes are yours to build it in**, with materials supplied: cardboard, duct tape, craft sticks, foil, hot glue, string, paint. **The loop and the ring are the only parts that have to be metal.** .font-small[ A surgeon. An archaeologist lifting a relic without touching the rim. A jewel thief and a laser grid. Threading a needle. Docking a spacecraft. A dentist with unsteady hands. Yours will be better than this list. ] ] .pull-right.w46[ .emphasis[ **This gets shown at open house.** ] Strangers will play it — including small children, who are rough, impatient, and will not read a sign. **Four rules:** 1. **It works** — all evening, not just once on your desk. 2. The **course is separate from the breadboard**, joined by two long leads. Nobody's hand goes near your wiring. 3. A visitor gets it in **ten seconds, without you saying anything.** 4. You can **explain every wire** when someone asks. ] --- class: center, middle # Homework .hw-box[ - In Operation, **which timer decides how long the penalty lasts, and which decides what it sounds like?** One sentence each. - You want a **3-second** penalty at a **lower, angrier pitch**. Give the R and C for both halves. You may reuse values from today. - Your speaker is 8 Ω and you used 100 Ω in series. **What current flows?** What would happen with 10 Ω instead — and roughly how much louder would it be before something gave out? - Experiment B (holding the button down) is why Operation keeps buzzing while you hold the wires together. **Name one other device where that behaviour is what you'd want**, and one where it would be a bug. - **Sketch your game — bring it next class.** What's the story? What does the course look like? What will you need? One page, drawing encouraged. You'll pitch it in 90 seconds. - Anything from home that would make your game better — a shoebox, an old toy, a picture — bring that too. Everything else is supplied. ]