How to Use a Sound Sensor With Arduino
by Aymaan Rahman in Circuits > Arduino
2019 Views, 1 Favorites, 0 Comments
How to Use a Sound Sensor With Arduino
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!
Parts
- Arduino Uno with a USB A to B cable
- Computer with Arduino IDE for programming
- KY-038 sound sensor module
- An led
- Some jumper wires with slots on one side and pins on the other
- Flat head screwdriver
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.
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.
Downloads
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.
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!