Project 7 — The Invisible Eye (Beam-Break Treasure Alarm)

Text written by Claude Fable 5 (claude-fable-5).

Project 7 — The Invisible Eye (Beam-Break Treasure Alarm)

The one idea: there is light you can’t see — and we have an eye that can. Block the invisible beam and the eye notices instantly.

This project introduces the part that powers the rest of the series (Projects 7–11): the optointerrupter — a small plastic U with an infrared LED on one prong and a phototransistor (an electronic eye) on the other, staring at each other across a ~5 mm slot. Anything that enters the slot breaks the beam. It’s the LDR from Project 6’s theremin idea all over again — light controlling a circuit — but a thousand times faster and with its own private light source.

Bought breakout modules instead of bare parts? The little boards marked “slot-type optocoupler / speed sensor” have the two resistors and often a comparator already on board — just power VCC/GND and watch the OUT (D0) pin. Which way the logic points (HIGH or LOW when blocked) varies by board, so test yours with an LED first. The projects below assume the bare part, which is cheaper and teaches more; with a module, skip straight to the trigger stages and flip things if the logic is backwards.

What you need

Warm-up — find the invisible light

The optointerrupter has 4 legs: two for the hidden IR LED, two for the eye. Wire the LED side first: battery +220 Ω → LED anode → LED cathode → battery . You’ll see… nothing. That’s the point.

Now look at the slot through a phone camera (the front selfie camera works best — it usually has no IR filter): a ghostly purple-white glow! The LED is shining hard the whole time, in a colour human eyes can’t see but the camera (and our electronic eye) can.

Don’t know which pair of legs is the LED? Nothing breaks if you guess wrong through a 220 Ω resistor — just try both pairs (both ways round) until the phone camera shows the glow. Detective work is part of the fun.

Build it — stage 1: finger in the eye

Wire the eye so that a blocked beam sounds the buzzer:

  +6V ──┬── 220Ω ── IR LED ──────────────┐
        │                                │
        ├── 10kΩ ──┬── C (phototransistor)
        │          │        E ───────────┤
        │        [node]                  │
        │          └── 10kΩ ── NPN base  │
        ├── buzzer(+)        NPN emitter─┤
        │   buzzer(−)── NPN collector    │
  GND ──┴────────────────────────────────┘
  1. LED side: + → 220 Ω → LED → (as in the warm-up).
  2. Eye side: + → 10 kΩ → phototransistor collector; emitter. The junction between the 10 kΩ and the collector is our signal node.
  3. Node → 10 kΩ → base of the NPN. Emitter → . Buzzer from + to the NPN’s collector.

How it reads: beam shining → the eye conducts → node pulled LOW → transistor off → silence. Anything in the slot → eye goes blind → node jumps HIGH → transistor on → BZZZT. Poke a finger, a pencil, a LEGO piece into the slot. Instant response, every time — compare that with how lazily an LDR reacts.

(If yours does the opposite — buzzes on light, silent when blocked — the eye’s collector and emitter are swapped. Swap the two legs.)

Build it — stage 2: the treasure trap

An alarm that only sounds while the slot is blocked is easy to sneak past. A real alarm keeps screaming after a split-second trigger. That’s a job for the 555 in monostable (“one-shot”) mode: one nudge on its trigger and the output holds high for a time you choose.

The trap logic is beautifully sneaky, so set it up in this reversed way:

Wiring (remove the stage-1 NPN + buzzer first, or build alongside):

  1. 555 pin 1 → GND; pins 8 and 4+.
  2. Pin 2 (trigger) → the signal node from stage 1.
  3. 100 kΩ from + to pins 6 and 7 (tied together).
  4. 100 µF capacitor from pins 6/7 down to GND — mind the stripe: leg to GND.
  5. Pin 3 (output) → buzzer +; buzzer → GND. Add an LED + 470 Ω in parallel for a flashing-light feel.

The alarm time is T=1.1RC1.1×100kΩ×100μF11T = 1.1\,RC \approx 1.1 \times 100\,\text{k}\Omega \times 100\,\mu\text{F} \approx 11 s — and if the tab stays out, pin 2 stays low and the 555 keeps the alarm on until the tab is put back. Swap R or C to taste.

Arming ritual (kids love ritual): tab in the slot first, then connect the battery. Now the trap is live. Lift the treasure… WEEE-11-seconds-of-alarm.

What to say to the child

“There’s a kind of light our eyes can’t see — but look through my phone camera… see it glowing? This little U-shape has that secret light on one side and a robot eye on the other. The eye always knows if something is standing in between. So here’s the trick: we park this card in the gap and tie it to your treasure. The eye goes blind and everything is calm. But if a sneaky thief moves the treasure — the card pops out, the eye suddenly sees the light, and it yells THIEF for ten whole seconds. Want to be the thief first, or the guard?”

For you — the physics

Try next

← Back to Read Me First.