top of page
Search

Created a Arduino device to stop people from making noise


The Need -

There is a need when folks around make a noise and i need to focus. Thought of creating a device where which will buzz when some one makes sound .

The High level Design

Will use three components. A sound detector device , Arduino and a buzzer.




CODE -

//This code is for Arduino Nano and detects Sound and buzzes alarm

const int soundPinDigital = 2;
const int buzzerPinDigital = 4;
int soundLevel;
bool soundDetected;
void setup() {
  Serial.begin(9600);
  pinMode(soundPinDigital, INPUT);
  pinMode(buzzerPinDigital,OUTPUT);
  Serial.println("Starting program");
  attachInterrupt(digitalPinToInterrupt(soundPinDigital), soundISR, FALLING);
}

void loop() {
  if (soundDetected){
    soundDetected=false;
    tone(buzzerPinDigital,3000);
    delay(200);
    noTone(buzzerPinDigital);

  }
}

Conclusion

This device was very useful for my use case and make other realize that they need to keep things low.

 
 
 

Recent Posts

See All
Lets build something

Would that be fun kids , to build something exciting from scratch and learn something useful as well . You all know the world is becoming...

 
 
 

Comments


bottom of page