Robotica DIY
Published © GPL3+

How to use buzzer with PIR sensor

Whenever it motion detection sensor detects motion it will make buzzer sound, this can be use in home safety.

BeginnerFull instructions provided1 hour154
How to use buzzer with PIR sensor

Story

Read more

Code

Code snippet #1

Plain text
void setup() {
pinMode(3, INPUT);
pinMode(9, OUTPUT);
}

void loop() {
if(digitalRead(3) == HIGH){
tone(9, 400);
delay(300);
noTone(9);
delay(300);
tone(9, 400);
delay(300);
}
else {
noTone(9);
 }
}

Credits

Robotica DIY

Robotica DIY

16 projects • 2 followers
Robotica DIY is for those who want to learn themselves. You will get projects on Arduino, Raspberry pi & NodeMcu ESP8266.
Thanks to Robotica DIY.

Comments