Double Revolving field theory-how the rotor develops torque
Ultrasonic Obstacle Avoidance and Auto Brake Car System
1. CH3: Application based on Ultrasonic Distance Measurement
In this chapter we will talk reveal a practical implementation based on the idea
of Ultrasonic distance measurement. Our project is about automatic-braking car. It is a
very important application that decreases accidents and increases safety levels on any
automobile.
3.1 Testing and Starting
3.1.1 Used Equipment:
ULTRASONIC RANGE FINDER LV-EZ0:
o This module provides a robust continuous distance
measurement; it uses 42 KHz frequency of
ultrasound waves.
o It is compatible with Arduino and provides an
analog or digital response.
o This module is used as the main distance
measurement tool in front of the car.
o Operates between 2.5 - 5.5V.
o Low 2mA supply current.
o 20Hz reading rate.
o RS232 Serial Output - 9600bps.
o Analog Output - 10mV/inch = 3.937 mV/cm.
o PWM Output - 147uS/inch = 57.874 uS/cm.
o Small module with light weight.
ULTRASONIC SENSOR HC-SR04:
o Convenient module that needs only a simple code.
o This module provides digital output when a trigger
is applied.
o This module is used in the back and both sides of
the car.
o Input Voltage: +5V DC.
o Quiescent Current: less than 2mA.
o Operating Current: 15mA.
o Effectual Angle: less than 15°.
o Can Measure Distances between: 2 cm – 400 cm/1" - 13ft.
o Resolution: 0.3 cm.
o Measuring Angle: 30°.
o Trigger Input with Pulse Width: 10uS.
o Dimension: 45mm x 20mm x 15mm.
2. DUAL H-BRIDGE + 4WD ROBOT SMART CAR:
o A 6V DC 4WD robotic car.
o 2 Dual H-Bridges to drive the car’s motors forward and backward with a
chosen speed that depends on PWM.
ARDUINO MEGA 2560 R3
o We chose Arduino Mega mainly because of
the large number of bins associated with it.
It also operates at 16 MHz with a
microcontroller AVR ATmega2560.
HC-06 BLUETOOTH TTL MODULE:
o This module connects the Arduino wirelessly
with a computer or a smart phone. It is an
efficient way for short-range radio
communication.
3. 3.1.2 Testing the modules
By making some tests on the LV-EZ0 and HC-SR04 sensors, we used Matlab to
make a graph for the results that are shown in the table below:
Table of Distances in cm with Analog Voltage output and PWM digital output
Distance (cm) Digital (ms) Analog (V)
660 22.3 2.1
630 22.3 2.1
600 22.2 2
570 22.2 2.2
540 22.1 2.1
510 22.2 2
480 22.1 2.2
450 22.3 2.1
420 22.2 2
390 22.3 2
360 22.2 2
330 21.7 1.84
300 19.4 1.76
270 16.6 1.52
240 14.9 1.38
210 12.9 1.1
180 11.1 0.94
150 9.69 0.81
120 7.41 0.64
90 5.94 0.51
60 4.11 0.34
30 2.3 0.2
15 1.35 0.13
7.5 0.95 0.086
LV-EZ0 Test Results:
4. Beam width of LV-EZ0:
o The LV-EZ0 sensor has a huge beam width that is equal to 70° in 3D and
can detect objects almost 4 meters away from the transmitter, but it has
a significant blind spot between 0 and 7.5 cm where the result of
detecting an object there cannot be known.
Analog
Output
Digital
Output
70°
4 m
3.925 m
m 7.5 cm
5. Beam width of HC-SR04:
o The HC-SR04 sensor has a sharp beam width that is equal to 30° in 3D
and can detect objects almost 4 meters away from the transmitter. But
it has a blind spot between 0 and 2 cm where the result of detecting an
object there is always zero.
3.2 Project Procedure
3.2.1 Overall Scheme
The car is controlled by the user through a computer and a Bluetooth module
that works as a serial wireless connector between the Arduino and the computer. We
have 4 motors controlled by 2 Dual H-bridges modules, a 9V 4.7 A Lithium chargeable
battery that supplies everything onboard with power, and the Arduino that controls
every action of the car, takes commands through the Bluetooth and send results to the
user behind the laptop. The car will move forward as long as the user is pressing ‘f’ on
the keyboard unless an obstacle shows up in front of the car. Pressing ‘r’ will make the
car rotate towards right, ‘l’ towards left and ‘b’ is for going back. Pressing any other
key or stop pressing any key will make the car stop.
3.2.2 How Does The Car Work?
Our car is an ordinary car but supported with an extra safety features. Using
ultrasound sensors and distance measurements, the car can detect the obstacles
surrounding its perimeter and prevent any collision from happening wither it is going
forward, backward, or even rotating around itself.
4 m
3.98 m
2 cm
6. 1. Forward Going:
We used the LV-EZ0 sensor to
find if an obstacle is in front of the car.
The sensor measures a 400 cm distance
from its transmitter, though the car
starts making decisions when the
distance is only 1 m away from the
transmitter. Once the transmitter
detects an object closer than 1 m, an
alarm goes off trying to get the driver’s
attention. When the object is closer
than 80 cm, the car senses if there is
another object on its left using the HC-
SR04 ultrasound sensor, if there is no
object (a free 20 cm space) the car
starts taking its left trying to outrun the
front object while the front sensor is
sensing the distance. If there is an
object on its left, the car senses its right
side using another HC-SR04 ultrasound
sensor, if there is no object, it outruns
through the right side This happens when a driver unintentionally falls asleep
while driving and by this feature his life will be saved.
The 20 cm spacing is because the car has a width of 15 cm.
But in very rare situations when the car becomes so close to the front obstacle
(less than 20 cm), or when it is surrounded from all sides, the car stops and
gives some light signals to the behind drivers.
It is important to notice that the LV-EZ0 cannot detect objects closer than
almost 15 cm, and it starts giving random results. But the HC-SR04 sensors can
sense between (2 cm and 400 cm). The car decides that there is no obstacle on
its right or left when the HC sensors give a distance further than 20 cm.
2. Right Side Rotating:
When the right HC sensor gives a distance more
than 15 cm, and the driver wants to rotate to the right,
the right sided wheels start going backwards, while the
left sided wheels are going forward. This will make the
car rotates to the right side without sliding on the road.
If an obstacle appears on the right side of the car, the car
ignores the driver’s will and stops.
80 cm
7. 3. Left Side Rotating:
When the left HC sensor gives a distance more
than 15 cm, and the driver wants to rotate to the left, the
left sided wheels start going backwards, while the right
sided wheels are going forward. This will make the car
rotates to the left side without sliding on the road. If an
obstacle appears on the left side of the car, the car ignores
the driver’s will and stops.
4. Right Side Going:
When there is an obstacle closer than 80 cm in front of the car, and
another one is on the left, but nothing on its right side, the car starts going to
the right side by making its two left side motors run faster than those on the
right side. The front sensor will be taking reads to ensure that no obstacle is
getting on the front way. If an obstacle shows up in front of the car with less
than 20 cm distance, the car will stop.
5. Left Side Going:
When there is an obstacle closer than 80 cm in front of the car, and nothing
on its left side, the car starts going to the left side by making its two right side
motors run faster than those on the left side. The front sensor will be taking
reads to ensure that no obstacle is getting on the front way. If an obstacle
shows up in front of the car with less than 20 cm distance, the car will stop.
6. Backward Going:
Going back is easy, the HC sensor on the back take reads and make sure
that there is no obstacle closer than 25 cm behind it. The four motors rotate
backward as long the driver is willing to do so and no obstacles is close enough,
otherwise, the car will stop.