Thursday, December 26, 2024

Make A Digital Distance Meter With Arduino

This is a very simple digital distance meter, which you can add to your water-level indicator circuit to show water level in a tank, or use it for a school/college project. The author’s prototype is shown in Fig. 1.

Author’s prototype for Digital Distance Meter
Fig. 1: Author’s prototype for Digital Distance Meter

Circuit diagram of the digital distance meter is shown in Fig. 2. It is built around Arduino Uno board, HC-SR04 ultrasonic sensor, Nokia 5110 LCD and 9V battery for power supply.

Circuit diagram of the digital distance meter
Fig. 2: Circuit diagram of the digital distance meter

Construction and testing

Connect the LCD, ultrasonic sensor and battery to the Arduino board as per circuit diagram. To test:

- Advertisement -
  1. Download and install Arduino IDE from www.arduino.cc/en/Main/Software
  2. Download the ultrasonic library from this link, and Nokia 5110 LCD library from this link.
  3. Extract the libraries, and copy and paste them into Libraries folder of Arduino IDE.
  4. Connect Arduino to PC/laptop using USB cable. Open the source code (distance_meter.ino) from Arduino IDE. Select the proper board and COM port under Tools menu. Compile and upload the code to Arduino.
  5. Fix the sensor properly on the breadboard and point it towards the wall or large object whose distance you would like to measure. When HC-SR04 sensor detects the ultrasonic waves bouncing back from the object, you will get the distance between the sensor and the object on the LCD as well as on the serial monitor of Arduino IDE in centimetres.

To make it stand-alone, you can use a battery as shown in Fig. 2.

Parts List for Digital Distance MeterDownload Source Folder: click here


Ashwini Kumar Sinha is an electronics hobbyist and tech journalist at EFYi

2 COMMENTS

SHARE YOUR THOUGHTS & COMMENTS

EFY Prime

Unique DIY Projects

Truly Innovative Electronics

Electronics News

Latest DIY Videos

Electronics Components

Electronics Jobs

Calculators For Electronics