Level 3 · Sense · project 4 of 12 · 25 min · ●●●○○
Trip Wire Alarm
A thin wire across a doorway holds the alarm silent. Break the wire and the buzzer screams — until you connect it back.
new here? Start with First Light — one battery, one resistor, one LED. It teaches the loop, LED direction, and why the 220 Ω resistor matters.
What you need
- 1× 3×AA battery pack (4.5 V) L1
- 1× Solderless breadboard L1
- 6× Jumper wires one long one becomes the trip wire itself L1
- 1× 10 kΩ resistor the "pull-up" — keeps the base held high whenever the trip wire is broken L1
- 1× Slide switch stands in for the trip wire during testing (closed = wire intact, open = wire cut) L1
- 1× NPN transistor (2N2222) flat face toward you: legs are E-B-C
- 1× Active buzzer (3–5 V) L2
you'll learn: Transistor switching · Switches · Ohm's law
Circuit map
The circuit you'll build, running on the Workbench right now — shown with the switch opened.
simulating…
If it doesn't work
The boring ways this circuit actually breaks — check these first before you unwire everything.
- Buzzer screams even with the 'wire' intact. Pull-up 10 kΩ isn't wired to +. Its job is to hold the base HIGH whenever the trip wire is broken; the closed slide pulls the base LOW to −.
- Buzzer stays silent when you 'break' the wire. 2N2222 pins E-B-C (flat face toward you). Then confirm the pull-up 10 kΩ actually connects the base to +.
- Nothing at all. Battery pack switch, then trace the buzzer lane from + through the transistor's collector.
- Beep is weak. Someone put a 220 Ω in the buzzer lane. Remove it — buzzers run raw.
- Alarm triggers on its own. Long jumper standing in for the trip wire is loose. Push both ends firmly, or shorten it.
What you're building
Stretch a thin wire across a doorway, tie both ends to a little box on the floor, and arm it. As long as the wire is intact, the box is silent. Snap the wire — a foot walking through, a door opening, a sibling sneaking in — and the buzzer wails until you either reconnect the wire or unplug the battery.
Alarms in real houses work exactly this way: a normally-closed sensor (door contact, window magnet, wire loop) holds the alarm silent, and "loss of connection" is the trigger. That feels backwards at first. A connected wire usually makes something happen. Here you'll see why engineers build alarms this way, and how that changes safety-critical circuits.
The big idea: normally-closed is safer than normally-open
Compare this to the Door Buzzer. That circuit was normally open: no button press, no beep. If the button's wire quietly fell off in the night, the doorbell just wouldn't ring — and you'd never know until you tried it.
This project is normally closed: the trip wire holds the alarm silent. If anything at all goes wrong — the wire is cut, a solder joint fails, the battery gets bumped and jiggles the loop apart — the alarm goes off. Silence means "everything is fine and the sensor is connected". A scream means "either someone crossed the wire OR something is broken; either way, come look".
Every burglar alarm, refrigerator door switch, and safety interlock on every microwave oven uses the same trick. Failure sounds the alarm.
Meet the pull-up resistor
Here's the new pattern that makes this work. In Automatic Night Light and Sunrise Alarm, a voltage divider set the transistor's base voltage based on how bright the room was. This time we do it with just one resistor plus a switch to ground.
- The 10 kΩ resistor connects battery + to the transistor's base leg. Engineers call this a pull-up because it pulls the base voltage up toward the battery.
- The trip wire (represented by the slide switch during testing) connects the same base leg to battery −. When the wire is intact, it drags the base down to 0 V — the pull-up loses the tug-of-war because the wire is a much lower resistance path.
Do the math
- Trip wire intact (switch closed): the wire is essentially a direct path to −. Base voltage sits at essentially 0 V, far below the transistor's 0.7 V wake-up line. Transistor off. Buzzer draws about 0 mA (a microamp of leakage at most). Silent.
- Trip wire cut (switch open): now the only path to the base is through the 10 kΩ pull-up. Current pours into the base until the base sits at its usual 0.7 V wake-up voltage. Ohm's law tells us how much: I_base = (4.5 V − 0.7 V) ÷ 10 kΩ = 0.38 mA.
- That 0.38 mA into the base amplifies, at roughly β = 200, into a potential 76 mA at the collector. But the buzzer only wants 30 mA — so the transistor saturates: it turns fully on, its collector-to-emitter drop shrinks to about 0.2 V (V_CE(sat)), and the buzzer sees 4.5 − 0.2 = 4.3 V. Straight from Ohm's law: I_buzzer = 4.3 ÷ 150 = 28.7 mA. Loud.
- Battery draw when armed and quiet: about 0.45 mA — that's the 4.5 V ÷ 10 kΩ flowing down the pull-up and out through the intact wire. The buzzer's current is essentially zero. At 0.45 mA a set of AAs lasts months armed, and you only spend real battery when it fires.
That low standby current — about 450 µA, not zero — is a real perk of the normally-closed pattern. The Cookie Jar Alarm's voltage divider draws a similar trickle in the dark; this one draws its 450 µA while armed, then about 29 mA when it goes off.
Build it
- Power rails: battery + to one row on the breadboard, battery − to another. Same as always.
- The pull-up: run a 10 kΩ resistor from the + rail down to a fresh middle row — call this the base node.
- The trip wire (slide switch for now): put the slide switch between the base node and the − rail. When the switch is closed, the trip wire is intact; when open, the trip wire is cut.
- The transistor: flat face toward you, legs E-B-C from left to right. Base node → Base (middle leg). Emitter (left) to the − rail.
- The output lane: battery + → buzzer + leg; buzzer − leg to Collector (right leg). No resistor needed on this lane — the buzzer limits itself, same rule as the Door Buzzer.
- Arm it: close the slide switch. Silence. Now slowly slide it open — the moment the contacts break, BZZZT. Close it again and the alarm goes silent instantly.
Deploy the trip wire
Once the breadboard version works, retire the slide switch and use a real trip wire:
- Take your longest piece of thin, uninsulated wire (a strand of copper from a scrap piece of stranded jumper works). This is your trip wire.
- Tie one end of the trip wire to a new jumper running to the base node; tie the other end to a jumper running to the − rail. Now you've replaced the slide switch with the trip wire itself.
- Stretch the trip wire across a doorway at ankle height, taped to the door frames on both sides. Any solid pull snaps it — no soldering required to arm the next round, just tie a new piece.
Where this pattern goes next
The pull-up is a Level 3 concept but it never goes away. At Level 7
(Code), every digital input pin on an Arduino uses an internal pull-up
resistor exactly like this one — you turn on a built-in 20 kΩ
pull-up with a single line of code, and any switch to ground becomes a
readable input. The line you'll write is pinMode(2, INPUT_PULLUP);,
and now you understand what it's actually building for you.
🧠 Your challenge
No single right answer. That's the point.
- Loud + visible. Add an LED (with a 220 Ω resistor) in parallel with the buzzer, both hanging off the collector, so the alarm flashes as well as beeps. Roughly how much total current is the battery supplying when it fires? (Add the buzzer lane and the LED lane — same trick as the Door Buzzer.)
- A quieter pull-up. Swap the 10 kΩ pull-up for a 1 kΩ and predict what changes before you try it. Base current with the wire cut is now (4.5 − 0.7) ÷ 1 kΩ = 3.8 mA — a lot more than before. Does the alarm sound any louder? What did just change (hint: it's not the buzzer's volume — it's how hard the transistor is on)?
- A latching alarm. Right now, reconnecting the trip wire silences the alarm instantly. Real burglar alarms stay on after a trip until someone punches in a code. Sketch (or describe) how you'd use a second push button plus the sensor half of the Sunrise Alarm's divider to make the alarm keep buzzing after the wire is restored. (Hint: you'll need "the trip flipped it on, and now it holds itself on" — a pattern called a latch. Level 6 will give you a proper chip for this. Right now, just draw it.)
- A tamper-proof extension. Add a second trip wire in series with the first, wrapped somewhere sneaky (across the battery pack, say). Now cutting the box's power also trips the alarm before the battery is unplugged. What does the pull-up math look like with two switches in series to ground?
For grown-ups: safety notes
- Battery-safe throughout — no shock risk, but the buzzer is loud at close range. Point it away from ears when you test.
- Trip wire placement: don't string a wire across a stairway, a hallway anyone walks in the dark, or anywhere a fall would hurt. The point is to detect the crossing, not to trip a person.
- Never use fishing line, metal string, or anything that could cut someone as they walk through. Thin bare copper snaps cleanly under a foot's weight without cutting.
- When the alarm is armed overnight, keep the buzzer volume in mind — a screaming alarm at 3 a.m. is what you want if there's an intruder, but it's a jump-scare for anyone else in the house. Talk to whoever else lives with you before you arm this at night.
- If the transistor ever feels warm to the touch, disconnect the battery and re-check the E-B-C leg order. Backwards transistors are always the first suspect.
- Never build a real security alarm you'd rely on out of this circuit alone. It's a fantastic teaching alarm — real intruder alarms use supervised loops, tamper detection, and a fallback battery. This is the foundation they're all built on, not a substitute.
Checked against
Keep building
You might also like
shares ideas with this one