Introduction: Motion Sensor Alarm

Our product is an alarm that has a distance sensor on it, so when someone steps in front of it, red and blue lights flash and a buzzer goes off.

Supplies

  • Ultrasonic Distance Sensor 
  • Breadboard 
  • Arduino UNO board 
  • Piezo Buzzer 
  • Blue and Red LEDs 

Step 1: Ultrasonic Distance Sensor

Start by connecting the breadboard to 5V and Ground on the Arduino board. Attach the Ultrasonic Distance Sensor and wire to ground, 5V and pin 3. 

Step 2: Piezo Buzzer

Put the buzzer pins into the breadboard, then connect the negative side to ground, and the 5v side to pin 9.

Step 3: LED's

Grab one red and one blue led. Stick them into the bread board. The short pin side is the ground. Connect the short pin sides to ground. Connect the longer pin sides to pins 10 and 11.

Step 4: Code

What the code does is if the sensor is triggered, the red and blue lights will alternate for a few seconds, as well as the buzzer will go off for a few seconds. If the sensor is not triggered, the lights and buzzer stay off.

Here is the link to the video: Recording-20240422_112101.webm