edge lab LIVE! starts Tuesday in Munich. Grab a workshop seat and take home the board you build on. Code FRIEND-HACKSTER saves 20%. () Learn more!
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 hour9,409
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
16 projects • 19 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