An interactive obstacle detection system built using an Arduino Uno. The project continuously measures the distance to nearby objects using an HC-SR04 ultrasonic sensor and provides visual feedback through LEDs, a 16×2 I2C LCD, and an intelligent menu system controlled by an IR remote.
Unlike a simple distance meter, this project includes multiple operating modes, persistent user settings using EEPROM, automatic brightness adjustment, and a lock mode for very close obstacles.
- 📏 Real-time obstacle distance measurement using an HC-SR04 ultrasonic sensor
- 📺 16×2 I2C LCD interface
- 🎮 IR remote-controlled menu navigation
- 📐 Switch between centimeters and inches
- 💾 Distance unit stored in EEPROM after power-off
- 🚨 Warning mode when an object is within the warning range
- 🔒 Lock mode when an object is extremely close
- 💡 Automatic LED brightness adjustment using a photoresistor
- 🟢🟡🔴 Three-color LED status indication
- ⚡ Interrupt-based ultrasonic measurement for responsive distance sensing
- 📉 Distance smoothing to reduce sensor noise
- 🔘 Push button and IR remote used to unlock the system
- Arduino Uno
- HC-SR04 Ultrasonic Sensor
- 16×2 I2C LCD
- IR Receiver Module
- IR Remote Controller
- Photoresistor (LDR)
- Red LED
- Yellow LED
- Green LED
- Push Button
- Breadboard
- Jumper Wires
- LiquidCrystal_I2C
- IRremote
- EEPROM
- Wire
The system continuously measures the distance between the ultrasonic sensor and nearby objects.
- Displays the measured distance on the LCD.
- User can switch between centimeters and inches.
- Green LED brightness automatically adjusts based on ambient light.
When an object is within the warning distance:
- Warning message is displayed.
- Yellow LED blinks faster as the object gets closer.
When an object is extremely close:
- LCD displays a warning message.
- Red and yellow LEDs flash.
- The system remains locked until the user presses the push button or the Play/Pause button on the IR remote.
The IR remote allows navigation through three menu pages:
- Distance Display
- Reset Settings
- Ambient Light (Photoresistor) Monitor
Available functions:
- Previous Menu
- Next Menu
- Change Distance Unit
- Reset Saved Settings
images/
interactive_obstacle_detection_system/interactive_obstacle_detection_system.ino
README.md
This project helped me gain practical experience with:
- Interrupt programming on Arduino
- State machine design
- EEPROM data storage
- Debouncing push buttons
- IR remote communication
- LCD menu system design
- Sensor data filtering
- Non-blocking programming using
millis() - Modular code organization using functions and enums
- Add buzzer sound feedback
- OLED graphical display
- Servo-based object scanning
- Multiple ultrasonic sensors
- Bluetooth or Wi-Fi monitoring
- Mobile application interface
- Adjustable warning and lock thresholds from the menu
The complete circuit, wiring, and component layout for this project are available in the Tinkercad simulation.
Tinkercad Project: https://www.tinkercad.com/things/8WyN99pmPCm-interactiveobstacledetectionapplication
Note
The Tinkercad simulation differs slightly from the physical implementation:
- The simulation uses a standard 16×2 parallel LCD with the
LiquidCrystallibrary instead of an I2C LCD with theLiquidCrystal_I2Clibrary. - A 10 kΩ potentiometer is used to adjust the LCD contrast in the simulation, whereas the physical implementation uses an I2C LCD module with a built-in contrast adjustment.
- In the Reset Saved Settings menu, the CH button on the physical IR remote is replaced by the ON/OFF button in the Tinkercad simulation.
This project is licensed under the MIT License.
Ryan Hugh