Sound Sensor

-Arduino Uno
-Sound Sensor

Adjust potentiometer on Microphone so that LED on it almost off
We will use on-board led

int ledPin = 13;
int sensorPin = 12;
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);

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s