Digital distance measuring device using ultrasonic sensor SR04, OLED display and Arduino


In this project i will explain how to interface SR04 ultrasonic sensor module with Arduino and display result on OLED display.



SR04 Ultrasonic sensor module

OLED display i2c

Wires and basic tools

Circuit Diagram:


  1. Connect SR04 ultrasonic sensor power to arduino +5v and GND also connect Trigger and Echo pin to arduino pin 9 and pin 8 as shown in above circuit diagram.
  2. In same way connect OLED power to arduino and connect SCL & SDA of oled display to arduino pin A5 and pin A4.
  3. Download arduino code and all libraries form download section, compile the code and upload it to your arduino.
  4. If you are new to ultrasonic sensors, do visit this post for basic study “SR04 Ultrasonic Sensor Module Basics”




SR04 Ultrasonic Sensor Module Basics

SR04 Ultrasonic Module Library 

Adafruit GFX Library

Adafruit_SSD1306 OLED Library

Arduino Code

Leave a Reply

Your email address will not be published. Required fields are marked *