Project: delay lamp

Project · 20 min

Project: a delay lamp

A stairwell light: press the button, and the light comes on, stays on long enough to climb the stairs, then goes off by itself.

Requirement
Supply9 V
Holdthe LED stays lit 6 s after the button is let go, within 15%
Switchthe switch block: its OUT lights the LED while its IN is above 2 V

The LED, the switch block and the push button are on the board. The idea: the button fills a capacitor at once, straight from the + rail. Let go, a resistor across the capacitor drains it, and the LED stays lit until it has fallen to 2 V.

The maths

Discharging from 9 V, the capacitor's voltage is Ve−t/RC. It falls to 2 V after

t=RCln⁡VVth=RCln⁡92=1.50RC

What RC (in seconds) gives a 6 s hold?

Answer in s.

Build it. The button joins the + rail to column 16 while it's held. From column 16:

  • the capacitor (+ leg in 16) to the − rail;
  • the drain resistor to the − rail;
  • a wire to the block's IN, column 24 on this side of the gap.

The drawer's parts take any value: click one and type it. The block's input has 100 kΩ of its own to ground, in parallel with your resistor, so keep the resistor at 10 kΩ or below and it barely matters. With 10 kΩ, that's 9.1 kΩ in all.

Press Run, press the button and let go, and time it.

Halfway through the hold, someone presses the button again. What happens?

  • The capacitor fills up again, and the full 6 s starts over from the second press
  • The second press is ignored, and the light goes off on time
  • The holds add up: it stays on for twice as long

The button fills the capacitor directly, with no resistor in the way, but it drains through one. Why build it that way round?

  • A press should fill it at once, however briefly it's pressed; the hold should be slow
  • The button can't carry any current through a resistor
  • It saves a part, and makes no other difference

Your delay lamp:

  • a button fills a capacitor at once; a resistor drains it slowly;
  • t=RCln⁡VVth: 6 s from 3.99 s of RC;
  • the switch block turns a smooth fall into a clean off, and every press starts the time again.

On a real bench a stairwell timer usually fades out instead of snapping off, so nobody is left in the dark mid-step. That takes a transistor run part-way on, not as a switch, letting the LED follow the capacitor's falling voltage: something you'll build in the transistors topic. The capacitor's leakage and its 20% tolerance also make a real one's hold time only good to 20% or so.