Introduction
Detect sound around you with a sound sensor.
In this guide, you will learn how to use a sound sensor with an Arduino, so that an LED turns on when sound is detected.
After completing this guide, you can incorporate sound detection in your next Arduino projects!Â
-
-
-
-
int led = 13; // We are going to make Pin 13 LED blink int threshold = 28; // Change this to the level you want the light to come on int volume; void setup() { Serial.begin(9600); pinMode(led, OUTPUT); } void loop() { volume = analogRead(A0); // Read the value from the Analog PIN A0 Serial.println(volume); delay(100); if (volume >= threshold) { digitalWrite(led, HIGH); //Turn ON Led } else { digitalWrite(led, LOW); // Turn OFF Led } }