You are on page 1of 25

Department of Mechanical Engineering

Project Presentation

Project Title: Portable Ultrasonic Range Finder

Group Members:
  Muhammad ilyas (UET/SCET-16F-ME-005)
Junaid Adil (UET/SCET-16F-ME-001)
Yasir Usman (UET/SCET-16F-ME-018)
Fahad Ali (UET/SCET-16F-ME-043)
Ijaz
ul Hassan (UET/SCET-16F-ME-047)
Outlines
1. Introduction
2. Components used in this project
3. Detail of components
4. Arduino Coding
5. Circuit Design(Block diagram)
6. Working of project
7. Application & use
8. Conclusion
1. INTRODUCTION:-
• A range finder is a device used to find the distance from a point to
the nearest obstacle. This device uses ultrasonic technology to
measure the distance. You can consider it like an electronic, hassle-
free version of a measuring tape with a measuring range of 2cm to
400cm and an accuracy of 1cm.

• Depending on the frequency of the sound wave, the SONAR can be


either Infrasonic or Ultrasonic. Ultrasonic sensors produce sound
waves with frequencies higher than the audible range (20Hz to 20
KHz) i.e. greater than 20 KHz. In case of an infrasonic sensor, the
frequency of sound wave is less than 20Hz.
2.COMPONENT USED:-
i. Arduino Uno
ii. Ultrasonic Sensor HC-SR04
iii. 16X2 LCD Display
iv. 10KΩ POT
3.DETAIL OF COMPONENT:-
i. ARDUINO UNO:-
The Arduino UNO is an open-source microcontroller board
based on the Microchip ATmega 328p microcontroller and developed
by Arduino.cc. The board is equipped with sets of digital and analog
input/output (I/O) pins that may be interfaced to various expansion boards
(shields) and other circuits. The board has 14 Digital pins, 6 Analog pins,
and programmable with the Arduino IDE (Integrated Development
Environment) via a type B USB cable. It can be powered by a USB cable or
by an external 9 volt battery, though it accepts voltages between 7 and 20
volts.
Arduino UNO
ii. Ultrasonic Sensor HC SR04
Ultrasonic Sensor HC-SR04. Ultrasonic sensor is a sensor that
works on principle similar to radar or sonar. It generates high frequency
sound and calculate the time interval between the sending of signal and
the receiving of echo. Therefore ultrasonic sensor can be used to
measure distance.
Ultrasonic Sensor Pin Configuration
Pin Number Pin Name Description

1 Vcc The Vcc pin powers the sensor, typically with +5V

2 Trigger Trigger pin is an Input pin. This pin has to be kept high
for 10us to initialize measurement by sending US wave.

3 Echo Echo pin is an Output pin. This pin goes high for a
period of time which will be equal to the time taken for
the US wave to return back to the sensor.

4 Ground This pin is connected to the Ground of the system.


HC-SR04 Sensor Features
 Operating voltage: +5V

 Theoretical  Measuring Distance: 2cm to 450cm

 Practical Measuring Distance: 2cm to 80cm

 Accuracy: 3mm

 Measuring angle covered: <15°

 Operating Current: <15mA

 Operating Frequency: 40Hz


HC-SR04 Ultrasonic Sensor - Working

 This sensor is a very popular sensor used in many applications where measuring distance or sensing objects
are required. The module has two eyes like projects in the front which forms the Ultrasonic transmitter and
Receiver. The sensor works with the simple high school formula that

Distance = Speed × Time

 The Ultrasonic transmitter transmits an ultrasonic wave, this wave travels in air and when it gets objected by
any material it gets reflected back toward the sensor this reflected wave is observed by the Ultrasonic
receiver module as shown in the picture below.
HC-SR04 Ultrasonic Sensor - Working
 Since we are using the Ultrasonic wave we know the universal speed of US wave at room conditions
which is 330m/s.

 The circuitry inbuilt on the module will calculate the time taken for the US wave to come back and
turns on the echo pin high for that same particular amount of time, this way we can also know the
time taken.

 Now simply calculate the distance using a microcontroller or microprocessor.


iii. 16x2 LCD Display
 LCD (Liquid Crystal Display) screen is an electronic display module 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.

LCD Pin Diagram


LCD Pin Description
 Pin
 Function  Name
No
1 Ground (0V) Ground
2 Supply voltage; 5V (4.7V – 5.3V)  Vcc
3 Contrast adjustment; through a variable resistor  VEE
4 Selects command register when low; and data register when high Register Select
5 Low to write to the register; High to read from the register Read/write
6 Sends data to data pins when a high to low pulse is given Enable
7 DB0
8 DB1
9 DB2
10 DB3
8-bit data pins
11 DB4
12 DB5
13 DB6
14 DB7
15 Backlight VCC (5V) Led+
16 Backlight Ground (0V) Led-
iv. 10KΩ POT

 A potentiometer is a three-terminal resistor with a sliding


