Skip to Content
★
4.9/5 Rating Rated by 800+ Customers on Google
🚚
Free Delivery Above ₹499 On eligible online orders
📍
Pan India Delivery Delivery across India
🛠
Built for Makers Robotics • Electronics • DIY
🎓
Student Friendly Perfect for projects & learning
🚀
Startup India Recognized Recognized startup company
🏬
Physical + Online Store Visit us in Pimpri or shop online
★
4.9/5 Rating Rated by 800+ Customers on Google
🚚
Free Delivery Above ₹499 On eligible online orders
📍
Pan India Delivery Delivery across India
🛠
Built for Makers Robotics • Electronics • DIY
🎓
Student Friendly Perfect for projects & learning
🚀
Startup India Recognized Recognized startup company
🏬
Physical + Online Store Visit us in Pimpri or shop online

Arduino Ultrasonic Distance Meter DIY Kit

                                 Price

🚚 FREE Delivery on Orders Above ₹499
📦 Pan India Delivery


₹ 761.86 ₹ 761.86 ₹ 1,499.00
(Tax included)

Barcode: 10152015

ROBOGEARS DIY · 10152015 · PRE-PROGRAMMED

Arduino Ultrasonic Distance Meter DIY Kit

Build it. Move an object. Watch the distance change.

LEARN BY BUILDING

Move an object. See the distance.

Build a USB-powered distance meter and discover how an Arduino reads an ultrasonic sensor and displays measurements on an OLED.

Measure automatically

Aim the HC-SR04 at a flat object. The display updates continuously in centimetres as you move the object. No measurement button is required.

Start with a programmed board

Your UNO SMD compatible board arrives pre-programmed. Follow the assembly and wiring steps; a computer is optional for normal operation.

Build without soldering

The OLED pins arrive soldered. Use the supplied 170-point mini breadboard and ten male-to-male jumper wires to connect the modules.

Before you begin

Arrange a suitable USB power source. This is an educational demonstration kit. A mounting base is optional; use your own cardboard sheet if desired.

USB powered20 cm cable supplied Pre-programmedReady for assembly 0.96-inch OLEDReadings in centimetres

Check your kit

Lay out the components before you begin. All ten jumper wires are used in the shared-power arrangement described here.

Distance meter kit contents: UNO SMD, HC-SR04, OLED, 170-point breadboard, USB cable and ten male-to-male jumpers
What’s included · Tap or click to enlarge
ItemQuantity / details
UNO-compatible SMD board1 — Pre-programmed
HC-SR04 ultrasonic sensor1 — Distance sensing
0.96-inch I²C OLED1 — 128 × 64; pins soldered
170-point mini breadboard1 — Black; solderless
USB-A to USB-B cable1 — 20 cm
Male-to-male jumper wires10 — Breadboard connections
Arrange separately

A suitable USB power source. A USB adapter, batteries, mounting base, enclosure, adhesive and mounting hardware are not included. No loose male header strip, external LEDs or buzzer are included.

The supplied breadboard is the 170-point mini version. Larger breadboards and PVC bases seen in reference assemblies are not supplied. You can use your own cardboard sheet as an optional base.

Build your distance meter

Follow these steps in order. Disconnect USB before making or changing any connection.

Six-step assembly guide for the UNO, HC-SR04 and OLED on a 170-point breadboard
Assembly guide · Tap or click to enlarge
  1. Check the parts

    Lay out the six component groups listed above. Keep the USB cable disconnected throughout assembly. Identify the labels on the HC-SR04 and OLED before inserting either module.

  2. Place the modules

    Insert the sensor and OLED into the 170-point breadboard with each pin in its own connected five-hole group. Keep the sensor faces clear and the display visible. Do not place two different module pins in the same connected group.

  3. Make a shared 5V connection

    Choose one unused five-hole group on one side of the centre gap. Use three jumpers: UNO 5V → this group; this group → HC-SR04 VCC; this group → OLED VCC. At the module end, insert the jumper in a free hole connected to that module’s VCC pin.

  4. Make a separate GND connection

    Choose a different unused five-hole group. Use three jumpers: UNO GND → this group; this group → HC-SR04 GND; this group → OLED GND. Keep the 5V group completely separate from the GND group.

  5. Connect four signal wires

    Use the four remaining jumpers: HC-SR04 TRIG → UNO D9; HC-SR04 ECHO → UNO D10; OLED SDA → UNO A4; OLED SCL → UNO A5. Connect through free holes in the same groups as the matching module pins.

  6. Check and power on

    Check all connections against the guide below. Make sure no loose pins or wires can touch. Connect the USB-B end to the UNO and the USB-A end to your USB power source. Measurement starts automatically.

  7. Try a simple demonstration

    Aim the sensor at a flat, rigid target such as a book cover. Move the target gradually and watch the reading change. For a ruler comparison, measure from the sensor’s front faces. Disconnect USB to switch off.

