This project will be utilizing an Ultrasonic Sensor to detect movement and activate an alarm which consists of a triggered buzzer and flashing LED's.
Hardware you will need:
1. Arduino Uno
3. HC-SR04 Ultrasonic sensor
5. Active buzzer
Step 1: Step 1: Connect Ultrasonic Sensor
The Ultrasonic sensor will be inserted directly into the breadboard. It is wired to the arduino in the following order.
1.VCC to Arduino 5V
2. Trig to Arduino Digital 9
3. Echo to Arduino Digital 10
4. GND to Arduino GND
Step 2: Step 2: Connect LED's
You will need:
-4 220 Ohm resistors
4 Led's will be inserted into the breadboard (2 blue, 2 red). Connect a resistor to the long leg of each LED. The short legs of each LED will be wired to GND. Wire the resistors to the arduino as followed.
1. First red Led to Arduino Digital 8
2. Second red Led to Arduino Digital 13
3. First blue Led to Arduino Digital 7
4. Second blue Led to Arduino Digital 12
Step 3: Step 3: Add a Buzzer
Insert an active buzzer into the breadboard. Wire the buzzer short leg (-) to GND. Wire the buzzer long leg (+) to Arduino Digital 11.
Step 4: Step 4: Motion Sensor Alarm - Code
Attached is the code for the Arduino Motion Sensor Alarm.