beautypg.com

Project a5, Project a6 daylight alarm clock, Adding sound to the counter – Elenco XP&trade User Manual

Page 15

background image

Turn off the slide switch (S1). Use the circuit from the preceding
project, but add parts to it so it matches the one shown here.
Set the lever on the adjustable resistor (RV) to the middle.

Turn on the slide switch (S1), and wait a moment for the green
LED (D2) to come on. Slowly press the press switch (S2) six
times, then press it again but hold it down until music starts. The
red & green LEDs blink in time as a song plays. You can adjust
the sound volume using the lever on the adjustable resistor. The
green LED will stay on when the song is finished.

The microcontroller can produce other tunes. Push the press
switch several times (not six times), and then hold it down until
an alarm plays. The green LED will come on when the alarm is
finished.

You can still use the circuit as a counter like in the preceding
project. To count, press switch S2 several times then wait 10
seconds (don’t hold S2 down). The LEDs will display the count
as before, without music.

Project A5

Adding Sound to the Counter

Project A6

Daylight Alarm Clock

Note: This circuit requires program Electronic Brain to be in microcontroller U21’s
memory. This is loaded into U21 at the Snap Circuits

®

factory and should still be there,

unless you already reprogrammed it. If it has been reprogrammed, you must use project
B1 to load program Electronic Brain back into U21 before building this circuit.

-14-

Use the preceding circuit, but replace the press switch (S2) with
the photoresistor (RP). Place the circuit in a dark room and turn on
the slide switch (S1). The green LED (D2) will come on, indicating
the circuit is working.

When a room light is turned on for more than 10 seconds, or
sunlight makes the room bright, an alarm will sound. The warning
will repeat approximately every minute until the slide switch is
turned off or the
room is made
dark again.

In darkness, the
photoresistor has high
resistance, like a switch
that is turned off. When
light shines on it, the
photoresistor has much
lower resistance, like a
switch that is turned on.