Keep each connection separate

Every module pin needs its own connected five-hole group. Connect a jumper through a spare hole in the same group as its matching pin. Do not short different module pins together.

Optional: support the project on your own cardboard base. Keep the UNO’s underside away from metal, the sensor faces unobstructed and the OLED visible.

Connect by pin label

Read the printing on each module. Wire colours are only visual aids; follow the pin names.

HC-SR04 TRIG to D9, ECHO to D10, OLED SDA to A4, SCL to A5, with shared 5V and GND
Wiring diagram · Tap or click to enlarge
Module connectionArduino connection
HC-SR04 VCCUNO 5V via shared 5V group
HC-SR04 GNDUNO GND via shared GND group
HC-SR04 TRIGUNO D9
HC-SR04 ECHOUNO D10
OLED VCCUNO 5V via shared 5V group
OLED GNDUNO GND via shared GND group
OLED SDAUNO A4
OLED SCLUNO A5
Two separate power groups

UNO 5V → shared group → sensor VCC + OLED VCC
UNO GND → separate group → sensor GND + OLED GND

10 jumpers in total

Use three jumpers for the 5V connections, three for GND, and four for the signal connections. Never join the 5V group to the GND group.

The 170-point breadboard has no side power rails. Five holes within each row on one side of the centre gap connect together; the other side is a separate group.

First power-on & measurement

Keep the assembly on a clean, dry, non-conductive surface. Check all wiring before connecting USB.

1. Connect USB

Plug the USB-B connector into the UNO and the USB-A connector into your USB power source. The pre-programmed board begins measuring automatically; no button is needed.

2. Use a simple target

Aim the sensor at a flat, rigid object such as a book cover or stiff cardboard. Hold it facing the sensor and keep your wires still.

3. Move and compare

Move the target gradually and observe the centimetre reading. If comparing with a ruler, measure from the front faces of the ultrasonic transducers, not the edge of your base.

4. Understand a zero reading

When the supplied program receives no echo before timing out, it calculates zero. This is not a real measurement of zero centimetres. Check the target and connections if it persists.

Educational demonstration

No tested minimum range, maximum range or accuracy guarantee has been supplied for the assembled kit. Decimal places on the OLED do not establish measurement accuracy.

The supplied program waits 500 ms after each display update. Total refresh time also includes the echo measurement and display update. There is no external warning LED or buzzer.

Arduino code

Your board is already programmed. The supplied sketch below retains your original program logic and pin assignments.

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

#define TRIG 9
#define ECHO 10

long duration;
float distance;

void setup() {
  pinMode(TRIG, OUTPUT);
  pinMode(ECHO, INPUT);

  Serial.begin(9600);

  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    Serial.println("OLED not found");
    while(true);
  }

  display.clearDisplay();
}

void loop() {
  digitalWrite(TRIG, LOW);
  delayMicroseconds(2);

  digitalWrite(TRIG, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG, LOW);

  duration = pulseIn(ECHO, HIGH);

  distance = duration * 0.034 / 2;

  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(WHITE);

  display.setCursor(10, 10);
  display.print("Distance:");

  display.setCursor(30, 40);
  display.print(distance);
  display.print(" cm");

  display.display();

  delay(500);
}

Sensor: TRIG D9, ECHO D10. OLED: SDA A4, SCL A5; SSD1306, 128 × 64, address 0x3C.

Required libraries for optional reprogramming

The sketch uses Wire, Adafruit GFX Library and Adafruit SSD1306. Wire is included with the Arduino board software. Install the two Adafruit libraries and prompted dependencies through the Arduino IDE Library Manager before compiling.

Optional: upload the code again

Connect the UNO to your computer, select Arduino Uno and the matching port in Arduino IDE, open or paste this sketch, verify and upload. Uploading replaces the installed program. This is not needed for first assembly.

How the displayed reading works

The sketch measures echo duration and calculates distance using duration × 0.034 ÷ 2. A timed-out echo produces zero. Large fixed-size text can wrap for longer readings; preserve a copy before experimenting with display formatting.

Find and fix a problem

Select the symptom below. Disconnect USB before changing wiring.

OLED stays blank

Disconnect USB. Check VCC/GND, then SDA → A4 and SCL → A5. Check that each module pin and its jumper share a connected breadboard group. Reconnect power. If you changed the code, check the configured display type and address 0x3C.

Reading stays at zero

Check HC-SR04 power, TRIG → D9 and ECHO → D10. Aim the sensor at a flat object. Check loose jumpers and make sure different module pins are not shorted together in one breadboard group.

Reading changes unexpectedly

Keep the sensor and test object still. Try a larger, flatter target facing the sensor. Check for loose contacts and nearby objects in front of the sensor.