or rotating contact that forms an adjustable voltage divider. If
only two terminals are used, one end and the wiper, it acts
as a variable resistor or rheostat.

A potentiometer has 3 pins. Two terminals (the blue and


green) are connected to a resistive element and the third
terminal (the black one) is connected to an adjustable wiper.
The potentiometer can work as a rheostat (variable resistor)
or as a voltage divider.
10KΩ POT Connection with Arduino
4.Arduino coding lcd.clear();
lcd.print("Distance in cm"); Verify the code

digitalWrite(trigPin, LOW);
delayMicroseconds(2);
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
const int trigPin = 11;
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
 
digitalWrite(trigPin, LOW);
const int echoPin = 10;
 
const int led = 13;
duration = pulseIn(echoPin, HIGH);
 
long r = 3.4 * duration / 2;
 
float distance = r / 100.00;
void setup()
{
lcd.setCursor(0, 1);
pinMode(trigPin, OUTPUT);
lcd.print(distance);
pinMode(echoPin, INPUT);
delay (300);
pinMode(led, OUTPUT);
 
lcd.begin(16, 2);
lcd.print ("Ultrasonic ");
lcd.setCursor(0, 1);
if(distance<10)
lcd.print ("Range Meter");
{
delay (5000); Compiling the Code
digitalWrite(led,HIGH);
}
}
else

 
long duration, r;
{
float distance;
digitalWrite(led,LOW);
 
}
void loop()
Then Arduino Programming will
{
delay(300); complete and save in Arduino.
}
5.CIRCUIT DESIGN:-
•The circuit consists of Arduino Uno, which is the brain of the project, an Ultrasonic sensor and an LCD display to instantaneously
display the results. The design of the circuit is very simple and is explained below.
•Of the available 14 I/O pins on Arduino, we use 8 pins in this project. 2 pins are used for Ultrasonic sensor and other 6 pins are
used to control the LCD.
•The 4 pins of Ultrasonic sensor are Vcc, Gnd, Trig and Echo. Trig is connected to Pin 11 of Arduino and Echo is connected to Pin
10. With respect to Arduino, Pins 10 and 11 are input and output respectively.
•Pins 15 and 16 (LED+ and LED-) of the LCD are backlight pins. They are connected to Vcc and Gnd respectively (not shown in
circuit diagram).
•Four data pins of LCD are used to display the information. Pins 11, 12, 13 and 14 of LCD (D4 – D7) are connected to pins 5, 4, 3
and 2 of Arduino.
•Pins RS and E (pins 4 and 6) of LCD are connected to pins 7 and 6 of Arduino respectively while RW (pin 5) is connected to
ground.
•Pins 1 and 2 (Vss and Vdd) are connected to ground and Vcc respectively. In order to control the contrast of the LCD display, pin
3 (VE) of LCD is connected to the wiper of a 10 KΩ POT with the other terminals of POT connected to Vcc and Gnd.
Block Diagram of Ultrasonic Range Meter
6. WORKING:-
• Ultrasonic sensor is the main module in the range meter circuit. An ultrasonic sensor consists of an
ultrasound transmitter and a receiver. The transmitter sends a sonic burst of 8 pulses at 40 KHz frequency.
• This signal hits the target and the echo is received by the receiver module. By measuring the time
between the events of sending the pulse and receiving the echo, the distance can be calculated.
• The ultrasonic sensor used in this project is HC-SR04. It can be used to measure distance in the range of
2cm to 400cm with accurate readings. The sensor module consists of 4 pins: Vcc, Gnd, Trig and Echo.
When the Trig pin is high for a duration of at least 10µs, the ultrasonic sensor sends the ultrasound
signals. The Echo pin is high from the moment of sending the signal and receiving it.
• This duration for which the Echo signal is high is calculated by Arduino as per the code and is converted to
distance in centimetres. The same data is displayed on the LCD.
• Arduino continuously sends the Trig signal and the distance of the target can be measured continuously
without any delay.
• As the power requirement of the circuit is very less, the whole system can be powered by a 9V battery
and can be used as a Portable Range Meter.
How distance calculate by US Sensor using
Microcontroller

Total time of sound out &


back from US Sensor
=34.4 cm (obstacle away
at 34.4cm distance from
US Sensor)
Just time for sound out
but not back
7.Application & Use
• Ultrasonic Sensor for Vehicle parking
• Distance measurement in Sub marine.
• Aero plane radar use to measure distance of another aero plane (at
specific radius)
• Level Sensing (of liquid in different industries).
• Depth of certain places like wells, pits etc. can be measured since the
waves can penetrate through water.
8. Conclusion
• In this work, an ultrasonic range finder has been realized to perform
different possible applications.
• The project allowed us to study about Arduino and its coding using
Arduino Software
• The speed of ultrasound in air is affected by air temperature variations.
So, we can propose, for future improvements on the circuit, to add a
temperature sensor, with its circuitry, to take into account these variations.
• We can also implement the range finder using a PIC microcontroller and
develop the corresponding software to perform the required calculations.

You might also like