Obstacle Detecting Autonomous Car: A Step Toward Safer Roads
1
Problem: Too many car crashes causing a great number of deaths.
Name: Veer Dave
School: Sierra Vista Middle School
Grade: 7th
Teacher: Mrs. Gordon
Abstract
Problem:
In 2022, 42,514 people lost their lives in car crashes, which resulted in an economic cost of $340 billion for the United States. This alarming statistic highlights the urgent need for solutions to reduce motor vehicle collisions and enhance road safety.
Objective:
To address this issue, I decided to build an obstacle-avoiding car that can autonomously detect and stop before colliding with an object. The goal was to design a prototype that would demonstrate how autonomous technology can help reduce accidents on the road.
Materials and Procedure:
To build the obstacle-avoiding car, I needed several components. After testing my initial design, I finalized the following materials: Acrylic sheet (for the car base), Arduino Uno, Motor Driver Shield, Jumbo battery, Four TT Gear Motors, Servo Motor, Ultrasonic sensor, Four wheels, Jumper wires, and Zip ties
Steps Taken:
Data and Analysis:
The United States has experienced significant population growth, and the rate of traffic fatalities has increased by 38% per 100,000 people over the last four decades. My project aimed to combat this rise in road accidents by creating a car capable of autonomously avoiding collisions.
In version one of my design, I used cardboard as the base, but it was not sturdy enough to support the weight of all the components, causing the car to fail. In version two, I switched to an acrylic sheet (about ½ cm thick), which provided the necessary strength and durability. I also replaced screws with Zip ties, which helped prevent parts from loosening during operation. The second version performed much better, successfully avoiding obstacles by stopping just in time.
Conclusion:
The obstacle-detecting autonomous car prototype demonstrates the potential of technology to reduce traffic accidents and save lives. If widely implemented, such systems could significantly improve road safety, making driving easier and less dangerous for everyone. This project validates the concept of autonomous vehicles as a feasible solution to the ongoing problem of motor vehicle collisions.
2
Introduction (Background Research)
Objective:�To build a self-driving car that can avoid obstacles using sensors and motors, and to learn C++/Java programming for Arduino.
Components and Functions:
Criteria and Constraints:
3
The Engineering Solution, Prototype/Model to be tested.
The model I designed aims to help avoid obstacles, addressing the issue of car crashes across the U.S. It uses an ultrasonic sensor to detect obstacles, functioning similarly to a camera. The solution is to create a car equipped with this "camera" that detects obstacles in its path. Once an obstacle is detected, the car will automatically stop at a certain point to prevent a collision.
4
After putting on the wheels I realized that the cardboard would not work at all because of all the weight. I didn’t even get to put the Arduino in. I hot glued the Gear Motors so I had to take it out.
This model shows all of the components. It also shows what each component is connected to.
Materials
Red Color = Revised materials.
Black color = Normal materials.
5
Arduino Uno
Ultrasonic Sensor
Motor Driver Shield
TT Gear Motors
Procedure
Red Color = Revised procedure.
Black color = Normal procedure.
6
3.
5.
Step number 5 where I attached the Gear motors. I revised the cardboard with the acrylic sheet.
Step number 3 where I was making the holes on the Acrylic Sheet.
Results – Data/Observations
During testing, I collected data on the performance of the car. One key finding was that the car worked 90% of the time (9 out of 10 tests). It didn’t work the second time because the ultrasonic sensor had shifted slightly to the left.
I also measured the time it took for the car to travel from one place to another. While the speed was acceptable, the car was quite noisy during operation. In the first test, the car worked well, but in the second test, it bumped into a cardboard box. After identifying the issue, I quickly fixed it by adjusting the sensor alignment.
7
This is where I was testing my car against the obstacles, and it worked. The car stopped and then went back, trying another way to go there.
Obstacles in the way of the car
Revised Solution and Prototype/Model
I revised the prototype I originally built. Initially, I planned to use screws to secure the Arduino and battery holder. However, I realized that due to the material of my base, it would be easier to use zip ties instead. When I used screws, they would often fall out because the acrylic sheet had large holes, and the screws were too small for the thickness of the sheet. The screws needed to be smaller to fit the Arduino, but they didn't hold well. In contrast, using zip ties made the assembly much easier, and both the Arduino and battery holder stayed securely in place.
Overall, Version 1 (with the cardboard base) was easier to assemble because it didn't require a drill, and cardboard is a common household item. However, Version 2 (with the acrylic base) worked far better in terms of stability and durability.
8
This one is the “in progress” version of version two. The thing in the center is the motor Driver Shield. The four yellows on the corners are the Gear motors. And attached to them are the wheels.
Arduino
Motor Driver Shield
Wires
Gear Motors
Wheels
Revised Solution and Prototype/Model pt.2
The picture on the left shows two issues: 1) the cardboard was too weak, and 2) the cardboard bent easily. This is why I decided to revise the solution. In contrast, the two pictures on the right show a much more stable and neat setup.
One additional benefit of using the acrylic sheet is that it is transparent, allowing you to see the gear motors on the other side. While cardboard is inexpensive, it lacks the durability and stability that the acrylic sheet provides.
9
More stable
Being bent
Unstable and won't stick properly
The final product of my car. All I would need to do it connect the battery to the connecter and it would work.
Ultrasonic Sensor
Servo Motor
Revised Solution and Prototype/Model pt.3
10
I had to define all of the ports and set the max speed of the motors.
The first line of code is connecting the servo motor to a specific pin on the Arduino and the second line of code is telling the servo motor how many degrees to turn to look for obstacles. Look below.
These to pictures of the code are for the ultrasonic sensor. It is saying that the servo motor will look 170 degrees to the left and 50 degrees to the right. It always look left first.
These two pictures of my code are for the TT Gear Motors to move forward, backward, turn right, and turning left.
Steps Taken:�The first step was to define all the necessary ports and components for the project.�I began by programming the DC motor, using the void setup() function to initialize the servo motor and set its angle.�I then set up the void loop() function and declared two integer variables, distanceR and distanceL, both initially set to 0.�I created a movestop() function to halt the motors when necessary.�I developed a function to control the ultrasonic sensor so it can look both right and left.�Finally, I implemented functions to move the robot forward, backward, left, and right.
Discussion
Version 1:
Version 1 didn’t work at all. I couldn’t even test it because it kept breaking and bending. The cardboard was too weak to support the weight of the components. I barely finished assembling it, and when I finally tried to test it, it broke. This version was a complete failure. I also thought the screws on cardboard would be effective, especially when I found some extra ones at home. However, they didn’t hold well, and I had to find an alternative solution.
Version 2:
Version 2 was much better. The zip ties were a huge help, and the acrylic sheet base was strong and durable. It could support all the components' weight and functioned properly.
Overall, I realized that cardboard wasn’t a reliable base, and the acrylic sheet worked much better.
Performance:
The car worked 90% of the time (9 out of 10 attempts), which was a significant improvement.
Reflections:
The project didn’t turn out as I had expected. For example, I initially thought that the cardboard would work, but I was wrong.
11
Conclusion
Whenever I go on the road, I see self-driving cars everywhere. In my city, more than half of the people own Teslas, which can drive themselves. There are also other autonomous vehicles like Waymo, Zoox, Cruise, and RoboTaxis. These cars are all self-driving taxis, operating without a driver. Waymo, Zoox, and Cruise have a 360-degree camera mounted on the roof to observe the surroundings. The RoboTaxi, similar to a Tesla, uses many cameras on the exterior to navigate.
Inspired by this, I created an obstacle-avoiding car that uses ultrasonic sensors to detect obstacles. In real life, cars like Teslas use cameras—Teslas, for instance, have 23 cameras on the outside and one on the inside. The model I built worked as expected, and I learned a lot in the process. For example, I learned how to program in C++ and how to use libraries. I also enjoyed designing a mini car, which was both fun and educational. Throughout the project, I encountered many learning opportunities and developed problem-solving skills.
Solution and Results:
The solution I built was an obstacle-avoiding car that didn’t bump into any cardboard boxes. I believe the results were positive because the ultrasonic sensor used sound waves to detect obstacles. However, using cameras would likely improve the accuracy and clarity of obstacle detection, just like in real-world self-driving cars.
Challenges and Future Improvements:
One issue I encountered was the noise produced by the ultrasonic sensor when it turned. The car made a loud sound, which could be improved.
Looking ahead, I think I could experiment with different materials to build the car. The current base was quite sharp, and I ended up with many cuts while drilling. Trying a different, smoother material could make the construction process safer and more efficient.
12
Reflection/Application
I learned many valuable skills throughout this project, such as how to code in C++, assemble the car, and use libraries. I also gained a deeper understanding of how all the components work together. Another area where I made progress was in problem-solving. For example, one of the wheels wasn’t working, and I spent 45 minutes trying to fix it. I adjusted the wheel position, checked the jumper wires, and tried other solutions. Eventually, it hit me: I should replace the battery. Once I did that, the wheel started working perfectly.
If I could do something differently, I would have tightened the zip ties more carefully from the beginning. I struggled with this at first, and it took longer than expected. But in the end, I got it done. Also, I would have skipped the cardboard base entirely and used the acrylic sheet right from the start.
Next Steps:
The next step would be to make the car fully autonomous. I could also add a GPS system, allowing it to function more like a real-life Tesla.
With further improvements, driving could become much easier and safer. Drivers would no longer need to control the steering wheel, pedals, or other manual functions. They would simply enter the destination, and the car would take them there automatically.
13
Yearly snapshot. (n.d.). IIHS. Retrieved August 1, 2024, from https://www.iihs.org/topics/fatality-statistics/detail/yearly-snapshot
Wagner, L. (2019, February 3). How To Make A DIY Arduino Obstacle Avoiding Car At Home. YouTube. Retrieved August 1, 2024, from https://www.youtube.com/watch?v=1n_KjpMfVT0
How Ultrasonic Sensors Work – MaxBotix. (2023, March 1). MaxBotix. Retrieved August 1, 2024, from https://maxbotix.com/blogs/blog/how-ultrasonic-sensors-work
TT Motor — SunFounder Ultimate Sensor Kit documentation. (n.d.). SunFounder's Documentations! Retrieved August 1, 2024, from https://docs.sunfounder.com/projects/ultimate-sensor-kit/en/latest/components_basic/29-component_ttmotor.html#
Cameras. (2024, 06 14). Tesla. Retrieved August 1, 2024, from https://www.tesla.com/ownersmanual/modely/en_us/GUID-682FF4A7-D083-4C95-925A-5EE3752F4865.html
14
References Cited