Lesson 1: Measure Distance with Sound
Wire the ultrasonic sensor, then read the distance to a book on your computer screen and check it against a ruler.
Everything for the bench, in the order you need it: set up the computer and the board, then the lessons. Keep this page open while you build.
Follow these 7 steps before Lesson 1. They take about 30-45 minutes and prove that your computer, cable and UNO all work - so if something goes wrong later, you know it is the wiring, not the setup.
Lessons 1-7 need only the kit, a computer and things from home such as a book and a ruler. Lesson 8 adds the OLED and needs two free libraries (and an adult only if the OLED has no pins). Lesson 9's battery demo needs a 9V battery, which is not in the box.
Safety: Small parts: keep them away from young children and pets.
Photos are the catalogue pictures of each part. Your parts may differ slightly in colour - go by the shape, the pins and the labels.
You should see: You have all 9 items listed below.
| Something is missing or broken | Send us a photo with your order number on WhatsApp. |
| You also need (not in the box) | For | Note |
|---|---|---|
| A computer (Windows, macOS or Linux) where you can install the free Arduino IDE 2 - or a Chromebook with the Arduino Cloud Editor | All lessons | |
| A free USB-A port, or an adapter, for the kit's USB cable | All lessons | |
| An internet connection, to download the IDE, the libraries and the code | Start here, Lesson 8 | |
| A ruler or tape measure, and a book or flat piece of card | Lessons 1-9 | |
| A cushion or jumper, a bottle and a pencil, to test targets | Lessons 4 and 6 | |
| A spreadsheet program (Google Sheets, Excel, LibreOffice) | Lesson 5 - optional | |
| A 9V battery | Lesson 9 battery demo - optional | Not included. The holder is in the box. |
| A 4-pin header and soldering | Lesson 8 - only if your OLED has no pins fitted | Adult only |
| A multimeter | Optional | No lesson needs one. Useful for an adult checking 5V and GND. |
You should see: You have a computer, a free USB port, an internet connection, a ruler and a book.
You should see: The Arduino IDE opens with a new, empty sketch that contains setup() and loop().
| The download or install is blocked | School and work computers often block installs. Ask an adult or use a home computer. |
Safety: Put the UNO on a dry table, away from coins, paper clips and other metal - they can touch the pins underneath and cause a short.
You should see: A small power light on the UNO (marked ON or PWR) lights up. The light marked L may already be blinking - some boards come with Blink loaded.
| No light at all | Push the plug fully into the UNO. Try another USB port, then another cable. |
You should see: The bottom of the IDE window shows "Arduino Uno" and your port.
| The Port menu is greyed out or empty | Some USB cables only charge and carry no data. Try the kit's cable in another port, or another data cable. |
| Windows shows "USB2.0-Serial" or an unknown device | Look at the small chip next to the UNO's USB socket. If it says CH340, the computer needs the free CH340 driver - ask us on WhatsApp and we'll send the link. |
| Mac: no new port appears | Do the same CH340 check. After installing a driver, you may need to allow it in System Settings → Privacy & Security. |
| Linux: "permission denied" on the port | Ask an adult to add your user to the dialout group (sudo usermod -a -G dialout $USER), then log out and back in. |
You should see: The small light marked L (next to pin 13) blinks: 1 second on, 1 second off.
Try it: Change both delay(1000) lines to delay(200) and upload again. The L light blinks five times faster. Now you know you can change code and upload it.
| "can't open device" or "Access is denied" | The port is busy or wrong. Close other Arduino windows, choose the port again (step 5) and try again. |
| "programmer is not responding" | The wrong board or port is selected, or the cable carries no data. Check step 5 and try another cable. |
| A red "Compilation error" | The example was changed by accident. Close it without saving and open Blink again from File → Examples. |
| "Done uploading" but L doesn't change | Your board may already have been running Blink. Do the change below (delay 200) and look for faster blinking. |
You should see: You are ready to build.
Open Lesson 1 → Printable manualEvery lesson runs on screen with the same code and pins. It is a good way to check your code - but it is not the real breadboard:
Most problems are one wire in the wrong hole. Check these first:
Open the troubleshooting table for this step →
Hi DIY KIT, I'm stuck on the Arduino Ultrasonic Distance & Parking Learning Kit. Lesson: __ Step number: __ What should happen: __ What happens instead: __ Error message (copied exactly): __ I'll attach a photo of my wiring.
Every one is built from the parts in the box, plus the basics listed under You'll also need.
Free with this kit · print or PDF The complete kit manual Everything on this page, ready for the bench: a parts checklist, wiring tables and step-by-step instructions for every project. 9 step-by-step guides Parts checklist QR to every project Open the manualWire the ultrasonic sensor, then read the distance to a book on your computer screen and check it against a ruler.
Add three LEDs that act like a traffic light for distance: green when it is far, yellow when it gets close and red when it is near.
Add the buzzer to make a desk-size parking sensor: slow beeps when something is near, fast beeps when it is very close.
Find out where the sensor fails: too close, too far, too soft or at an angle. The LEDs and the Serial Monitor count each kind of reading.
Turn the UNO into a measuring instrument: type the ruler distance and it prints the average, error and spread of 10 readings, ready for a spreadsheet.
Fire 20 pings at different targets - flat, soft, round, thin, tilted - and count how many echoes come back. Find out what the sensor finds hard to see.
Draw three lines on a live graph - raw, average and median - and see which filter handles a sudden spike best.
Show the distance in big numbers on the small OLED screen, with the zone and a bar graph. You will install your first Arduino libraries.
Run everything at once - LEDs, beeper, median filter and OLED - and control it with typed commands. Then run it from a 9V battery.
No projects in that group.
Start here sets up your computer. Then 9 lessons build one tabletop distance station step by step: each lesson adds a part or an idea and keeps the wiring from the one before. Every lesson page has a connection diagram, a wiring table, numbered steps, the code, what you should see and a fix-it table.
Time an ultrasonic echo with pulseIn(), turn it into centimetres, and check the sensor against a ruler: error and spread.
Show distance zones with green, yellow and red LEDs, slow and fast beeps, and big numbers on the OLED.
Find the blind zone, see soft and tilted targets go missing, and smooth noisy readings with an average and a median.
| Distance | LED | Buzzer | Zone |
|---|---|---|---|
| 50 cm or more | Green | Silent | CLEAR |
| 20 to 49 cm | Yellow | Silent | CAUTION |
| 10 to 19 cm | Red | Slow beeps | NEAR |
| Under 10 cm | Red | Fast beeps | CRITICAL |
| No echo | Yellow blinking | Silent | NO_ECHO - unknown, not clear |
Desk-size learning zones, not vehicle clearances or safety limits. They are named at the top of each sketch (CLEAR_CM, NEAR_CM, CRITICAL_CM), so you can change them.
| Part | UNO pin | Lessons |
|---|---|---|
| Red / yellow / green LED (each through 220 ohm) | 5 / 6 / 7 | 2, 3, 4, 9 |
| Active buzzer I/O | 8 | 3, 4, 9 |
| HC-SR04 TRIG / ECHO | 9 / 10 | All |
| OLED SDA / SCL | A4 / A5 | 8, 9 |
| All VCC and GND pins | 5V and GND rails | All |
| Type | What it does |
|---|---|
| help | Shows the list of commands. |
| status | Running or paused, sound on or off, and whether the OLED was found. |
| scan | Lists the I2C addresses that answer - the OLED is 0x3C or 0x3D. |
| run / pause | Starts or stops measuring; pause turns every output off. |
| sound on / sound off | Turns the beeps on or off; the LEDs keep working. |
| test | Lights red, yellow and green in turn and beeps once. |
Serial Monitor at 9600 baud with "New Line" selected.
The HC-SR04 measures about 2 cm to 4 m, but only when the echo comes back. Soft, thin, round or tilted targets can return no echo even when they are right in front of it - Lessons 4 and 6 show this. Readings also change slightly with temperature, because the speed of sound does. Lesson 5 measures your own sensor's error against a ruler.
Wiring design-reviewed; all 9 sketches compile for the Arduino UNO with no warnings and run in the kit simulator. The complete physical assembly has not been bench-tested. Parts may differ slightly from the photos - go by the labels printed on your parts.
Tick steps off as you go — your place is kept on this device.
One sketch per project, written for the boards in this kit. Open a project to read it with its wiring, or copy it there.
We use cookies that the shop needs to work — signing in, your cart, form security. We also measure how the shop is used so we can stock the right parts and fix what is broken. Choose “Only essential” and we will not load Google Analytics or the Meta pixel, and will not record your visit. Read more.