Nothing powers on

Check both USB connections and try another suitable USB source or known-working cable. Disconnect power before inspecting the wiring for an accidental short.

A library is missing during compilation

For optional reprogramming, install Adafruit GFX Library and Adafruit SSD1306 through the Arduino IDE Library Manager, including prompted dependencies.

Text or the unit wraps on the OLED

The supplied sketch uses large text at fixed positions. Longer values may wrap; this is a display-formatting issue. Keep a copy of the supplied sketch before changing text size or cursor positions.

Copy or download does not work

If copying is blocked, select the sketch and copy it manually. If the code becomes selected after clicking Copy, press Ctrl+C or use your device’s Copy command. The board is already programmed, so normal kit operation does not depend on these buttons.

Need more help?

Contact RoboGears through the contact option on this website. Share your order reference, a clear wiring photo with pin labels visible, and a description or short video of the OLED behaviour. Include error text if you changed the program.

Frequently asked questions

25 answers

Is the Arduino already programmed?

Yes. The included UNO-compatible SMD board comes pre-programmed for this distance meter. You do not need to upload code for the first assembly.

What does the project do?

It continuously measures the distance to a reflecting object and displays the reading in centimetres on the OLED. It is intended for educational demonstrations.

Is the display an LCD or an OLED?

The kit uses a 0.96-inch, 128 × 64 I²C OLED. A 16 × 2 LCD and separate LCD interface board are not included.

Do I need to press a button?

No. Measurement starts automatically when the correctly wired project receives USB power.

Does it show inches?

The supplied program displays centimetres only.

What does a zero reading mean?

In the supplied program, a zero reading means the sensor did not return an echo before the measurement timed out. It must not be interpreted as an actual zero-centimetre distance.

Which breadboard is included?

One black 170-point mini breadboard is included. Larger breadboards visible in reference assemblies are not supplied.

Is a mounting base included?

No. You can use your own cardboard sheet as an optional base. A PVC sheet, enclosure, mounting hardware and adhesive are not included.

Is soldering required?

No. The OLED pins arrive soldered. Assemble the kit using the supplied breadboard and male-to-male jumper wires.

How many jumper wires are included?

Ten male-to-male jumpers are included. The guide uses six for shared power and ground, and four for the signal connections.

How do male-to-male wires connect to the modules?

Insert the module pins into the breadboard. Insert each jumper into a spare hole in the same connected five-hole group as the matching module pin. The other end connects to the UNO or the shared power group.

How do both modules get power from one 5V pin?

Use one free five-hole breadboard group for 5V: connect the UNO 5V pin and the two module VCC connections to that group. Use a different group for the three GND connections.

Does the mini breadboard have power rails?

No. Use separate five-hole groups for power and ground. The five holes on each side of the centre gap are connected within that row; the gap separates the two sides.

Which pins are used by the ultrasonic sensor?

HC-SR04 VCC → UNO 5V, GND → GND, TRIG → D9 and ECHO → D10.

Which pins are used by the OLED?

OLED VCC → UNO 5V, GND → GND, SDA → A4 and SCL → A5. Follow the pin names printed on the supplied module.

Is a battery or USB adapter included?

No. The kit includes a 20 cm USB-A to USB-B cable. Supply your own suitable USB power source.

How do I switch the project off?

Disconnect USB power. No separate power switch is included.

Can I use it without a computer?

Yes. Once assembled, the pre-programmed board can run from a suitable USB power source without a computer. A computer is needed if you want to edit and upload the program.

Does it have a buzzer or warning LEDs?

No external buzzer or warning LEDs are included or used by the supplied program. The UNO’s onboard indicators are separate from distance measurement.

What object should I use for the first demonstration?

Use a flat, rigid object such as a book cover or a piece of stiff cardboard. Hold it facing the sensor and move it gradually while watching the display.

Where should I start measuring with a ruler?

Use the front faces of the ultrasonic transducers as the reference point for your demonstration, rather than the edge of your cardboard base.

Is a measurement range or accuracy guaranteed?

No verified range or accuracy specification is provided for this assembled kit. Use it to learn and demonstrate distance sensing, and compare readings with a ruler for your own experiments.

Can I change the Arduino program?

Yes. The supplied sketch is available in the code section with Copy code and Download .ino controls. Save a copy before making changes. Keep wiring and pin definitions consistent.

Which libraries does the code use?

Wire, Adafruit GFX Library and Adafruit SSD1306. Wire is part of the Arduino board software; install the two Adafruit libraries and any prompted dependencies through the Arduino IDE Library Manager if you want to upload the sketch.

What should I send when asking RoboGears for help?

Share your order reference, a clear photo showing all connections and printed pin labels, and a short video or description of the display behaviour. Include any compile or upload error text if you changed the program.

