Raspberry Pi : Autonomous Robotic Car
We are building a car that will move on it own, follow the track when it see a line, and stop when it see obstacles. In this project, we get to connect the RaspberryPi with other devices such as sensors and buzzer. A RaspberryPi is like a small computer which has GPIO that enable us to connect it with other electronic appliances. It have a ground and a power GPIO which provide the power to the connected devices. It also have the signal GPIO which are used to read or send out information to the devices. In our car, there is 2 line trackers, 2 obstacle detectors, a driver, 2 motors, breadboard, 6V battery cell, power bank, and a RaspberryPi. The RaspberryPi is powered by the power bank. It was used to read the information from all the sensors and determine whether which direction the car will go or when to activate the buzzer. The driver is connected with the 2 motors. It is powered by both the RaspberryPi and the 6V battery cell because it require a lot of power and it won't be able to turn the motors if we use only one of it. To use the driver, we import the Robot library into our python code and use the forward(), backward(), left(), right(), and stop() functions to move the car. Since the RaspberryPi has only about 4 power GPIO which is equal to the amount of the sensors we gonna use, so we decide to connect the ground and power with the breadboard and connect all the sensors to the breadboard. This will require us to use only 1 pin of ground and power GPIO each. Instead of using up all the 4 power GPIO, we can still keep the rest to use with other devices such as buzzer or LED. We import the RPi.GPIO library to setup the GPIO pin that we will connect it with the sensors. We set it to GPIO.IN which mean that we will read the information that the sensors is sending to us. More details about how the line tracker and obstacle detector work can be found in the Raspberry Pi : Line Tracker and Obstacle Detector post. Some problem we face is that the weight of the car is more in the back which make the car to be unstable and is tilting backward. We solve this problem by adding a clay into the front of the car to balance the weight.
ESLOs:
- Strategic Learners
- Innovative Thinker
- Leader of the future