Sound Sensor
What is a Sound Sensor Module?
A sound sensor module uses an electret microphone and amplifier/comparator circuit to detect claps, knocks, loud events, or approximate sound intensity. KY-038 and LM393 sound modules are common in Arduino clap switches and noise-triggered projects.
These low-cost modules are good for event detection, not calibrated decibel measurement. For accurate audio levels or speech, use a dedicated microphone amplifier or digital MEMS microphone instead.
Key Features
Clap Detection
Detects sharp sound events for clap switches, knock sensors, and interaction triggers.
Analog Level Output
AO gives a changing microphone envelope that can be sampled by an ADC pin.
Digital Threshold Output
DO switches when sound crosses the potentiometer-set threshold.
Adjustable Sensitivity
The onboard potentiometer controls how loud a sound must be to trigger the module.
Fast Response
Good for short pulses, taps, and sudden noise changes in beginner projects.
Simple Wiring
Works with Arduino digital and analog pins using only power, ground, and output wires.
Pin Configuration
VCC
Power input. Many KY-038 modules operate at 3.3V or 5V, but check your board markings.
GND
Ground reference shared with the microcontroller.
AO
Analog microphone envelope output for approximate sound-level readings.
DO
Digital output from the comparator. Goes HIGH or LOW when sound crosses the threshold.
How It Works
The Science Behind It
The electret microphone converts pressure changes in air into a tiny electrical signal. An amplifier raises that signal enough for the module circuit to process.
The analog output follows the amplified sound envelope, while the comparator compares that signal against a potentiometer threshold to create a clean digital trigger.
Event Detection:
Ambient level = moving average of AO
Sound event = AO exceeds ambient + threshold
Digital trigger = comparator output changes state
These modules are not true decibel meters. Use them for relative sound changes unless you add calibrated audio hardware.
Wiring Tips & Best Practices
Set Threshold in Place
Adjust sensitivity in the actual room because background noise changes the trigger point.
Use a Moving Average
For analog mode, compare readings against an adaptive baseline instead of one fixed value.
Debounce Claps
After detecting a clap, ignore input for 150-300ms to avoid counting echoes as extra claps.
Reduce Supply Noise
Microphone circuits are sensitive. Keep motor, relay, and speaker currents away from the module ground path.
Mind Direction
Point the microphone opening toward the sound source for consistent response.
Know the Limit
Choose a MEMS microphone or MAX9814-style amplifier for audio recording or better level accuracy.