Smart Distance Alarm System With Arduino🚀 | Easy DIY Project

by Aynur nouri in Circuits > Arduino

39 Views, 0 Favorites, 0 Comments

Smart Distance Alarm System With Arduino🚀 | Easy DIY Project

photo_2026-06-25_22-21-12.jpg

In this project, we will build a Smart Distance Alarm System using an Arduino Uno, an HC-SR04 ultrasonic sensor, an I2C LCD display, LEDs, and a buzzer.

The system continuously measures the distance between the sensor and nearby objects. Different LED indicators and buzzer patterns are used to provide visual and audio feedback based on the detected distance.

This project is perfect for beginners who want to learn about ultrasonic sensors, LCD displays, and Arduino programming while building a practical distance monitoring system.

Supplies

* Arduino Uno

* HC-SR04 Ultrasonic Sensor

* 16x2 I2C LCD Display

* Green LED

* Yellow LED

* Red LED

* Buzzer

* 3 × 220Ω Resistors

* Breadboard

* Jumper Wires

* USB Cable

Gather the Components

Collect all the required components listed above and make sure they are working properly before starting the project.

Connect the Ultrasonic Sensor

Connect the HC-SR04 ultrasonic sensor to the Arduino:

  1. VCC → 5V
  2. GND → GND
  3. TRIG → Pin 9
  4. ECHO → Pin 10

Connect the I2C LCD Display

Connect the LCD display:

* VCC → 5V

* GND → GND

* SDA → A4

* SCL → A5

Connect the LEDs

Connect the LEDs using 220Ω resistors:

* Green LED → Pin 2

* Yellow LED → Pin 3

* Red LED → Pin 4

Connect all LED cathodes to GND.

Connect the Buzzer

* Positive (+) → Pin 5

* Negative (-) → GND

Upload the Arduino Code

Upload the provided Arduino code to your Arduino Uno using the Arduino IDE.

After uploading, the LCD will display a welcome screen and then start monitoring distance in real time.

Test the System

Move an object toward the ultrasonic sensor and observe:


* Green LED for safe distance

* Yellow LED for caution

* Red LED for danger

* Increasing buzzer speed as the object gets closer

* Distance information displayed on the LCD

Final Result

Congratulations! 🎉

You have successfully built a Smart Distance Alarm System using Arduino.

This project demonstrates real-time distance measurement, visual status indication, and dynamic audio alerts, making it an excellent beginner-to-intermediate Arduino project.

Here is my video in youtube

Here is my GitHup page