Introduction: Cheap and Simple Arduino Clap Lamp
Today I will be showing you how to make a lamp which turns on whenever you clap. This is very handy for such as a bed lamp on the opposite side of your room, or which is awkward to turn off. Maybe you are just too lazy too turn it off, or you just want to make a really cool project and learn about Arduino and electronics. The lamp uses a microphone and a relay module to turn on and off the lamp.
Step 1: Warning!!!
This project works with very high voltage and if you are not careful it could cause very serious injury, damage or even death. I am not liable for any problems caused by this. If you are careful, think before you do, use common sense and follow the instructions you should be fine. One of the main things is not too touch exposed wires, especially if they are plugged in at the wall. PLEASE BE VERY CAREFUL!!
Step 2: What You Need:
Here is a list of parts you need:
1. A lamp
2. An Arduino(I used a nano but a uno or any is fine, you also need computer and USB cable)
3. A breadboard(We can get rid of this for a finished product)
4. A 240v relay module
5. A sound sensor/microphone
6. Jumper Wires
Tools you need
2. Screwdriver(for relay module)
Step 3: The Arduino Circuit
The Arduino circuit is a very simple one:
Microphone GND > Arduino GND
Microphone 5v/vcc > Arduino 5v/vin
Microphone OUT > Arduino Digital Pin 10
Relay Module VCC > Arduino 5v/vin
Relay Module GND > Arduino GND
Relay Module In1/in > Arduino Digital Pin 3
Or Refer to Fritzing diagram
Step 4: Relay/Lamp Circuit
This step can be confusing as it depends on the type of wiring your lamp has. Mine just had 2 wires. Sometimes it may have all wires inside one covering. Be very careful your lamp plug is turned off and unplugged and what you need to do is:
Cut 1 of these wires. Preferably the 'hot' or positive wire(sometimes it is difficult to tell which is which). I accidentally cut the two of them which explains the tape over the wire in the photos.
Put the cut wire which comes from the lamp side into the normally open (NO) connection and screw it up tight
Place the wire coming from the wall socket side of things into the COM connection and screw it up tight
Step 5: The Code
The code is a fairly simple one and seems to work fairly well
Step 6: Test It Out
Now is the step to see if it all works(It hopefully should).
Double check your circuit looks the same to mine
Plug your plug into the wall and turn it on
Clap close to the microphone to make sure it is working
If it is not make sure the lamp is turned on at its own switch if it has one
If it does not work unplug it and check your wiring again
Step 7: Go Further
This is the first step to something like home automation. If you think you are going to keep using it make a nice box for it. Connect a wifi module and make a server, connect a light sensor and make it turn on at night, or at a certain time. The possibilities are very much endless. Let me know what you re thinking about doing, or what you have done in the comments. Enjoy your new clap lamp.
We have a be nice policy.
Please be positive and constructive.