Motion Sensing Creepy Sound/Jump Scare
by Badal in Circuits > Arduino
337 Views, 3 Favorites, 0 Comments
Motion Sensing Creepy Sound/Jump Scare
In this instructable I will show you how to make a simple motion sensing jump scare.
you need these items:
Arduino uno
breadboard
PIR sensor
Piezo Buzzer
Do the following connections
Arduino to breadboard:
5v = +
Gnd = -
Arduino to Piezo:
Digital pin 11 = Positive
Arduino to PIR sensor:
Digital pin 10 = Signal
Breadboard to Piezo:
- (Gnd) = Negative
Breadboard to PIR sensor:
+ (5v) = Power
- (Gnd) = Ground
Now you have to upload code to Arduino Uno:
// C++ code
void setup()
{
pinMode(10, INPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
}
void loop()
{
if (digitalRead(10) == HIGH) {
tone(11, [hertz], 200); //You may change the value [hertz] to your choice
digitalWrite(12, HIGH);
} else {
noTone(11);
digitalWrite(12, LOW);
}
delay(10); // Delay a little bit to improve simulation performance
}