Clap On Lamp
Resources and Going Further
The example code and circuit diagram for the Clap On Lamp project can be found on GitHub.
- Right now, the program looks for any two sharp, successive noises. This could mean tapping the table near the sensor, sneezing or even just talking. See if you can modify the code to be more restrictive about what’s considered a “clap.” Can you have the servo activate only on clap sounds?
- Replace the sound detector sensor with another sensor, like a photocell. Have the lamp activate whenever another type of threshold is reached, such as getting too dark in a room.
- Write a computer program that looks for the local sunrise and sunset data on the internet and sends a command to the Arduino (e.g., over Serial) to turn the light on at sunset and off at sunrise.
Need some inspiration for your next project? Check out some of these related tutorials: