Skip to content

RifatParadoxical/Arduino-Ultrasonic-Distance-Meter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Arduino-Ultrasonic-Distance-Meter

An Arduino-based Distance Meter using HC-SR04 Ultrasonic Sensor and I2C LCD. Features a dynamic buzzer alarm that beeps faster as objects get closer.

✨ Features

  • Accurate Sensing: Range within 2 to 334.75, not crossing 334.75, tested!
  • Dynamic Buzzer: Buzzer sounds as the object came closer.

🛠️ Components Needed

  • Arduino Uno
  • HC-SR04 Ultrasonic Sensor
  • I2C LCD Display (16x2)
  • Piezo Buzzer
  • Breadboard & Jumper Wires

🔌 Circuit Connection

Component Arduino Pin
Ultrasonic Trig Pin 9
Ultrasonic Echo Pin 13
Buzzer (+) Pin 8
LCD SDA A4
LCD SCL A5
All VCC 5V
All GND GND

🚀 How to Run

  1. Clone this repository or download the .ino file.
  2. Install the Adafruit_LiquidCrystal library in your Arduino IDE.
  3. Upload the code to your Arduino Uno.
  4. Open the Serial Monitor or check the LCD for readings.

📝 Code Logic (The 'Map' Function)

আমরা map() ফাংশন ব্যবহার করেছি বিপ-সাউন্ডের বিরতি সেট করতে: int wait = map(distance, 2, 100, 50, 500);

  • 2cm distance = 50ms delay (Fast beep)
  • 100cm distance = 500ms delay (Slow beep)

📸 Screenshots

While Object available

While Object available...

While Object unavailable

while Object unavailable...

Circuit Diagram

Circuit Diagram

About

An Arduino-based Distance Meter using HC-SR04 Ultrasonic Sensor and I2C LCD. Features a dynamic buzzer alarm that beeps faster as objects get closer.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages