• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Hire Me | Contact | Calculators-online
You are here: Home / Arduino Projects / Ultrasonic Distance Meter Circuit Using 16 x 2 LCD

Ultrasonic Distance Meter Circuit Using 16 x 2 LCD

Last Updated on May 14, 2026 by Swagatam 3 Comments

In this article I will show how to construct an ultrasonic distance meter circuit using Arduino and 16 x 2 LCD. We are also going to see what an ultrasonic module is, how it works and how it can be used to measure distance.

Table of Contents
  • What is ultrasonic?
  • Ultrasonic sensor:
  • Author’s prototype:
  • Circuit diagram:
  • Program Code:

What is ultrasonic?

An average healthy human being can hear frequencies ranging from 20 Hz to 20,000 Hz. Above 20,000Hz or 20 KHz human ear is incapable of detecting these frequencies. Any acoustic resonates greater than 20 KHz is called as ultrasonic and any acoustics resonates less than 20 Hz is called infrasonic.

Most of the domestic animals such cat or dog, can hear wide range of acoustic frequency greater than human beings. Some of our electronic devices may annoy them; that's why ultrasonic sound is being used in electronic mosquito repellents and also in dog repellents.

But many of the wild animals such as bats take advantage of ultrasonic, which helps them to determine the distance between the predator and prey. It has biological sensors which calculate the distance by emitting and receiving ultrasonic waves.

This principle is utilized in many modern electronic measuring equipment; I have explained how the same principle could be applied for the present project also.

Ultrasonic sensor:

We are going to use a special electronic device ultrasonic transceiver module HC-SR04 which is very popular and commonly available on e-commerce sites and electronic retail stores.

It consists of 4 pins Vcc, ground, trigger and echo. These pins are interfaced with arduino microcontroller.

It has a transmitter and receiver modules which look identical and are protected by aluminum cylinder and mesh at the opening of transmitter and receiver. The module also consists of microcontrollers which decodes echo signals.

To measure distance, we need to send series of ultrasonic bursts and listen for the echo. To do this we need to keep the trigger pin high for 10 microseconds, the transmitter sends out 8 pulses of ultrasonic bursts.

The receiver module listens to those bursts after hitting an obstacle. The echo pin gives out high signal proportional to the distance. The Arduino interpret the time of sent and received signals to determine the actual distance.

Since the sound travels at 340 m/s in air and the time can be determined by comparing sent and received signals, we can determine distance by using speed-distance formula:

Distance = speed x time

These values will be calculated by Arduino and print appropriate values on the 16 x 2 LCD display. The proposed ultrasonic distance meter circuit can show distance in centimeter as well as in meter.

Author’s prototype:

Tested working model of Ultrasonic Distance Meter Circuit Using 16x2 LCD

Circuit diagram:

Ultrasonic Distance Meter Circuit Using 16x2 LCD

The ultrasonic distance meter circuit connection is done through a standard arduino-LCD interface, which we can also find on many other similar arduino-LCD based projects. The potentiometer is used to adjust the contrast of LCD display.

The ultrasonic sensor can be directly inserted on analog pin as shown in author’s prototype from A0 to A3, sensors facing outwards; this may reduce wire congestion while duplicating the above circuit.

Program Code:

#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
const int trigger = A1;
const int echo = A2;
int vcc = A0;
int gnd = A3;
long Time;
float distanceCM;
float distanceM;
float resultCM;
float resultM;
void setup()
{
   lcd.begin(16,2);
  pinMode(trigger,OUTPUT);
  pinMode(echo,INPUT);
  pinMode(vcc,OUTPUT);
  pinMode(gnd,OUTPUT); 
}
void loop()
{
  digitalWrite(vcc,HIGH);
  digitalWrite(gnd,LOW);
  digitalWrite(trigger,LOW);
  delay(1);
  digitalWrite(trigger,HIGH);
  delayMicroseconds(10);
  digitalWrite(trigger,LOW);
  Time=pulseIn(echo,HIGH);
  distanceCM=Time*0.034;                
  resultCM=distanceCM/2;
  resultM=resultCM/100;
  lcd.setCursor(0,0);
  lcd.print("Distance:");
  lcd.print(resultM);
  lcd.print("M");
  lcd.setCursor(0,1);
  lcd.print("Distance:");
  lcd.print(resultCM);
  lcd.print("cm");
  delay(1000);
}

You'll also like:

  • H-Bridge Sine Wave Inverter Circuit using Arduino
  • How To Use And Program ATmega Microcontrollers From Scratch Without Arduino
  • Arduino programmable timer circuitArduino 2-Step Programmable Timer Circuit
  • Basic2Bjoystick 1How to Control Servo Motor Using Joystick

Filed Under: Arduino Projects Tagged With: 16x2, Distance, LCD, Meter, Ultrasonic

About Swagatam

I am an electronics engineer and doing practical hands-on work from more than 15 years now. Building real circuits, testing them and also making PCB layouts by myself. I really love doing all these things like inventing something new, designing electronics and also helping other people like hobby guys who want to make their own cool circuits at home.

