Professional Documents
Culture Documents
"Ultra Sonic Distance Meter": B T I E E
"Ultra Sonic Distance Meter": B T I E E
BACHELOROF TECHNOLOGY
IN
ELECTRONICS & COMMUNICATION ENGINEERING
By
NIKHIL RAJPUT (16bec172)
November 2019
CERTIFICATE
This is to certify that the Major Project Report entitled “ULTRA SONIC DISTANCE METER”
submitted by MR. NIKHIL RAJPUT (16BEC172) towards the partial fulfillment of the requirements
for the award of degree in Bachelor of Technology in the field of Electronics & Communication
Engineering of NIRMA University is the record of work carried out by him/her under our supervision
and guidance. The work submitted has in our opinion reached a level required for being accepted for
examination. The results embodied in this major project work to the best of our knowledge have not
been submitted to any other University or Institution for award of any degree or diploma.
Date:
Name of Guide
Prof. BHUPENDRA FATANIYA
Head of Department
Dr. DHAVAL PUJARA
2
Undertaking for Originality of the Work (for all students)
I, NIKHIL RAJPUT, Roll No.(16bec172), give undertaking that the Major Project entitled
“Ultra sonic distance meter” submitted by me, towards the partial fulfillment of the requirements for
the degree of Bachelor of Technology in ELECTRONICS AND COMMUNICATION of Nirma
University, Ahmedabad, is the original work carried out by me and I give assurance that no attempt of
plagiarism has been made. I understand that in the event of any similarity found subsequently with any
other published work or any project report elsewhere; it will result in severe disciplinary action.
Signature of Student
Date:
Place: Ahmedabad
Endorsed by:
1 Introduction
1.1 Introduction 5
1.2 Necessity of contactless measurement 5
2 Literature Review
Conclusions 16
References 17
LIST OF FIGURES
2.5 RESULT 15
ACKNOWLEDGEMENT
It is indeed a matter of great pleasure and proud privilege to be able to Present this
project on “Ultrasonic Distance Measurement “ The completion of the project work is a
millstone in student’s life and its Execution is inevitable in the hands of guide. I am
highly grateful to Prof. Bhupendra Fataniya Sir for his invaluable guidance and
appreciation and motivation.
ABSTRACT
The project is designed to develop distance measurement system Using ultra sonic waves
and interfaced with arduino .We know that human Audible ranges 20hzto20khz. We can
utilize this frequency range wave through ultrasonic sensorHC-SR04.Theadvantages of
this sensor when interfaced with arduino which is a control and sensing system, a proper
distance measurement can be made with new techniques .This distance measurement
systems can be widely used as range meters and as proximity detectors in industries.
Introduction
1.1 Introduction
The project is designed to develop distance measurement system using ultrasonic waves
and interfaced with arduino .As we know that human audible range is between
20hzto20khz. Hence the system utilizes this frequency range waves through ultrasonic
sensor (HC-SR04). This system is applicable in inaccessible areas wherein traditional
means of measurement cannot be implemented, such as high temperature and pressure
zones. The system is designed as specially for the employed in civil work for the purpose
of measurement which is reliable and accurate.
Conventional Distance measurement systems are highly inefficient as these systems used
IR sensors.IR sensors are very unreliable when they are subjected to different light
condition i.e. low light and under water applications. Hence precise and
fix measurement of low range distance, is the main objective for this project.
2 LITERATURE REVIEW
2.1Hardware Component:-
1 Arduino
Arduino is an open-source hardware and software company, Project and user community
that design and manufactures single board microcontroller s and microcontroller kits for
building digital Devices and interactive objects that can sense and control objects in the
Physical and digital world.
Features
Operating voltage : 5V
Input Voltage (recommended):7-12V
Input Voltage(limits):6-20V
Digital I/OPins:14
AnalogInputPins:6
DC Current per I/OPin:40mA
DCCurrentfor3.3VPin:50mA
2 Ultrasonic Module :-
The LCD dicussed in this section has14pins.The function of each pin is Given above
diagram.
E-enable:
The enable pin use by the LCD to latch information presented to its data pins ,a high to
low pulse must be applied to this pin in order for the LCD To latch in the data present at
the data pins. This pulse must be a minimum of450nswide.
D0-D7:-
The 8 bit data pins,D0-D7,areusedtosendinformationtotheLCDor
Read the contents of internal registers.
To display letters and numbers ,we send ASCII codes for the letters A-Z,a-z and numbers
0-9 to these pins while making RS=1.
#include<LiquidCrystal.h>
#definetrigger18
#defineecho19
Liquid Crystal (2,3,4,5,6,7);
Float time=0,distance=0;
Void setup()
{
lcd.begin(16,2);
pinMode(trigger,OUTPUT);
pinMode(echo,INPUT);
lcd.print("Ultrasonic");
lcd.setCursor(0,1);
lcd.print("DistanceMeter");
delay(2000);
lcd.clear();
lcd.print("RangeFinder");
delay(2000);
}
voidloop()
{
lcd.clear();
digitalWrite(trigger,LOW);
delayMicroseconds(2);
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
delayMicroseconds(2);
time=pulseIn(echo,HIGH);
distance=time*340/20000;
lcd.clear();
lcd.print("Distance:");
lcd.print(distance);
lcd.print("cm");
Page10
lcd.setCursor(0,1);
lcd.print("Distance:");
lcd.print(distance/100);
lcd.print("m");
delay(1000);
}
Code for additional features :-
#include <hcsr04.h>
#include<LiquidCrystal.h>
#define trigPin 18
#define echoPin 19
LiquidCrystal lcd(2,3,4,5,6,7);
float time=0,distance=0,distance2=0,Area=0;
void setup()
{ lcd.begin(16,2);
pinMode(trigPin,OUTPUT);
pinMode(echoPin,INPUT);
lcd.print("NIKS CREATION");
delay (2000);
lcd.clear();
lcd.print("Lets measure");
delay(8000);
}
void loop()
{ digitalWrite(trigPin,LOW);
delayMicroseconds(2);
digitalWrite(trigPin,HIGH);
delayMicroseconds(10);
digitalWrite(trigPin,LOW);
delayMicroseconds(2);
time=pulseIn(echoPin,HIGH);
distance= time*0.034/2;
lcd.clear();
lcd.print("Distance ");
lcd.print(distance );
lcd.print ("cm");
lcd.setCursor(0,1);
lcd.print("Distance:");
lcd.print(distance/100);
lcd.print("m");
delay(10000);
{
digitalWrite(trigPin,LOW);
delayMicroseconds(2);
digitalWrite(trigPin,HIGH);
delayMicroseconds(10);
digitalWrite(trigPin,LOW);
delayMicroseconds(2);
time=pulseIn(echoPin,HIGH);
distance2 = time*0.034/2;
lcd.clear();
lcd.print("Distance");
lcd.print(distance2 );
lcd.print ("cm");
lcd.setCursor(0,1);
lcd.print("Distance:");
lcd.print(distance/100);
lcd.print("m");
delay(5000);
Area=distance*distance2;
lcd.clear();
lcd.print("Area");
lcd.print(Area);
lcd.print("cm sq");
lcd.setCursor(0,1);
lcd.print("Area");
lcd.print(Area/100);
lcd.print("m sq");
delay(10000);
}
}
Results using serial print
The project gives a comprehensive learning of how a sonar system works besides from
this project we can have hands on arduino. Other than this it helps to learn basic concepts
like interrupt routine of microcontroller and role of different pins of microcontroller
.Besides it also gives a brief learning of ultrasonic sensor and interfacing different in/op
device with arduino.
REFRENCES
[1] www.circuitdigest.com
[3]http://www.ndted/EducationResource/CommunityCollege/Ultraso
nic/Introduction?history.html
[4]http://electronics-manufacturing.com/info/Sensorsanddetectors/
Ultrasonic sensor.html