CNAP

Sound Sensor (Big) Reference

A microphone-based sound detection module with a larger condenser mic, giving higher sensitivity than the small variant. Provides both analog and threshold digital outputs.

Pin names

NameDescription
AOUTAnalog Out — voltage proportional to sound amplitude
GNDGround
VCCPower (5V)
DOUTDigital Out — HIGH/LOW based on a threshold (adjustable via onboard trimmer on real hardware)

Attributes

This component has no configurable attributes.

Usage

Connect VCC to 5V, GND to GND, and either AOUT to an analog input pin for a continuous amplitude reading, or DOUT to a digital input pin for a simple sound-triggered alarm (e.g. clap detection).

const int SOUND_ANALOG_PIN = A0;
const int SOUND_DIGITAL_PIN = 2;

void setup() {
  pinMode(SOUND_DIGITAL_PIN, INPUT);
  Serial.begin(9600);
}

void loop() {
  int amplitude = analogRead(SOUND_ANALOG_PIN);
  bool triggered = digitalRead(SOUND_DIGITAL_PIN) == HIGH;

  Serial.print("Amplitude: "); Serial.print(amplitude);
  Serial.print("  Triggered: "); Serial.println(triggered ? "YES" : "no");
  delay(100);
}

Examples

DescriptionAttrs
Default sound sensor{}

See also