Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Arduino Distance Sensor

An Arduino-based real-time distance alert system that uses an ultrasonic sensor, vibration motor, and LEDs to detect nearby objects and trigger alerts. Built with C++ and designed for simple detection applications such as obstacle avoidance.

πŸš€ Features

  • πŸ“‘ Ultrasonic Distance Measurement

    • Uses an HC-SR04 ultrasonic sensor to measure distance
    • Calculates object distance with precise timing
  • ⚠️ Real-Time Alerts

    • Triggers visual and physical alerts when an object is detected within 60 cm
    • Activates a vibration motor and LED indicators to notify users instantly
  • πŸ”Œ Pin Control and I/O Management

    • Configures digital pins to interface with input and output components
    • Utilizes pinMode, digitalWrite, and pulseIn for precise hardware control
  • 🧠 Conditional Logic

    • Implements simple threshold-based logic in C++
    • Activates alert components only when the measured distance falls below the set range

πŸ›  Technologies & Components Used

  • Arduino Uno
  • C++
  • HC-SR04 Ultrasonic Sensor
  • Vibration Motor
  • LEDs
  • Breadboard & Jumper Wires

βš™οΈ How It Works

  1. Sends a trigger pulse from the Arduino to the ultrasonic sensor
  2. Measures the time for the echo pulse to return
  3. Calculates the distance based on the speed of sound
  4. If distance < 60 cm:
    • Activates the vibration motor
    • Lights up the red LED
    • Deactivates alert if object moves out of range (green LED turns back on)

About

Arduino Code to sense when objects are near and alert user. Uses ultrasonic sensor, vibration motor, LEDs, etc.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages