100% found this document useful (2 votes)
402 views25 pages

Distance Measuring Instrument-1

This document describes a project to measure distance using an Arduino and ultrasonic sensor. It consists of 16 chapters covering the components needed, how Arduino and ultrasonic sensors work, the circuit diagram, code, and applications. The distance is measured by sending and receiving ultrasonic pulses and calculating the time taken between transmission and reception. Future applications include using temperature compensation for wide temperature ranges and measuring height or detecting collisions.

Uploaded by

Nisha Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
402 views25 pages

Distance Measuring Instrument-1

This document describes a project to measure distance using an Arduino and ultrasonic sensor. It consists of 16 chapters covering the components needed, how Arduino and ultrasonic sensors work, the circuit diagram, code, and applications. The distance is measured by sending and receiving ultrasonic pulses and calculating the time taken between transmission and reception. Future applications include using temperature compensation for wide temperature ranges and measuring height or detecting collisions.

Uploaded by

Nisha Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 25

ARDUINO DISTANCE

MEASUREMENT USING
ULTRASONIC SENSOR.
CONTENTS
S.NO. TITLE PAGE PAGE
NO.
1 CHAPTER -1
INTRODUCTION
2 CHAPTER -2 COMPONENTS
REQUIRED
3 CHAPTER -3
ARDUINO(UNO)
4 CHAPTER -4 PIN DIAGRAM
5 CHAPTER -5 ULTRASONIC
SENSOR
6 CHAPTER -6 BATTERY
7 CHAPTER -7 LCD-16*2
8 CHAPTER -8 JUMPER WIRE
9 CHAPTER -9
POTENTIOMETER
10 CHAPTER -10 CIRCUIT
DIAGRAM
11 CHAPTER -11 PROGRAM
CODE
12 CHAPTER -12WORKING
13 CHAPTER -13 FUTURE
SCOPE
14 CHAPTER -14 ABOUT
PROJECT
15 CHAPTER -15 CONCLUSION
16 CHAPTER -16 REFERENCES
CHAPTER -1
INTRODUCTION

Distance measurement of an object in front or by the


side of the moving entity is required in large number of
devices. These devices may be small or large and can be
quite simple or complicated. Distance measurement has
important applications in automotive and industrial
applications. The distance measurement through
sensors is useful in detecting obstacles. It is the distance
measurement feature that allowed to imagine about
self-driving cars and robots. The distance measurement
application is also used in industries to check fuel levels
in aircrafts and commercial transport vehicles .These
uses various kinds of sensors and systems. In this project
we have implemented such a measurement system
which uses a ultrasonic sensor, arduino .Ultrasonic
means of distance measurement is a convenient method
compared to traditional one using measurement scales.
CHAPTER -2
COMPONENTS REQUIRED

 Arduino
 Ultrasonic Sensor(HC-SR04)
 16×2 LCD I2c
 Breadboard
 Connecting wires
