Product Introduction #
Sound sensor is a sensor used to detect the strength or frequency of sound signals in the environment.
Sound is essentially a kind of mechanical wave, which is generated by the vibration of the object caused by the vibration of the surrounding medium (such as air, water, etc.) molecules, and then form sound waves. When people speak in front of a microphone, the sound waves generated by their voice strike the membrane inside the microphone, causing it to vibrate. This vibration is converted into an electrical signal whose amplitude corresponds to the intensity of the sound. By measuring the amplitude of this electrical signal, we can determine the magnitude of the sound.
Application reference: voice control switch, noise detection, etc.
Parameter Specification #
Parameters | Value/Description |
Operating voltage | 5V |
Operating temperature | 0°C~+70°C |
Output signal | Analog signal |
Size | 3.16cm*2.38cm |
#
Wiring Diagram #
Note:Expansion board is attached to esp32 controller board.
Sound Sensor | ESP32 |
VCC | 5V |
GND | GND |
Sign | Pin 32 |
Sample Code #
void setup(){
pinMode(32, INPUT);//Set pin 32 to input mode
Serial.begin(115200);//Set baud rate to 115200
}
void loop(){
Serial.println(analogRead(32));//Read the state of pin 32 and print it to the serial monitor
}
Note: If you are using an Arduino board, then change the pin in the program to PIN A0, set the baud rate to 9600, and then connect the hardware pin to PIN A0 and upload the program.
Test Result #
After you have successfully connected the line according to the wiring diagram and successfully uploaded the correct program, open the serial port, set the baud rate (115200 baud rate), and switch to the rolling mode. Speak into the sound sensor, the louder the sound, the higher the number.
By clicking the serial port graph detection, you can observe the change of the amplitude waveform of the sound.
When no sound is detected:
When sound is detected:
Related Resources #
Get One Now #
B2B Business: info@acebott.com