HI guys welcome to meworkstelugu in this section we learn about the how to make a distance meter using the Ultrasonic sensor and 16*2 LCD module.
How this Arduino distance meter:
This distance meter mainly based on the Ultrasonic sensor. this project based on the principle of radar.the ultrasonic sensor generates the sound waves. (this sound wave we can not hear becuse the freq of that sound waves very high) evaluate the echo which is received by the ultrasonic sensor .then sensor calculate the sending and receiving signals time interval.
when any object detected in front of the Ultrasonic sensor, then we calculate the time interval by the sound waves and print the output on the LCD display.
Components of distance meter:
- Arduino BuyNow
- ultrasonic sensor BuyNow
- 16*2 LCD module BuyNow
- breadboard & wires BuyNow
If you want to buy Arduino components, I am giving my affiliate links. If you buy the components using my affiliate links, it will help to our channel and website growth. so do these small help.
Making Video:
watch the below video help to make this project.
Circuit diagram of Arduino distance meter :
Connect all the components as shown in below.
if you want to download circuit click here
code for Arduino distance meter :
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
const int trigPin = 7;
const int echoPin = 6;
long duration, distance;
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin(9600);
lcd.init();
lcd.backlight();
lcd.setCursor(0,0);
lcd.print(" meworkstelugu ");
}
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance= duration*0.034/2;
lcd.setCursor(0,1);
lcd.print("Distance: ");
lcd.setCursor(10,1);
lcd.print(distance);
lcd.print(" cm");
delay(500);
Serial.print( " distance = ");
Serial.println(distance);
delay(1000);
}
download the code by click on here
if you have any doubts about this project comment on my YouTube channel i will respond as well as possible .
tags :arduino scale sensor,arduino scale analog input,arduino distance meter,arduino distance measurement,arduino distance measurement laser,arduino ultrasonic distance meter,arduino distance meter.
0 Comments