Random Nerd Tutorials
Shares

Guide for Microphone Sound Sensor with Arduino

Shares

This post shows how to use the microphone sound sensor with the Arduino board.

The Microphone Sound Sensor

The microphone sound sensor, as the name says, detects sound. It gives a measurement of how loud a sound is.

There are a wide variety of these sensors.  In the figure below you can see the most common used with the Arduino.

sound-sensor

At the leftmost side, you can see the KY-038 and at the right the LM393 microphone sound sensor.

Both sensor modules have a built-in potentiometer to adjust the sensitivity of the digital output pin.

Where to buy?

You can find these sensors on eBay for less than $1:

Pin wiring

Wiring your sensor to the Arduino is pretty straightforward:

Pin Wiring to Arduino
A0 Analog pins
D0 Digital pins
GND GND
VCC 5V

If you’re using the LM393 module, you should connect the OUT pin to an Arduino digital pin.

Example: Sound Sensitive Lights

In this example, a microphone sensor will detect the sound intensity of your surroundings and will light up an LED if the sound intensity is above a certain threshold.

Parts required

For this example you’ll need the following components:

  • 1x Microphone sound sensor (view on eBay)
  • 1x Arduino (view on eBay)
  • 1x Breadboard
  • 1x LED
  • 1x 220 Ohm resistor
  • Jumper wires

Schematics

Assemble all the parts by following the schematics below:

microphone-sound-sensor_bb

Code

Upload the following code to your Arduino board.

Demonstration

After uploading the code, you can clap next to the sensor. If the LED is not lighting up, you need to change the sensor sensitivity by rotating the potentiometer.

demo-gif

You can also adjust the sensitivity so that the LED follows the beat of a certain music.

Add more LEDs to a more spectacular effect!

Wrapping up

I hope you’ve found this guide useful.

What ideas do you have to use the sound sensor module?

Let me know by posting a comment down below.

If you’d like to know more about arduino sensor modules, make sure you take a look at the following posts:

Thanks for reading,

Rui and Sara

Recommended Resources

Home Automation using ESP8266 »
Build IoT projects and home automation gadgets with the ESP8266 Wi-Fi module.

Build a Home Automation System »
Learn how to build a automation system using open-source hardware and software from scratch.

Arduino Step-by-Step Projects »
Build 25 cool Arduino projects with our couse even with no prior experience!

Leave a Comment:

Add Your Reply

⏰ Early Black Friday 2017 Special ⏰
Download all our courses up to 35% off