Introduction: How to Use a Sound Sensor With Arduino

About: I'm a electronics and robotics hobbyist, I love building robots and making electronics projects!

Hey everyone, in this article I show you how to use a sound sensor with an arduino uno to control an led by making loud noises.

If you prefer watching videos. Here's a video tutorial I made!

Step 1: Parts

  1. Arduino Uno with a USB A to B cable
  2. Computer with Arduino IDE for programming
  3. KY-038 sound sensor module
  4. An led
  5. Some jumper wires with slots on one side and pins on the other
  6. Flat head screwdriver

Download Arduino IDE

Step 2: Connections

First take 3 jumpers and connect them to the headers of the sensor module labeled, Ground denoted by G, Positive denoted by a plus sign and Digital Output denoted by DO. Then take the other side of the jumper wires you just connected, and connect the positive of the sound sensor module to the 5v of the arduino, the ground to any of the gnd of the arduino, the Digital Output to pin 2 of the arduino. Next take the led, the positive lead is the longer one, and the ground is the shorter lead. Connect the ground to gnd and the positive lead to pin 13 of the arduino. So now the connections are done.

Step 3: Programming the Arduino

Next connect the arduino to the computer, download the arduino ide and the code I have provided, open the file and select the com port to the one where the arduino is connected, and beside boards, select arduino uno, then hit upload. The programming is done.

Download Arduino IDE

Step 4: Adjusting the Sensitivity of the Sound Sensor

Now you need to take the screwdriver and twist the potentiometer to adjust the sensitivity of the sound sensor. First twist it clockwise until the builtin led is shining without any noise being made. Then slowly twist it counter clockwise until the builtin led goes off. Now if you make a loud noise by clapping then the led connected to the arduino will turn on. If you clap again then it will turn off. If its not functioning properly or you are having difficulty turning the led on by making a loud noise then you may need to further adjust the sensitivity and test by making loud noises.

Step 5: Done!

So now you can turn an led on or off by clapping. Thank you for reading. If this instructable helped you please favorite it, comment and share. Also please check out my YouTube channel where I post videos on electronics and robotics. Bye!