Robotica DIY
Created April 5, 2020 © 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 hour1
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

0 projects • 0 followers
Thanks to Robotica DIY.

Comments