Motion Sensing Creepy Sound/Jump Scare

by Badal in Circuits > Arduino

337 Views, 3 Favorites, 0 Comments

Motion Sensing Creepy Sound/Jump Scare

do following connections.PNG

In this instructable I will show you how to make a simple motion sensing jump scare.

add these.PNG

you need these items:

Arduino uno

breadboard

PIR sensor

Piezo Buzzer

do following connections.PNG

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

code.PNG

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

}