Level 3 · Sense · project 3 of 12 · 25 min · ●●●○○
Cookie Jar Alarm
The Sunrise Alarm's brain wired to a buzzer instead of a lamp — quiet in the dark jar, screaming when the lid comes off.
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 L1
- 1× Light sensor (LDR) the "eye" — lives on top of the divider like the Sunrise Alarm
- 1× 10 kΩ resistor bottom of the divider L1
- 1× 1 kΩ resistor protects the transistor base L1
- 1× NPN transistor (2N2222) flat face toward you: legs are E-B-C
- 1× Active buzzer (3–5 V) + leg toward the battery; no resistor needed on this lane L2
you'll learn: Voltage dividers · Transistor switching · Ohm's law
Circuit map
The circuit you'll build, running on the Workbench right now.
simulating…
If it doesn't work
The boring ways this circuit actually breaks — check these first before you unwire everything.
- Buzzer stays silent when the lid comes off. Divider is upside down. In this project the LDR must sit on TOP (opposite of Curfew Beeper). If it's on the bottom, swap it with the 10 kΩ.
- Buzzer screams inside the closed jar. You've built the Curfew Beeper wiring. Swap the LDR and the 10 kΩ so the LDR sits on top.
- Never triggers no matter what. 2N2222 pins with the flat face toward you: E-B-C, left to right. Swap any two and the base can't turn the transistor on.
- Buzzer very weak when it fires. AA batteries low, or someone added a 220 Ω in the buzzer lane. This buzzer runs straight — no series resistor needed.
- Beeps then stops after a few seconds. Base 1 kΩ missing — without it the base current spikes and the transistor overheats. Keep the 1 kΩ between pin B and the divider midpoint.
What you're building
A cookie jar with a snitching eye. Bury the little light sensor inside a dark jar, close the lid, and the circuit sits quietly. Someone lifts the lid — daylight rushes in — and it screams. The same idea protects lockers, drawers, and (spoiler for Level 8) fridges.
The big idea: swap the mouth, keep the brain
Look at this project and the Sunrise Alarm side by side. The sensing half — divider + 1 kΩ + transistor base — is identical. What changed is the output half: the LED lane became a buzzer lane. Same brain, different mouth.
Every complicated circuit you'll ever build gets put together like this: a sensing side that decides when, and an output side that decides what happens. Once you can pull them apart in your head, you can Frankenstein them:
- Sunrise Alarm brain + LED = wake-up light
- Sunrise Alarm brain + buzzer = cookie jar alarm (this project)
- Automatic Night Light brain + LED = the night light you already built
- Automatic Night Light brain + buzzer = a "lights are out" panic alarm
Four projects from two brains × two mouths. That multiplier turns a small parts box into a big project catalogue.
Do the math
The sensing half runs the Sunrise Alarm math — worked out there, reused here. LDR is roughly 1 kΩ in bright light and ≈ 100 kΩ in darkness.
- Lid open (bright, LDR ≈ 1 kΩ): divider tries to shove the middle point up toward 4.5 × (10 ÷ 11) ≈ 4.1 V. It never gets there: the transistor's base sits at about 0.74 V, the 1 kΩ base resistor drops the difference, and the middle row settles around 2.5 V while about 1.7 mA of base current flows in. Transistor on, hard.
- Lid closed (dark, LDR ≈ 100 kΩ): middle ≈ 4.5 × (10 ÷ 110) ≈ 0.41 V — below the 0.7 V wake-up line. Transistor off.
Now for the new bit — the output half:
- The active buzzer, from the Door Buzzer datasheet check, likes about 4.5 V and drinks ~30 mA. Its guts behave like a ≈ 150 Ω load at that voltage: I = V ÷ R = 4.5 ÷ 150 = 30 mA. Ohm's law even for the buzzer.
- A saturated (fully-on) transistor drops about 0.2 V from collector to emitter — engineers call this V_CE(sat). So when the alarm fires, the buzzer sees 4.5 − 0.2 = 4.3 V. Still well inside its 3–5 V happy zone, so it sounds normal.
- Alarming battery current: about 31 mA — roughly 29 mA through the buzzer plus the 2 mA the sensing half draws. That's higher than an LED lane (~11 mA), so a fresh set of AAs will run this for a long night of alarm — plenty for an overnight ambush.
Build it
If your Sunrise Alarm is still on the breadboard, keep the sensing half exactly as it is — just pull the 220 Ω + LED out and drop a buzzer in their place.
Fresh build:
- The sensing half (LDR on top, like Sunrise Alarm): battery + → LDR → middle row → 10 kΩ → battery −.
- The base link: middle row → 1 kΩ → transistor Base (middle leg with the flat face toward you).
- The output half: battery + → buzzer + leg; buzzer − leg → transistor Collector (right leg). Emitter (left leg) → battery −.
- Cover the LDR with your finger: silence. Lift your finger toward a lamp: BZZZT.
Notice there's no resistor in the buzzer lane. The buzzer, like in the Door Buzzer, limits its own current — no speed bump needed. The rule from that project still holds: know what each part needs before you power it.
Deploy your alarm
- Slide the whole breadboard into a shoebox or an actual cookie jar with the LDR inside, aimed up at the lid, so it sits in the dark while the lid is on and only sees light when the lid comes off. (Don't poke it through the lid — then it sees the room and the alarm never sleeps.)
- Cover the LDR with black electrical tape and test before you leave the jar unattended — if it beeps with tape on the sensor, some other light is leaking to it (the transistor legs, maybe). Fix that first.
- It fires only if opening the lid lets enough light reach the LDR. In a pitch-dark kitchen at 2 a.m., lifting the lid may not trigger it at all — a night light nearby, or the fridge door, is what gives the thief away.
Where "same brain, different mouth" leads
At Level 4 you'll add a motor. The same sensing half can then be wired to spin a small fan when the room gets bright (a solar-panel demo) or slam a paper barrier down when a shadow falls (a mousetrap alarm). At Level 9, that motor becomes robot wheels. You do not need a whole new circuit each time. You're wiring new mouths onto brains you already trust.
🧠 Your challenge
No single right answer. That's the point.
- Flip the alarm. Trade the LDR and the 10 kΩ back to their Automatic Night Light positions (10 kΩ on top, LDR on bottom). Predict what the buzzer now does before you power it up. (Hint: this is a "sudden darkness" alarm — great inside a lampshade or a drawer with a hidden bulb.)
- Alarm and lamp both. Put a 220 Ω + LED in parallel with the buzzer, both hanging off the collector. Now 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.)
- Less jumpy. Add a 1 kΩ in series with the LDR (on the top of the divider). What does the math say the middle voltage does in the same "cookie thief" bright light? Does the alarm still trigger? Making an alarm less nervous is a real engineering craft — this is your first turn at it.
For grown-ups: safety notes
- Battery-safe throughout — the LDR, buzzer, and transistor together don't change that.
- Active buzzers are loud at close range. Point the buzzer out of the jar (through a small hole beside the LDR hole), not toward anyone's ear.
- Don't hide the alarm where you can't reach it — you'll want to unplug the battery to reset it after it goes off, and to change AAs when they wear down.
- If the transistor 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 this into a jar with food you'll eat later. Use an empty jar or box; the breadboard and battery pack aren't food-safe and the alarm is for the game, not the cookies.
Checked against
Keep building
You might also like
shares ideas with this one