Skip to content

This Arduino project demonstrates how to use an ESP32 development board with an HC-SR04 ultrasonic sensor to measure distance and display the results on a 0.96-inch OLED display. The HC-SR04 sensor uses sonar to calculate the distance to an object by measuring the time it takes for an ultrasonic pulse to travel to the object and back.

Notifications You must be signed in to change notification settings

sahilgoti/ultrasonic_oled_esp32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

ESP32 Ultrasonic Distance Measurement with OLED Display

Description

This Arduino project demonstrates how to use an ESP32 development board with an HC-SR04 ultrasonic sensor to measure distance and display the results on a 0.96-inch OLED display. The HC-SR04 sensor uses sonar to calculate the distance to an object by measuring the time it takes for an ultrasonic pulse to travel to the object and back.

Features

  • Real-time distance measurement
  • OLED display for easy readout
  • Arduino IDE compatible

Components Used

  • ESP32 development board
  • HC-SR04 ultrasonic sensor
  • 0.96-inch OLED display
  • Jumper wires

Instructions

  1. Connect the components as per the provided schematic.
  2. Install the necessary libraries in the Arduino IDE.
  3. Upload the provided code to the ESP32.
  4. Observe the distance measurements displayed on the OLED screen.

Code

The Arduino sketch (main.ino) contains the code for reading the sensor data and displaying it on the OLED display.

Circuit

ckt.png

About

This Arduino project demonstrates how to use an ESP32 development board with an HC-SR04 ultrasonic sensor to measure distance and display the results on a 0.96-inch OLED display. The HC-SR04 sensor uses sonar to calculate the distance to an object by measuring the time it takes for an ultrasonic pulse to travel to the object and back.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages