project report
project report
INTRODUCTION
1
The concept of distance measurement has been around for centuries,
with early civilizations using primitive methods such as pacing, ropes,
and sticks. However, with the advancements in technology, we now have
access to sophisticated instruments that can measure distances with
high precision and accuracy.
2
Moreover, this technology can also be used in agriculture for crop
monitoring, in sports for measuring ball speed and trajectory, and in
education for teaching basic principles of physics and electronic
already exist?
4
CHAPTER 2
5
into electrical energy and vice-versa. These sound waves are in the
frequency range of 20000hz which is beyond the hearing range of
humans therefore only the sensor can detect them. First, they identified
that signal processing is easier because the speed of sound is slower
than the speed of light in the presence of air. Second, the relatively short
ultrasonic wavelengths allow for a “more highly accurate distance
measurement , therefore measuring the distance from such objects does
not affect the measurements. Finally, ultrasonic is not affected by the
effects of light and airborne dusts, allowing it to perform measurements
of distance in outdoor environments. To elaborate, another paper on the
use of ultrasonic sensor with the inclusion of Arduino by Soni et al.
(2017) explains the theory of sound waves.
According to the authors, “Sound waves are defined as longitudinal
pressure waves in the medium in which they are travelling. Subjects
whose dimensions are larger than the wavelength of the impinging
sound waves reflects them, the reflected waves are called the echo. If
the speed of sound in the medium is known and the time taken for the
sound waves to travel the distance from the source to the subject and
back to the source is measured, the distance from the source to the
subject can be computed accurately”.A similar study on the use of
ultrasonic sensor for distance measurement was also done by Ratan
and Luthra (2015). They also applied the use of an ultrasonic sensor for
distance measuring due to its versatility and applicability in so many
fields. Their objective was to create a low cost simple device with
acceptable accuracy. Although they have met the objective of the
project, the limitations they found on their project was the need to orient
the device perpendicularly to the “plane of propagation of the ultrasonic
waves .Another similar study of an ultrasonic sensor for distance
measurement was also done by Abdullah (2015). They used an
6
ultrasonic sensor (particularly the HC-SRO4) for their study, it is because
they found out that this material is to be the “most reliable and
inexpensive method for distance measurement”. But in their case, a
temperature compensator was added to their system to compensate for
the errors that may possibly occur due to the ambient temperature. The
is because the speed of ultrasonic wave is affected by the “type of
medium and the temperature”.The researchers may consider the
addition of a temperature compensator if temperature has a substantial
effect on the device’s capabilities and if it restricts its effectivity in the
places where it is expected to be used.Carullo, A., & Parvis, M. (2001).
An ultrasonic sensor for distance measurement in automotive
applications. IEEE Sensors journal, 1(2), 143. As ultrasonic sensors
have a wide application in the field, in a paper published by Carullo and
Parvis (2001), they mounted an ultrasonic sensor to measure the
distance between the ground and the bottom of the car. Their purpose
was to get the height of the car from its bottom surface to the ground
with goal of satisfying the requirements in the automotive field. Their
experiment was a success and it exemplifies the versatility of an
ultrasonic sensor in various fields.With regards to distance
measurement, another electromagnetic device patented by Woo and
Lien (1979) works similarly to that of the researchers’ device. Although
the major difference is that they are using an optical sensor for distance
measurement and not an ultrasonic sensor. But their device also has a
display capable of showing the resulting measurements. The display can
show the measurements according to the preference of the user: in
centimeters, inches, or meters. The researchers would like to include
something similar by providing two units of measurements in the display.
A combination of centimeters and inches which are both the most widely
used units in measuring distance worldwide.
7
CHAPTER 3
PROJECT DESCRIPTION
8
To implement this project, we will need an Arduino board,
ultrasonic sensors, jumper wires, and a power source. The
ultrasonic sensors will be mounted on the front and back bumpers
of the vehicle, and connected to the Arduino board through jumper
wires. Once the hardware is set up, we will write a program code
that controls the sensors and processes the distarice the
measurements. The program will use algorithms to calculate the
distance between the vehicle and nearby objects, and display the
results on a screen or through audio feedback.The use of
ultrasonic sensors and Arduino boards in vehicle applications has
a wide range of potential applications beyond just parking and
collision avoidance.
9
3.3 BLOCK DIAGRAM :
. Fig:3.3.1
The ultrasonic sensors will be mounted on the front and back bumpers
of the vehicle, and connected to the Arduino board through jumper
wires..
Arduino will receive the data from the ultrasonic sensor and process it to
calculate the distance between the vehicle and the obstacle. In addition
to processing the data, the Arduino board will also be responsible for
providing feedback to the driver through various output devices such as
speakers or LED lights. In this project we have used buzzer to alert the
driver.
10
CHAPTER 4
HARDWARE AND SIMULATION
Fig: 4.1.1
11
Arduino Uno is a microcontroller board based on the
ATmega328P (datasheet). It has 14 digital input/output pins (of which 6
can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic
resonator (CSTCE16M0V53-R0), a USB connection, a power jack, an
ICSP header and a reset button.
The Arduino UNO is the best board to get started with electronics and
coding. If this is your first experience tinkering with the platform, the
UNO is the most robust board you can start playing with. The UNO is the
most used and documented board of the whole Arduino family.
Fig:4.1.2
12
4.1.2.1 PIN DETAILS – ARDUINO UNO
13
several applications, like in measuring liquid level, checking proximity
and even more popularly in automobiles to assist in self-parking or
anticollision systems.
Fig:4.1.3
The speed of the sound is known to us, after some calculation we can
calculate the distance. We are going to use this same technique for this
Arduino distance measurement project.
There are many types of Arduino distance sensors, but in this project we
have used the HC-SR04 to measure distance in range of 2cm-400cm
with an accuracy of 3mm. The sensor module consists of an ultrasonic
14
transmitter, receiver and control circuit. The working principle of
ultrasonic sensor is as follows:
15
Fig:4.1.3.2
16
Fig:4.1.4
Usually, Arduino LCD display projects will run out of pin resources easily,
especially with Arduino Uno. And it is also very complicated with the wire
soldering and connection. This I2C 16x2 Arduino LCD Screen is using an
I2C communication interface. It means it only needs 4 pins for the LCD
display: VCC, GND, SDA, SCL. It will save at least 4 digital/analog pins
on Arduino. All connectors are standard XH2.54 (Breadboard type). You
can connect with the jumper wire directly.
17
4.1.5 10K POTENTIOMETER
The 10K Potentiometer is used for adjusting various parameters
like voltage, current, etc in an electronic circuit. The POT
Potentiometer is a passive electronic component that has two end
terminals with a resistive element and the sliding contact called the wiper
acts as the third terminal.It is mostly used in application where a single
turn can provide enough control resolution.
Fig:4.1.5
18
Table:4.1.5
Fig:4.1.6
In this project, an ultrasonic sensor is tied to a servo motor. The servo motor
rotates continuously between 0 and 180 degrees, performing the function of
a radar.
When an object comes in the range of the sensor, the sensor tracks it and
raises an alarm. The corresponding distance of the object from the sensor
gets displayed on the LCD screen.
4.1.7 220 Ohm resistor
The 220 Ohm resistor can be identified via resistor color codes of Red-
Red-Brown-Gold or Red-Red-Black-Black-Gold
19
Fig:4.1.7
4.1.8 Breadboard
Fig:4.1.8
4.2 HARDWARE CONNECTIONS:
The circuit diagram for arduino and ultrasonic sensor is shown
above to measure the distance. In circuit connections Ultrasonic sensor
module’s “trigger” and “echo” pins are directly connected to pin 18(A4)
and 19(A5) of arduino. A 16x2 LCD is connected with arduino in 4-bit
20
mode. Control pin RS, RW and En are directly connected to arduino pin
2, GND and 3. And data pin D4-D7 is connected to 4, 5, 6 and 7 of
arduino.
The time taken for the sound wave to propogate from transmitter to
receiver is proportional to the distance of the object. In this distance
measurement system we had ultrasonic sensor HC-SR04 interfaced with
Arduino UnoR3. Programming and hardware part of ultrasonic sensor
interfacing with Arduino UnoR3.servo motors are used to control the
position of objects, rotate objects, move legs, arms or hands of robots,
move sensors etc. with high precision. Servo motors are small in size,
and because they have built-in circuitry to control their movement, they
can be connected directly to an Arduino.
Where speed of sound around 340m per second. A 16x2 LCD displaying
distance
21
Fig: 4.3a
Fig:4.3 b
22
#include<Servo.h> //Servo library
#define echo 2
#define trig 3
#define Buzzer 7
void setup() {
myservo.attach(6); // Servo is connected to Digital pin 6
pinMode(trig, OUTPUT);
pinMode(echo, INPUT);
pinMode(Buzzer,OUTPUT);
Serial.begin(9600);
lcd.begin(16, 2);
23
(distance <= scan_Distance)
{ intruder_detected();
} else { lcd.clear();
lcd.print("Scanning...... ");
}
delay(100);
} for (int i = 180; i >= 0; i--)
{ myservo.write(i);
time_Measurement(); distance =
(float)duration * (0.0343) / 2; if
(distance <= scan_Distance)
{ intruder_detected();
} else { lcd.clear();
lcd.print("Scanning...... ");
}
delay(100);
}
}
void time_Measurement()
{
digitalWrite(trig, LOW);
delayMicroseconds(2);
digitalWrite(trig, HIGH);
delayMicroseconds(10);
digitalWrite(trig, LOW);
24
duration = pulseIn(echo, HIGH);
}
void intruder_detected()
{ lcd.clear();
lcd.setCursor(0, 0);
lcd.print(" Intruder at ");
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.print(distance);
lcd.print(" cm");
digitalWrite(Buzzer, HIGH);
delay(3000);
digitalWrite(Buzzer, LOW);}
25
Fig: 4.5 a
Fig: 4.5 b
4.6 AURDINO IDE PROGRAM EXECUTION:
26
CHAPTER 5
CONCLUSION AND FUTURE SCOPE
Distance measurement using ultrasonic sensors and Arduino is a popular
research area with various applications. The results of this review indicate that
ultrasonic sensors and Arduino are widely used in the development of electronic
projects related to distance measurement. Further research is needed to
explore the potential of these technologies in various other applications
Distance =speed*time
The human audible range can be converted measure the distance precisely manner
FUTURE SCOPE
References
[1] .Arefin Shamsul MD., & Mollick Tajrian (2013). Design of an
Ultrasonic Distance Meter. International Journal of Scientific &
27
Engineering Research Volume 4, Issue 3
[2].M. Rüeger, J. (1980). Recent developments in electronic distance
measurement. Australia Surveyor30.10.1080/00050326.1980.10442489.
[3]. Czajkowski, S. B. (1984). U.S. Patent No. 4,464,738. Washington, DC:
U.S. Patent and Trademark Office.
[4].Hils, T. (2010). U.S. Patent No. 7,643,927. Washington, DC: U.S.
Patent and Trademark Office. Win, L. A., & Lam, W. C. W. (1988). U.S.
Patent No. 4,730,190. Washington, DC: U.S. Patent and Trademark
Office.
28