Hack OH/IO 2018
Back in November, my brother and I decided to participate in the Hack OH/IO program (http://hack.osu.edu/) that takes place at The Ohio State University. We started out with a plan to build a RC car out of a raspberry pi and hardware provided by the Hack OH/IO organization. Unfortunately when we arrived to the hackathon it seemed that their parts list was incorrect. They did not have engines, wheels, axels, or basically anything else that we needed to build the car. So, we had a better idea. We decided that we would purchase an RC car from Target and attach it to a raspberry pi. The end goal being that we could control the RC car over WiFi via a computer.
We removed the bottom of the car and found a (rather-simple) electrical circuit connecting the motors that controlled movement back/forward as well as the motors that controlled turning left/right (interestingly, the board was mislabeled where left was actually turning right, which we found through experimentation). The Pi needed to be wired into the 4 double A batteries in order to power it without a cord, to allow for longer travel distances. After shorting out the system a few times and draining a few sets of double-A batteries it finally got wired in correctly. We then had to wire the raspberry pi's GPIO pins to the motors to allow motor control. Unfortunately, we soon discovered that the raspberry pi wasn't producing enough power to engage the various motors. This problem eventually got solved (after an arduous brainstorming session) by wiring multiple GPIO pins together on a breadboard to increase how much power could be put into the circuit.
Nearing the end of the competition, I began programming the controller system. Using a library called gpizero (https://gpiozero.readthedocs.io/en/stable/) I was able to send signals to turn GPIO pins on/off. I didn't have enough time to develop a good-looking GUI for the controller, so I ended up just using python to handle keyboard input and send it to the raspberry-pi. I experienced difficulties using certain keyboard input libraries (they wouldn't allow me to handle multiple keyboard events at once), so I just went ahead and used the Pygame library (https://www.pygame.org/) to handle input which worked beautifully. You can view my code for this here: https://github.com/TomCasavant/Raspi-RCCar/blob/master/PygameController.py
With about 15 minutes remaining, we decided that the car was as complete as it was going to get and that it was ready for judging. A video of the car running can be found below