A small Arduino-based distance monitoring and alert system that provides real-time visual and acoustic feedback depending on the measured distance.
The system measures the distance to an object using an ultrasonic sensor and displays the current distance and status on an LCD1602 display.
Depending on the measured distance, the system provides different warning messages and acoustic signals. As the object gets closer, the warning becomes more urgent.
- Real-time distance measurement using an ultrasonic sensor
- Distance display on an LCD1602
- Serial output for monitoring measured values
- Multiple distance thresholds
- Different warning messages for each distance range
- Progressive acoustic alerts using a passive buzzer
- STOP warning when the object is too close
| Distance | Status | Alert | Frequency |
|---|---|---|---|
| > 50 cm | OK | No sound | - |
| ≤ 50 cm | Near | Slow beep | 500Hz |
| ≤ 40 cm | Close | Faster beep | 600Hz |
| ≤ 30 cm | Closer | Faster alert | 700Hz |
| ≤ 20 cm | Very close | More frequent alert | 700Hz |
| ≤ 15 cm | Extremely close | High-frequency alert | 700Hz |
| ≤ 10 cm | STOP | Continuous high-frequency alert | 1000Hz |
- Elegoo UNO R3 Controller Board
- Elegoo Solderless Breadboard
- Ultrasonic Sensor
- LCD1602 Module
- Passive Buzzer
- Jumper wires
- C/C++
- Arduino
- Arduino LiquidCrystal library
- Digital I/O
- Ultrasonic distance measurement
- Serial communication
- LCD control
- Acoustic feedback
The ultrasonic sensor sends a short trigger pulse and measures the time required for the reflected signal to return.
The measured time is converted into distance:
distance = (duration × 0.0343) / 2
The program then compares the measured distance with predefined thresholds and changes the system response accordingly.
The LCD displays both the current status and measured distance, while the passive buzzer provides acoustic feedback.
This project was developed as a practical exercise in embedded programming, sensor integration and event-based control logic.
It demonstrates the use of programming logic to process real-world sensor input and produce immediate visual and acoustic output.

