An-Najah National University Faculity of Engineering Computer Engineering Department
An-Najah National University Faculity of Engineering Computer Engineering Department
An-Najah National University Faculity of Engineering Computer Engineering Department
FACULITY OF ENGINEERING
COMPUTER ENGINEERING DEPARTMENT
Supervisors: Students:
Dr.Sufian Samarah Amina Sami Daoud
Dr.Alaa Almasre Tasneem Eshqair
A car that identifies a parking space and parallel park by itself was created in this project.
The Car drives down a street searching for a parking space to its right using a distance
sensor. When the car identifies a space, it checks to see whether that space is large enough
to park in.
If it determines that there is sufficient space, the car will begin parallel parking into
that space. It uses information from sensors placed on front, right, and rear of the car to
direct the car into the parking space. Once the car was parked, it will remain in that position
until it is reset.
The project is broken down into two major components: the control system and the
move car algorithm. The move car algorithm directs the car and the control system
implements the directions of the move car algorithm.
Sensor
Data
The control system contains all the hardware and its associated software. It allows the
parking and parking detection algorithms to interface with the car. The software in this
module is broken up into two major sections: the Left-Right/Front-Back (LR/FB) state, and
distance calculations. The LR/FB state machines determines which direction to move the
car the detect parking space and park car algorithms. Once the LR/FB state machine decide
which direction to move the car, by sending the correct input and enable signals to the H-
Bridge. The distance calculations implemented independently.
Move car contains the detect parking space and parallel parking algorithms. The parking
space detection and parking algorithms use information from the distance sensors to set this
movement and guide the car.
Moving the car works by initializing the movement state of the car. It sets the car on a
default trajectory and then detect parking space. Once a parking space has been detected,
the parking algorithm is starting. After the car has successfully parked, it idles until it is
reset.
1.3 Hardware:
• Car.
• Microcontroller.
• H-bridge L298HN .
Three infrared distance sensors were used to determine the distance between the car
and nearby objects. A sensor was pleased on the front, the right side, and the rear of the car.
For the front and rear, a 4-50cm sensor was used. For the right side, a 7-80cm sensor was
used. A sensor with a larger range used for the side so that more easily detect a parking
space.
The output of each sensor at various distance values was used, linear the plot, curve fit
the line, and implemented an analog to digital conversion so that we had reliable distance
values.
Plots of our tow sensors (distance/digital value) point and how to take lines from two
adjacent points, And treat every line as single line equation .
60
50
40
Distance
30
Sensor 50
20
10
0
1000 900 800 700 600 500 400 300 200 100 0
Digital Value
50
40
Distance
30
Sensor 50
20
10
0
1000 900 800 700 600 500 400 300 200 100 0
Digital Value
90
80
70
60
Distance
50
40
Sensor 80
30
20
10
0
1000 900 800 700 600 500 400 300 200 100 0
Digital Value
• X0<X <X1.
• (X0,Y0) ,(X1,Y1).
• Interpolate function:
When we wants any distance we takes analog value from sensors and convert to
digital value while reading (ADC) ,then using our calculations and plots to take the nearly
exactly distance seen by the sensors.
1.3.5 H-Bridge:
L298HN H-Bridge was used to control the motors of the Car. It allows us to switch
between +/-5V across the motor. It also allows us to source the power while using the
microcontroller to control the H-Bridge. The control algorithm turns the appropriate
transistors on/off, applying the proper voltage across the motor. The H-Bridge is connected
using the following configuration:
H-bridge Schematic :
1.4 Software:
When the park is detected by the sensor the Car will be stopped.
Go back until the beginning of the gap that detect by the Side sensor when it goes
back.
After that stopped then turn the wheel left.
Go forward outside of the gap then stop.
Turn the wheel right then go back inside the gap.
Turn left go back to the side wall avoid touch it by takes the data from rear sensor.
Turn right close to side wall.
Go forward avoid touch the front wall using data from sensor.
Forward until Go back until Turn wheel Go forward
Detect Park beginning of Gap /stop
left