Self Driving Car – Figure 8

The Arduino programmed self-driving car is finally capable of driving around in a figure 8!  The car can only preform a figure 8 and is capable of avoiding collisions into anything in its path. I also programmed it to reverse and turn when something has stopped it, to overcome the obstacle and to continue the figure 8 command.

The hardware for this project was rather simple, just for testing purposes I have mounted a breadboard on top of a average remote controlled car that was stripped down to just the two motors left; one for steering ,and one as a drive motor to complete forward, backwards, and even brake commands. The commands controlling the motors are ran through a new motor driver coming from the Arduino board. I was informed that I could control the motor speed from controlling the PWMA pin on my motor driver ( the pin on the Arduino Board must have a tilde ) for the the motor speed control to be in affect. The code for motor speed on the Arduino program is analogWrite then you can list any number from 0-255 within the parentheses after your pin and comma; for example (   analogWrite (  5, 215 )  ).  The next step for me was including the motion sensors, to detect the distance of an object that way the car could have a command to reverse and go around the object or structure in its path. I’ve added two sensors that will be placed at a certain angle to create better vision of all surroundings for the car. I had several codes I needed for the figure 8 and HC-SR04 already typed up, the challenge was intertwining them together.  I created two functions for each so it was very simple to throw the commands in for the sensors in the void loop.  My next step for the RC-car is to create a series of if statements that will be ran through in the void  loop.  The if statements will make the car completely capable of driving around on its own without any collisions !

Leave a Reply

Your email address will not be published. Required fields are marked *