A sound sensor is a device that can detect and measure sound waves. It is a part of many of the devices we use, including phones, laptops, and music players. as well as security and monitoring systems.
In this tutorial we will use the Arduino and a sound sensor to detect sound levels in your environment and print this data directly on your computer.
Connect the wires between the sound sensor and the Arduino, as shown in the image below.
Connections from the Arduino to the sound sensor:
• Arduino A0 pin → sound sensor A0 pin
• Arduino GND pin → sound sensor GND pin (- pin)
• Arduino 5V pin → sound sensor VCC pin (+ pin)
• Arduino pin 2 → sound sensor D0 pin
Now access the serial monitor on your Arduino IDE by clicking on the magnifying glass icon at the top right corner.
Now, as we can see in the image below, the serial monitor prints the noise state and the read value from the sensor.
The value is updated and printed every three seconds. Because of the delay, we added to our code.