Image preview
Open full-size image in a new tab ↗
RoboGears · Learn electronics through hands-on building.
📍 Check estimated delivery
Enter your 6-digit pincode to see the estimated delivery window.
Google
Trusted by Makers,
Loved by Builders
Top Selling Products | RoboGears
🔥 Popular Right Now

Top Selling Products

Popular robotics and electronics components chosen by RoboGears customers.

View All Products →
🔥 BEST SELLER
ESP32 Development Board
ESP32 Dev Board
🔥 842+ Sold
₹420 incl. GST
🔥 BEST SELLER
Arduino UNO R3
Arduino UNO R3
🔥 1.1K+ Sold
₹280 incl. GST
⚡ POPULAR
300 RPM BO Motor
300 RPM BO Motor
🔥 500+ Sold
₹50 incl. GST
🔥 BEST SELLER
18650 Battery
18650 Battery
🔥 842+ Sold
₹60 incl. GST
🔥 BEST SELLER
IR Obstacle Sensor
IR Obstacle Sensor
🔥 1.1K+ Sold
₹35 incl. GST
🔥 POPULAR
HC-SR04 Ultrasonic Sensor
HC-SR04 Sensor
🔥 750+ Sold
₹95 incl. GST
⚡ POPULAR
4 Ohm 15W Speaker
4Ω 15W 2.5" Speaker
🔥 800+ Sold
₹235 incl. GST
⚡ POPULAR
ZK-TB21 Bluetooth Amplifier
ZK-TB21 Bluetooth Amplifier
🔥 551+ Sold
₹1,550 incl. GST
🔥 BEST SELLER
MQ-2 Gas and Smoke Sensor
MQ-2 Gas & Smoke Sensor
🔥 900+ Sold
₹130 incl. GST
🏆 #1 SELLER
Arduino UNO R3 DIP
UNO R3 DIP Development Board
🔥 2K+ Sold
₹480 incl. GST
⚡ POPULAR
MPU-6050 Sensor
MPU-6050 6-DOF Sensor
🔥 600+ Sold
₹195 incl. GST
🤖 POPULAR KIT
2WD Obstacle Avoiding Robot Kit
2WD Obstacle Avoiding Robot Kit
🔥 300+ Sold
₹1,550 incl. GST
🌱 DIY KIT
Arduino Smart Irrigation DIY Kit
Arduino Smart Irrigation DIY Kit
🔥 350+ Sold
₹649 incl. GST
🔥 POPULAR
SG90 9G Mini Servo
SG90 9G Mini Servo
🔥 3.2K+
₹120 incl. GST
⚡ POPULAR
9V Zinc Carbon Battery
9V Original Battery
🔥 5.1K+
₹25 incl. GST
🔥 BEST SELLER
MAX30102 Heart Rate SpO2 Module
MAX30102 Heart Rate & SpO2
🔥 400+
₹795 incl. GST
🔧 REPAIR KIT
150uF 420V Electrolytic Capacitor
Samsung 40" curved TV Backlight Set
🔥 100+
₹1700 incl. GST
🤖 PROJECT KIT
Dry Wet Metal Waste Segregator Kit
Waste Segregator Components Kit
🔥 450+
₹750 incl. GST
🔥 POPULAR
CA-502MT ZK-502MT Bluetooth Amplifier
CA-502MT Bluetooth Amplifier
🔥 500+
₹635 incl. GST
⚡ PREMIUM
ZK-AS21 TPA3255 Bluetooth Amplifier
ZK-AS21 TPA3255 Power Amplifier
🔥 550+
₹3,350 incl. GST
🔥 BEST SELLER
DT830D Digital Multimeter
DT830D Digital Multimeter
🔥 2.2K+
₹195 incl. GST
🔥 BEST SELLER
18650 2500mAh Lithium Ion Battery
18650 2500mAh Li-Ion Cell
🔥 1.4K+
₹120 incl. GST
⚡ POPULAR
Universal 3.7V Li-Ion Battery Charger
Universal Li-Ion Battery Charger
🔥 3.7K+
₹85 incl. GST
🔥 POPULAR
Belson 8 Inch 50W Woofer
Belson 8" 50W Woofer
🔥 450+
₹395 incl. GST
🔧 REPAIR PICK
32 Inch LED TV Backlight Strip
32" LED TV Backlight Strip
🔥 300+
₹80 incl. GST
🔧 REPAIR KIT
MI 50 Inch LED TV Backlight Strip Set
MI 50" LED TV Backlight Set
🔥 200+
₹685 incl. GST
🔒
Secure & Reliable
Safe payments & protected checkout
🚚
Free Delivery Above ₹499
On eligible online orders
🇮🇳
Pan-India Delivery
Robotics delivered across India