Progress Bar

Skip to main content

Jaycar
...

Silent Alarm Clock

Silent Alarm Clock

Difficulty
Sight & Sound

Summary

Do you need an alarm clock that doesn't wake anyone up next door? Do you often look at the time and immediately fall asleep again? Well look no further. This Silent Alarm Clock uses RGB LED shield to provide a great colourful display in your bedroom and simulate daylight to gently wake your body up.

If you want to know what time it is, just give two loud claps and the Silent Alarm Clock will read out the current time to give your brain a quick morning jog.

Materials Required

1
1
1

Table of Contents

Such a device is easy to build using an Arduino Leonardo board and a module capable of detecting sound. To save ourselves from getting too close to mains voltages, we’ve added a 433MHz transmitter to provide remote control of a few different types of radio-controlled devices.

This will allow you to control either a wireless power point such as Jaycar’s MS6148, or a commonly installed ceiling fan and light combination (sold under the ‘Brilliant’ brand), which incorporates an RF remote control. In both cases, the circuit transmits the same signal as the remote control, so the existing hand controller can still be used.

Since we are providing the Arduino source code, you could adapt it to control another device, such as a relay module or even something simple like a light-emitting diode (LED) connected directly to the Leonardo board.

The Arduino sketch

We can’t easily differentiate claps from other short, sharp sounds, such as knocks. Still, you might prefer to make a knocking sound to control it. We are basically trying to detect a sharp increase in volume.

To detect claps, we need to smooth out the waveform to get a signal corresponding to volume (rather than instantaneous amplitude). We use ‘exponential smoothing’ because it is straightforward to implement. Adding an RC (resistor and capacitor) low-pass filter circuit would have the same effect, but we can do exponential smoothing in software without adding any parts.

We then apply some thresholds to distinguish claps from other sounds. We detect the start of a clap when the smoothed value rises above a certain level and its end when the value falls below a different, lower level. This is called hysteresis and is another way to separate claps in a noisy environment.

Once one clap is detected, a timer runs for one second and further claps within that second are counted. Thus, the software can detect multiple claps in close succession. The Leonardo’s onboard LED is also lit while each clap is detected.

RF communication

Wireless remote controls use different digital protocols; we have provided software libraries to encode the desired channel and function. We’ll delve into that a bit later during our setup and testing.

The digital RF signals are pretty slow (compared to some digital protocols) and are simply ‘bitbanged’ with timed delays. During the period when the Arduino Leonardo is producing the digital RF transmission signal, it does not monitor or respond to a clap signal, but we don’t think that is a big deal, as you would usually not send a second command until you observed the original one being obeyed.

The sketch also takes input on the Serial Monitor, so typing ‘1’ will have the same effect as making one clap, ‘2’ for two claps and so forth; this is handy for testing. We can handle cases up to five claps, since that was about the most we could achieve in one second. It wouldn’t be hard to update the code to deal with more if you wanted to.

Similar projects you may be interested in

Arduino Clap Light
Sight & Sound
Arduino Clap Light
Difficulty

Atari Punk Synth
Sight & Sound
Atari Punk Synth
Difficulty

Wireless Garden Monitor
Sight & Sound
Digital Photo Frame
Difficulty

Sight & Sound
Ultrasonic Parking Assistant
Difficulty