Sound Sensor
The microphone sound sensor, as the name says, detects sound. It gives a measurement of how loud a sound is.
Sensor modules have a built-in potentiometer to adjust the sensitivity of the digital output pin.
Components Required
- Arduino
- A Sound Sensor
- LED
- 220 ohm Resistors
- Mini Breadboard
- Wires
Schematics
Code
/* Microphone using arduino Tutorial * www.genbays.com */ int ledPin=13; int sensorPin=7; boolean val =0; void setup(){ pinMode(ledPin, OUTPUT); pinMode(sensorPin, INPUT); Serial.begin (9600); } void loop (){ val =digitalRead(sensorPin); Serial.println (val); // when the sensor detects a signal above the threshold value, LED flashes if (val==HIGH) { digitalWrite(ledPin, HIGH); } else { digitalWrite(ledPin, LOW); } }
Once your you uploaded the code, Make some loud noises and see the status of the LED which is connected to the arduino