One of the most common usages of sound sensors is to turn lights off and on by clapping. Taking a clue from the copiousness of this sensor, it can be used to hook up to a range of LED lights that plays with music, clapping or knocking. With all the necessary equipment, that connects the sound sensor and the LEDs, the Arduino can be programmed accordingly to make sound sensitive lights.
You will need an Arduino with a breadboard and its cables, a sound sensor for detecting high sensitivity sound sensor module by Keyes, LED lights and resistors. The sound sensor has four pins which are connected to the Arduino and on the top of it, there is a little flathead screw to adjust the sensitivity as well as the analog output of the sound sensor. The sound sensor can be adjusted by turning the background music with the sensor-LED till the module starts blinking with the rhythm.
Start with one LED and start attaching resistor from ground to the shorter side of the LED. The lengthy side of the LED is connected to digital pin 3 of the Arduino. For other LEDs, the process is same but the lengthy side is now connected to digital pin 4, 5 etc. Depending on the number of LEDs being used, the code is written accordingly. Here, the code is written to support 7 LED lights from digital pin 3 to 9 for LEDs.
The Arduino is programmed with the code and once uploaded, this activates serial output and can be viewed by using the Serial Monitor from the Arduino software. The analog and digital values come from the sound sensor module, where analog value must spike up when a noise occurs and becomes steady when it gets quiet again. The sound of the analog value will rise and go above the threshold value when the LEDs will turn on. Once the calibration is done, the Serial commands are re-commanded and the codes to Arduino are again uploaded.
Check the link for complete details.