CHAPTER -3
ARDUINO(UNO)
Arduino refers to an open-source
electronics platform or board and the
software used to program it. An Arduino
board can be purchased preassembled or,
because the hardware design is open
source, built by hand . A pre-assembled
Arduino board includes a microcontroller,
which is programmed using Arduino
programming language and the Arduino
development environment.Arduino
programming language is a simplified from
of C/C++ programming language based on
what Arduino calls "sketches," which use
basic programming structures, variables
and functions. These are then converted
into a C++ program.
FEATURES
• Microcontroller: ATmega328
• Operating Voltage: 5V
• Input Voltage (recommended): 7-12V
• Input Voltage (limits): 6-20V
• Digital I/O Pins: 14 (of which 6 provide
PWM output)
• Analog Input Pins: 6
• DC Current per I/O Pin: 40 mA
• DC Current for 3.3V Pin: 50 mA
• Flash Memory: 32 KB of which 0.5 KB
used by bootloader
• SRAM: 2 KB (ATmega328)
• EEPROM: 1 KB (ATmega328)
• Clock Speed: 16 MHz
CHAPTER -4 PIN
DIAGRAM
CHAPTER -5
ULTRASONIC SENSOR-
SR04
It emits an ultrasound at 40 000 Hz which
travels through the air and if there is an
object or obstacle on its path It will bounce
back to the module. Considering the travel
time and the speed of the sound you can
calculate the distance.
C
HAPTER-6
BATTERY-9V/12V
5V regulated power supply is required for
both arduino and ultrasonic sensor and is
obtained 12V rechargeable Li-Ion battery.
5V DC is achieved by voltage regulator
7805.
CHAPTER -7 LCD-16*2
LCD (Liquid Crystal Display) screen is an
electronic displaymodule and find a wide
range of applications. A 16x2 LCD display is
very basic module and is very commonly
used in various devices and circuits. These
modules are preferred over seven
segments and other multi segment LEDs
CHAPTER -8 JUMPER WIRE
A jumper wire is an electrical wire that has
connector pins at each end, allowing them
to be used to connect two points to each
other without soldering.
CHAPTER -9
POTENTIOMETER
Potentiometer is a device used to measure the
internal resistance of a cell, to compare the e.m.f.
of two cells and potential difference across a
resistor. It consists of a long wire of uniform cross
sectional area and of 10 m in length. The material
of wire should have a high resistivity and low
temperature coefficient. The wires are stretched
parallel to each other on a wooden board. The
wires are joined in series by using thick copper
strips.
CHAPTER -10 CIRCUIT
DIAGRAM
CHAPTER -11 PROGRAM
CODE
#include <LiquidCrystal.h>

LiquidCrystal lcd(1, 2, 4, 5, 6, 7);


const int trigPin = 9;
const int echoPin = 10;

long duration;
int distanceCm, distanceInch;
void setup() {
lcd.begin(16,2);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}

void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distanceCm= duration*0.034/2;
distanceInch = duration*0.0133/2;
lcd.setCursor(0,0);
lcd.print("Distance: ");
lcd.print(distanceCm);
lcd.print(" cm");
delay(10);
lcd.setCursor(0,1);
lcd.print("Distance: ");
lcd.print(distanceInch);
lcd.print(" inch");
delay(10);
}

CHAPTER -12Working of
Distance Measurement
Circuit
After writing the code, upload it to Arduino
and you are all set. Now bring any object or
your hand in front of the sensor. Check the
distance on the LCD. Keep changing the
distance of the object from the sensor and
you’ll get a good accurate distance.
The sensor sends eight 40kHz ultrasonic
cycles and if these cycles get reflected by
any obstacle then they get reflected back
to the receiver. Now, the sensor gives the
time taken in travelling the ultrasonic signal
from transmitter to obstacle and from
obstacle to receiver. So, we use this time to
calculate the distance between the sensor
and obstacle.
CHAPTER -13 FUTURE
SCOPE
New prototyping hardware & capability
& interfacing with other consumer
elctronics/tv/smartphones & flooding of
shields.
Using temp. Compensation, it can be
used over wide temperature range.
Height measurement, agriculture field,
collision /protection can be other
application.

CHAPTER -14 ABOUT
THIS PROJECT
Distance Measurement using Arduino
Ultrasonic Sensor is a very easy project to
measure shorter distance precisely. Before
getting started you must know about
Ultrasonic Sensor HC SR-04, which is a low-
cost sensor. The ultrasonic sensor is
consists of Transmitter and Receiver
modules. Transmitter part ejects the pulse
out and the receiver part receives the
pulse. If an obstacle is placed before the
sensor, the transmitted pulse ejected strike
the obstacle and reflected back. The
reflected pulse is received by the receiver
part. The time between transmission and
reception is calculated. This data is
processed to calculate distance.

CHAPTER -15
CONCLUS ION
Distance measurement using ultrasonic
sensor and arduino consist of a transmitter
part of ultrasonic module units ultrasonic
high frequency waves in the form of polices
after collision of these wares with any
object, these wares detected by
microphone time taken by these wares
from transmitter and receiver is used to
measure distance from any object. We had
used a ultrasonic sensor module of HC-
SR04, because this ultrasonic module is
initiated with pulse of 10us The distance
from any object is calculated from.
Distance =speed*time

CHAPTER -16
REFERENCE
http://ijesc.org/
https://www.electricaltechnology.org/
https://circuitdigest.com/
microcontroller-projects/arduino-
ultrasonic-sensor-based-distance-
measurement

You might also like