Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Arduino Interactive Obstacle Detection System

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.


Features

  • 📏 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

Hardware

  • 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

Libraries

  • LiquidCrystal_I2C
  • IRremote
  • EEPROM
  • Wire

System Overview

The system continuously measures the distance between the ultrasonic sensor and nearby objects.

Normal Mode

  • Displays the measured distance on the LCD.
  • User can switch between centimeters and inches.
  • Green LED brightness automatically adjusts based on ambient light.

Warning Mode

When an object is within the warning distance:

  • Warning message is displayed.
  • Yellow LED blinks faster as the object gets closer.

Lock Mode

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.

Menu System

The IR remote allows navigation through three menu pages:

  1. Distance Display
  2. Reset Settings
  3. Ambient Light (Photoresistor) Monitor

Available functions:

  • Previous Menu
  • Next Menu
  • Change Distance Unit
  • Reset Saved Settings

Project Structure

images/
interactive_obstacle_detection_system/interactive_obstacle_detection_system.ino
README.md

What I Learned

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

Future Improvements

  • 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

Circuit & Wiring

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

Tinkercad Notes

Note

The Tinkercad simulation differs slightly from the physical implementation:

  • The simulation uses a standard 16×2 parallel LCD with the LiquidCrystal library instead of an I2C LCD with the LiquidCrystal_I2C library.
  • 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.

License

This project is licensed under the MIT License.

Author

Ryan Hugh