Build an ultrasonic distance meter
Explore the wiring in 3D, follow the audio explainer, and program your Little Bird Uno.
Build a distance meter with the Little Bird Uno, an HC-SR04 sensor and a solderless breadboard. Follow the interactive assembly, then open the English program to continue.
Step 1 — Watch the complete build
Watch the complete assembly, or use the individual interactive steps below to follow along at your own pace.
Loading assembly…
This guide is interactive. Drag to rotate the three D view, and scroll to zoom. Place the Little Bird Uno beside the breadboard, with USB disconnected. Connect the Uno five volt pin to hole five on the upper positive rail. Connect ground to hole five on the upper negative rail. The labels point to each connection. Place the distance sensor facing the object you want to measure. Its four pins are V C C, trigger, echo, and ground. Use female to male jumper wires. Connect sensor V C C to hole twenty four on the upper positive rail. Connect sensor ground to hole twenty five on the upper negative rail. Connect digital pin seven on the Uno to trigger, using the blue wire. Connect digital pin six to echo, using the green wire. Rotate the view to inspect both ends. Now connect USB. Push the square USB B plug into the Uno, then connect the flat USB A plug to your computer. In the next step, upload the program. Keep the serial plotter at one hundred and fifteen thousand, two hundred baud, and move an object in front of the sensor.
Step 2 — Set up the workbench
This is an interactive 3D guide. Drag to rotate the view, scroll to zoom, and click a component to inspect it. Keep the Uno disconnected from USB while you build.
Step 3 — Prepare the rails
Connect Uno 5V to hole 5 on the upper + rail using a red male-to-male jumper. Connect Uno GND to hole 5 on the upper − rail using a black jumper. Press Play to see each wire connect in turn.
Step 4 — Add the distance sensor
Place the HC-SR04 with both transducers facing the object to measure. Use female-to-male jumpers on its four header pins.
Step 5 — Power the sensor
Connect VCC to the upper + rail and GND to the upper − rail with female-to-male jumpers. The HC-SR04 uses the Uno’s 5V supply.
Step 6 — Connect trigger and echo
Use female-to-male jumpers: D7 → TRIG and D6 → ECHO. Direct signal connections keep the circuit easy to follow and match the downloadable sketch.
Step 7 — Connect USB and try it
Check the wiring, then connect a USB-A to USB-B data cable: square USB-B plug into the Uno, rectangular USB-A plug into your computer. In the next step, upload the program and open the serial plotter at 115200 baud. Move a flat object in front of the sensor.
Loading assembly…
Now connect USB. Push the square USB B plug into the Uno, then connect the flat USB A plug to your computer. In the next step, upload the program. Keep the serial plotter at one hundred and fifteen thousand, two hundred baud, and move an object in front of the sensor.
Step 8 — Program the Uno
Connect the Uno by USB, choose Pair board, then Upload. The editor below is live: you can read the English instructions, inspect the generated code, and open Serial Monitor without leaving this guide.
Step 9 — Measure and explore
Move a flat object in front of the sensor and watch the distance change. Your Arduino connection is shared with the editor above. If you have not connected yet, choose Connect device. Keep the baud rate at 115200.
Parts List
Required Parts (6)
Four female-to-male jumpers for the sensor header
x1
$2.20
In stock
Two male-to-male jumpers for the breadboard power rails
x1
$2.20
In stock
USB-A to USB-B data cable connects the Uno to your computer
x1
$2.00
In stockProject Summary
6 parts total
Unavailable items will be skipped