Brigadoon - An Occasional Corner on the Internet
Sound Sensor
Designed by Mark Little
Pin Function
VCC Supply Voltage to the Senor. Typically +5V, but check the datasheet
GND Ground or Earth connection for the supply voltage and the sensor output
AOUT Analogue Output - The analogue output of the microphone.
DOUT Digital Output - This output goes high when the input sound level exceeds a level set by the potentiometer and goes low when the level falls below the threshold.
The sound sensor is really just a microphone with an amplifier and a level sensor. The analogue output of the microphone would normally be sent to  an Analogue to Digital Converter (ADC) if the actual sounds were to be analysed.

If the objective is simply detect when the noise level exceeds a certain threshold, the potentiometer can be used to set the trigger level in the inbuilt comparator so that the digital outptut is triggered when that level is exceeded.

Many of these units are provided with little or no mounting points and this can make it hard to incorporate these sensors into a final design. The microphones are not waterproof,so that care must be taken to ensure the microphone does not get wet.
The table below shows the typical pin-outs of a typical sound sensor:
The frequency response of even a modest electret-microphone can extend up to 10kHz. As a result, it should be possible to connect the analogue output to an ADC input to conduct spectral analysis of the sound. It should be noted that to digitise the input audio, the ADC sampling rate should be be at least twice the highest expected frequency out of the microphone. Depending on the sampling rate, an anti-aliasing filter may be required between the sound sensor and the input to the ADC channel.

The problem with connecting the sound sensor to an ADC connected to the Raspberry Pi via an I2C or SPI interface is that the communication between the ADC and the Raspberry Pi will limit the maximum rate that data can be transferred from the ADC, thus limiting the maximum frequency that can be processed. However, if we assume that the maximum data transfer rate is about 7,000 samples per second, this is fast enough to process a standard speech channel which has the frequency range 300Hz to 3,400Hz - telephone line quality.