3.3V to 5V
3.3V to 5V
10mA
50 dB
20 Hz to 20 kHz
0 or 1
Normally Open (NO) or Normally Closed (NC)
10ms
-20C to 70C
-40C to 80C
25mm x 20mm x 10mm
Applications
The Sound Sensor Module is ideal for a wide range of applications, including |
Home automation systems
Robotics and autonomous systems
Voice-controlled systems
Noise monitoring systems
Sound-activated switches
Security systems
Industrial automation systems
Conclusion
The Sound Sensor Module is a versatile and highly sensitive sound detection module that is perfect for a wide range of IoT applications. Its compact design, low power consumption, and adjustable sensitivity make it an ideal choice for developers, hobbyists, and professionals alike.
Sound Sensor Module Documentation
Overview
The Sound Sensor Module is a digital sensor that detects sound waves and converts them into an electrical signal. This module is commonly used in various IoT applications, such as voice control systems, sound-activated switches, and noise level monitoring systems.
Pinouts
The Sound Sensor Module typically has the following pinouts:
VCC: Power supply pin (typically 5V)
GND: Ground pin
OUT: Digital output pin (TTL level)
AOUT: Analog output pin (optional)
Operating Principle
The Sound Sensor Module uses a microphone to detect sound waves and a amplifier to amplify the signal. The amplified signal is then compared to a predefined threshold level, and if the signal exceeds this level, the digital output pin (OUT) goes high.
Code Examples
### Example 1: Sound-Activated LED using Arduino
In this example, we will use the Sound Sensor Module to control an LED. When the sound level exceeds a certain threshold, the LED will turn on.
```c++
const int ledPin = 13; // Choose the pin for the LED
const int soundPin = 2; // Choose the pin for the sound sensor
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(soundPin, INPUT);
}
void loop() {
int soundState = digitalRead(soundPin);
if (soundState == HIGH) {
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
delay(10);
}
```
### Example 2: Sound Level Monitoring using Raspberry Pi (Python)
In this example, we will use the Sound Sensor Module to monitor the sound level and display it on a serial console.
```python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
sound_pin = 17 # Choose the pin for the sound sensor
GPIO.setup(sound_pin, GPIO.IN)
while True:
sound_state = GPIO.input(sound_pin)
if sound_state == 1:
print("Sound detected!")
else:
print("No sound detected.")
time.sleep(0.1)
```
### Example 3: Sound-Controlled Robot using ESP32 (MicroPython)
In this example, we will use the Sound Sensor Module to control a robot's movement. When the sound level exceeds a certain threshold, the robot will move forward.
```python
import machine
import utime
sound_pin = 14 # Choose the pin for the sound sensor
motor_forward_pin = 15 # Choose the pin for the motor forward control
machine.Pin(sound_pin, machine.Pin.IN)
machine.Pin(motor_forward_pin, machine.Pin.OUT)
while True:
sound_state = machine.Pin(sound_pin, machine.Pin.IN).value()
if sound_state == 1:
machine.Pin(motor_forward_pin, machine.Pin.OUT).value(1)
print("Robot moving forward!")
else:
machine.Pin(motor_forward_pin, machine.Pin.OUT).value(0)
print("Robot stopped.")
utime.sleep_ms(50)
```
Note: Make sure to adjust the pin numbers and thresholds according to your specific setup and requirements.