Technologies K–10 · Years 9–10

An ultrasonic distance sensor and the speed of sound

Engineering focus area (NSW Industrial Technology 7–10, 2019); Design and Technologies: Knowledge and understanding, Technologies context: Engineering principles and systems (ACARA v9); Digital Technologies: Processes and production skills, Acquiring, managing and analysing data (ACARA v9)

Practical, model not builtLow risk

This site has no interactive model of its own. Where a step or a material names a Concept Studio model, simulation or tool, it has not been built; an external simulation a step names (for example PhET) is not part of this site.

The idea

An ultrasonic sensor times an echo, and distance = speed of sound × time ÷ 2, so the sensor's accuracy depends on using the speed of sound for the air temperature.

What you need

  • Arduino Uno (or compatible) and USB cable
  • HC-SR04-type ultrasonic module (5 V), jumper wires, breadboard
  • Metre ruler, a flat board as the target, thermometer
  • Spreadsheet

How to do it

  1. Wire the module: VCC to 5 V, GND to GND, trigger and echo to two digital pins.
  2. Program: send a 10 µs trigger pulse, measure the echo pulse with pulseIn, and print the time in microseconds.
  3. Place the board at 10, 20, 30 up to 100 cm and record the echo time 5 times at each distance.
  4. Plot echo time against distance, find the gradient, and work out the speed of sound (gradient = 2 ÷ speed).
  5. Measure the air temperature and compare with the speed from the temperature formula.
  6. Build a parking sensor with green, amber and red LEDs at chosen distances, and justify the thresholds.

What you should see

At 20 °C sound travels at 343.2 m/s, so a target 1.000 m away returns an echo after 5.827 ms (5.827 µs per mm of distance). The graph is a straight line whose gradient gives the speed of sound, and comparing it with the temperature formula shows the size of the measurement error. At 10 °C the speed is 337.3 m/s and at 30 °C 349.0 m/s. Code that assumes 340 m/s reads 0.94% short at 20 °C, 9.4 mm at 1 m. The learner knows it worked when the measured speed is close to the value for the measured air temperature and the parking LEDs switch at the chosen distances.

What changes

What you change
target distance (10 to 100 cm)
What you measure
echo time (µs)
What you keep the same
  • the same flat target square to the sensor
  • the same room temperature
  • 5 readings per distance

Common misconceptions

Each of these ideas is wrong, and the activity is a chance to test it.

  • The sensor measures distance directly (it measures time).
  • The echo time is the time to reach the target (it is there and back, so it is halved).
  • The speed of sound is fixed (it rises with air temperature).

Safety card

Low riskLearners carry it out

Hazards

  • Mis-wiring the 5 V supply
  • Tripping over USB leads

Controls

  • Check wiring before connecting USB; USB power only
  • Leads kept along the bench

Note

No chemicals or heat. Record the activity on RiskAssess (riskassess.com.au).

Curriculum references

The NSW syllabus outcomes and Australian Curriculum v9 codes this activity supports. They are references, not a verified or complete curriculum alignment.

  • Industrial Technology 7–10 Syllabus (2019), NESA. Current; its Engineering courses are not available after December 2028. Code read from the official syllabus document (DOCX) on 2026-09-22.IND5-7
  • Engineering Technology 7–10 Syllabus (2024), NESA. Implementation from 2027, so this code describes the future syllabus. Code read from the outcomes page on 2026-09-22.EGT5-MEA-01
  • Computing Technology 7–10 Syllabus (2022), NESA. Current elective syllabus. Code read from the outcomes page on 2026-09-22.CT5-OPL-01
  • Australian Curriculum v9AC9TDE10K03AC9TDI10P01

Sources

The pages the author read to write this activity.

  1. curriculum.nsw.edu.au/learning-areas/tas/computing-technology-7-10-2022/outcomes
  2. curriculum.nsw.edu.au/learning-areas/tas/engineering-technology-7-10-2024/outcomes
  3. www.nsw.gov.au/education-and-training/nesa/curriculum/tas/industrial-technology-7-10-2019
  4. www.teachengineering.org/lessons/view/mis-2227-ultrasonics-uses-arduino-ultrasound-technology
  5. www.teachengineering.org/activities/view/nyu_soundwaves_activity1
  6. hyperphysics.phy-astr.gsu.edu/hbase/Sound/souspe.html
  7. docs.arduino.cc/language-reference/en/functions/advanced-io/pulseIn

All Concept Studio activities