beautypg.com

Project b25 clap light – Elenco XP&trade User Manual

Page 57

background image

Project B25

Clap Light

In this circuit, you turn a light on and off by
clapping. Build the circuit as shown. Turn on the
slide switch (S1). Load program Clap Light into
the microcontroller (U21) using the programming
instructions in project B1. After programming,
disconnect the programming cable; the circuit
may not work properly if the cable is still
connected.

When the program starts running, the green LED
(D2) will be on for about 40 seconds and then
turn off. During this time, the program is waiting
for the 470

μ

F capacitor (C5) to charge up. Just

before the green LED goes off, the program
measures the level of room background noise. If
the room is very quiet, then the circuit will be
more sensitive.

Now clapping will control the red LED (D1). Clap
twice or more with a short pause between. The
red LED (D1) should turn on or off. If the red LED
doesn’t change then keep clapping and adjust
the time between claps. Sometimes tapping on
the table may switch the red LED.

If your Clap Light still doesn’t work then turn the
switch off and on to reset and re-measure the
room background noise. Keep the room quiet so
there is less background noise, so the circuit will
be more sensitive.

Optional:

-56-

Sounds into the microphone produce brief electrical
signals, which are measured by the microcontroller.
The microcontroller initially measures the room
background noise as a reference, then looks for
larger electrical signals that could be claps.
Electrically, a clap is a sharp, brief burst of energy.

Disconnect cable
after programming