This project was made for a final project for a class (SE 423) at the University of Illinois at Urbana-Champaign.
The robot is designed to move forward on its own. There is an ultrasonic sensor on the front of the car so that if there is an object in the way, then it will turn away from the wall and keep moving forward. In the event that the car cannot avoid an obstacle or gets stuck, a joystick is connected to the motors of the wheels and will control the car in any way you need it to move. Whenever the car moves in reverse the buzzer on the car will sound in a G-note, as well as when the ultrasonic sensor makes the car turn the same sound will occur. The LEDs on the car itself light up and look like a scrolling word, the word I choose to use was "ILLINI".
The Ultrasonic Sensor is connected to GPIO19 and GPIO0, as well as a 5V source and ground. The reading from the sensor gives an "echo_distance" and this is used to trigger a turn within the wheels.
The LEDs were designed as an array with the idea of using 5 LEDs as a column and with three columns on the car itself, the code parses through the array created by using the numbers 0 (LED off) or 1 (LED on). When the code reaches its end, it starts it over again and continues to write the same work over and over again.
The buzzer takes in the reading from the ultrasonic sensor within another CPU timer in order to play a sound once there is an object in front of it, as the car will turn away from the obstacle. The buzzer also takes in the voltReading1 from the joystick and if it is 0, then it plays the sound as the car will reverse.
The joystick utilizes the ADC hardware function and outputs two voltages that are used to send to the wheels and if the car needs to move forward, the voltReading1 will equal 3.0. Now if the car needs to reverse then the voltReading1 equals 0. To turn left, voltReading2 will equal 0, and to turn right, voltReading2 will equal 3.0. If the joystick is not triggered then the code only looks for the ultrasonic sensor reading to check if something is in front of it. So in this case the joystick overrides anything the ultrasonic will cause the car to do so you can have fun controlling it on your own!
Working Project:
https://drive.google.com/file/d/1QI1bo61bPYBcQjr-pUVcFKo9ZJ9nqu85/view?usp=sharing
Explanation:
https://drive.google.com/file/d/1wrjpRBx63b9yU-mV1siPm3OMGxzZzMsx/view?usp=sharing
Comments