And that is the main reason why I started this website homemade-circuits.com, to share different types of circuit ideas..

If you are having any kind of doubt or question related to circuits then just write down your question in the comment box below, I am like always checking, so I guarantee I will reply you for sure!

Previous Post: « Motorized Sun Shade Circuit
Next Post: 6 watt Audio Amplifier Circuit Using TDA1011 »

Reader Interactions

Questions & Answers

Total Posts: 3
Newest Oldest
Prasanta Pal
January 13, 2019 • 8 years ago #65023

Can we have a hold data button to the circuit??

Reply
Abhishek
August 20, 2017 • 9 years ago #52630

#include

this should be written as…

#include

Reply
Şeyma Hasdemir
June 10, 2016 • 10 years ago #41680

Very good but I dont understand which distance how is working

Reply

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

My YouTube Channel

Circuit Simulator: Draw and Simulate Schematics

circuit simulator image

Categories

  • Arduino Projects (95)
  • Audio and Amplifier Projects (134)
  • Automation Projects (18)
  • Automobile Electronics (104)
  • Battery Charger Circuits (90)
  • Datasheets and Components (109)
  • Electronics Theory (151)
  • Energy from Magnets and Earth (43)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (20)
  • Health related Projects (27)
  • Home Electrical Circuits (13)
  • Indicator Circuits (16)
  • Inverter Circuits (98)
  • Lamps and Lights (161)
  • Meters and Testers (72)
  • Mini Projects (28)
  • Motor Controller (68)
  • Oscillator Circuits (30)
  • Pets and Pests (15)
  • Power Supply Circuits (91)
  • Remote Control Circuits (50)
  • Security and Alarm (65)
  • Sensors and Detectors (107)
  • SMPS and Converters (46)
  • Solar Controller Circuits (62)
  • Temperature Controllers (44)
  • Timer and Delay Relay (51)
  • Voltage Control and Protection (44)
  • Water Controller (37)
  • Wireless Circuits (31)

Subscribe to get New Circuits in your Email

Other Links

  • Privacy Policy
  • Cookie Policy
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap

People also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Recent Comments

  • Swagatam on Electronic Circuit Projects, Tutorials, and Practical Engineering Solutions
  • Swagatam on Simplest Full Bridge Inverter Circuit
  • Amal on Simplest Full Bridge Inverter Circuit
  • Michael on Electronic Circuit Projects, Tutorials, and Practical Engineering Solutions
  • Swagatam on Electronic Circuit Projects, Tutorials, and Practical Engineering Solutions

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Stack Exchange
  • Linkedin

Calculators

  • ZVS Induction Heater + Tank Calculator Tool
  • Zener Diode Calculator
  • Wire Current and Thickness Calculator (Ampacity Calculator)
  • Voltage Divider Calculator
  • Transistor Base Resistor Calculator
  • Transistor Astable Multivibrator Calculator
  • TL431 Calculator
  • Solar Panel, Inverter, Battery Calculator
  • Ferrite Core Air Gap Calculator Tool
  • Parallel MOSFET Calculator Tool: How to Connect MOSFETs in Parallel Safely
  • LC Resonance Calculator for EV Battery Charger Circuits
  • LED String Series Resistor Calculator
  • PFC (Power Factor Correction) Calculator Tool: 3kW
  • Passive Power Factor Correction (PFC) Calculator
  • LM567 IC Calculator Tool
  • SMPS Flyback Boost Converter Calculator
  • Shunt Resistor Calculator for Ammeters
  • SCR and Triac Gate Resistor Calculator
  • Battery Back up Time Calculator
  • Boost Converter Calculator (Non-Isolated)
  • Bootstrap Capacitor Calculator
  • Buck Converter Calculator
  • Buck-Boost Converter Calculator
  • Capacitance Reactance Calculator
  • DCM Flyback Transformer & Wire Gauge Wire Size Calculator Tool
  • Filter Capacitor Calculator
  • IC 4047 Calculator (Frequency and PWM)
  • IC 4060 Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • IC SG3525, SG3524 Calculator
  • Inductance Calculator
  • Induction Heater Inductor and Resonant Frequency Calculator
  • Induction Heater Work Coil Calculator
  • Inverter LC Filter Calculator
  • LC Resonance Calculator
  • LED Current Calculator
  • LM317, LM338, LM396 Calculator
  • NAND/NOT Gate RC Values Calculator
  • NOT, NAND Gate Frequency Calculator
  • Notch Filter Calculator Tool
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • RC Filter Calculator
  • Reactance Calculator
  • Sine Table Calculator for SPWM Arduino Code
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • SMPS Calculator for Toroidal Ferrite Transformers
  • SMPS Flyback Transformer Calculator – Design by Target Duty Cycle
  • TL431 Calculator
  • Op-Amp Hysteresis Resistor Calculator

© 2026 · Swagatam Innovations