In this project, I am going to make a door alarm system using the HC-SR04 ultrasonic sensor. The ultrasonic sensor used in this project is used as a distance sensor, it will tell us the distance at which the object is placed. Using this distance value, I will turn the buzzer on or off.
Materials:
- Arduino Uno
- HC-SR04 ultrasonic sensor
- Buzzer -Connecting wires
- Breadboard
The hardware part of this project is very easy to put together. First of all, make the connections for the ultrasonic sensor with the Arduino. The connections for the ultrasonic sensor with the Arduino are as follows:
Connect VCC on the ultrasonic sensor to the 5V pin on the Arduino.
Connect the Trig pin on the ultrasonic sensor to pin 2 on the Arduino.
Connect the Echo pin on the ultrasonic sensor to pin 3 on the Arduino.
Connect the GND on the ultrasonic sensor to GND on the Arduino.