If what you're looking for is missing, call us — we'll help you find it

Electronics Projects

Ultrasonic Distance Meter

Measure distance with an HC-SR04 and show it on a 16×2 LCD.

Ultrasonic Distance Meter — main component

Overview

The HC-SR04 gives a time-of-flight reading; the board converts it to centimetres and prints it on the LCD.

Build Steps

  1. Wire the sensor

    Connect VCC, GND, Trig to an output and Echo to an input.

  2. Add the display

    Wire the LCD's I2C backpack and run an I2C scanner to confirm its address.

  3. Time the pulse

    Hold Trig high for 10 µs, time Echo, multiply by the speed of sound and halve it.

  4. Smooth the reading

    Average the last few readings to remove jumps.

Related Projects