In 2014, a new cultural phenomenon took place. A simple script allowing for users to control a game character just by using chat messages, dubbed “Twitch Plays Pokemon,” was said to have over 1.1 million players over the course of its 16 day initial run. The goal of this project was to recreate that experience using a robot and the Twitter platform instead of Twitch. This was done with the help of a Raspberry Pi, which will connect to Twitter and send the motor driver circuit commands based on the different modes. We also built an analog controller to be able to drive the bot to safety in case of malfunction, or just to have a little bit of fun ourselves. All in all, it is a relatively complicated project with lots of moving parts, but was quite fun to play with upon completion. It is important to know that this picks up where the design lab page leaves off, and might be confusing if you have not read that page yet.
Part 1: controller
The goal for the controller was to integrate tank style controls into the motor control portion of the robot. The idea behind this was to completely remove all of the obvious issues of sentience by providing us a way to drive the robot to safety if it starts destroying villages. By using a simple circuit that turns the Arduino off (so that the bot cannot be controlled that way) and directly hooks into the pins of our motor controller, we can control the robot using entirely analog circuitry. This was done using a simple circuit with 2 slide potentiometers for directions. 4 trim potentiometers were used to make sure that the bot goes forward and back straight, but are not really touched after that. Once that is all done, it can be just linked in to the motor control circuit. The final circuit can be seen below:
Part 2: Twitter
Since this portion is mostly code, and a lot of it is fairly self explanatory, I will avoid wordy conclusions in order to just point you to the code, which can be found here. The simple gist of it is: the bot contacts the Twitter API, pulls down either the admin feed or the hashtag feed, and then sends the appropriate command to the Arduino in binary.
All in all this project was quite a mess, and the bottom line is that the Raspberry Pi is not meant to be used in low-power, abrupt power off situations. This led to tons and tons of problems with everything from WiFi to full on file-system corruptions. This project tested my patience in ways I can't quite describe, but the end result, quite simply, worked. I would have loved for everything to be perfect, but with deadlines, sometimes taking little successes is the best thing you can do.