Clap-Activated Smart Lamp: Turn Your Lights on and Off With a Simple Clap
by Protobject in Teachers > 6
39 Views, 0 Favorites, 0 Comments
Clap-Activated Smart Lamp: Turn Your Lights on and Off With a Simple Clap

In this project, we will create a lamp that can be turned on and off by detecting hand claps. This project is perfect for those who want to add a touch of smart home automation without needing extra hardware. Imagine walking into a room and simply clapping your hands to turn on the lights—it's both fun and practical!
Supplies
- 1 Smartphone (used as a noise level detector and lamp)
- 1 Smartphone Stand (to hold the smartphone in place)
- Internet Access (to use the Protobject platform online)
Access the Platform

Visit the Protobject platform at https://app.protobject.com using Chrome or any Chromium-based browser (e.g., Edge, Opera).
Add Devices


- Add the NoiseLevel component by opening it on your smartphone.
- Add the Lamp component on the same smartphone by using the Scan option visible once the NoiseLevel component is opened. This device will be used to control the lamp.
Program the System

How It Works
The prototype runs in an infinite loop to continuously monitor the noise level. The system measures the noise level using the smartphone’s microphone. When a hand clap is detected (a sudden spike in noise level), the lamp toggles its state (turns on if it was off, and vice versa).
The code is already prepared for you!
You can view it in detail at this link. Comments are included to provide clarification when needed.
You can also open the project directly in Protobject to avoid manually setting it up.
Test Your Clap-Activated Lamp

- Place your smartphone in the stand where it can clearly detect the sound of your hand claps.
- Clap your hands to test if the lamp turns on and off as expected.
- Adjust the noise level threshold if necessary to ensure reliable detection of hand claps.
Optional Improvements
- Add Visual Feedback: Integrate the LedDraw component to display a visual indicator when a hand clap is detected.
- Adjustable Brightness: Use the Knob component to adjust the brightness of the lamp. This can provide more control over the lighting environment.
- Integrate a Timer Function: Add a timer to automatically turn off the lamp after a certain period of inactivity. This can help save energy and add convenience.
Enjoy Your Clap-Activated Lamp!
By only using your smartphone, you’ve created a practical and fun clap-activated lamp without needing extra hardware. You can enhance this tool further by integrating additional smart features like a motion detector or expanding its functionality with voice control, adjustable brightness, or remote control.
Happy clapping!