The microphone sound module detects the sound in the surrounding. This module has 4 pins, namely: A0, GND, VCC (+) and D0. A0 and D0 are the output pins of this module. The A0 is an analog output where the real-time output voltage signal of the microphone. The D0 is a digital output when the sound intensity reaches a certain threshold, the output would be HIGH value or LOW value. The threshold-sensitivity can be adjusted through the small potentiometer on the module.
Arduino-Module Pin Connections:
The A0 pin should be connected to any analog pin of the Arduino (example is A0). The GND pin will be connected to the GND of the Arduino. The VCC (+) will be connected to the 5V of the Arduino. The D0 should be connected to any digital pin of the Arduino.
Code example using the digital output of the module
Code example using the analog output of the module
Upload the code and test the Arduino. Make a sound like play music or shout and you will see the changes in the output display of the Serial Monitor.