After using Bluetooth in one of the labs and seeing the untouched servo and DC motors in our boxes, we thought it would be cool to try to control motors remotely. Thus, the idea of RovoSpy was born. Initially, Palmer wanted to design something to monitor the health and well-being of his fish (which is the origin of the video live stream idea) and Melanie was really interested in making something related to robotics. By combining these two ideas we came up with RovoSpy.
What it does
The RovoSpy is capable of moving forward and backward and turning left and right. It is controlled by a remote control that we built that communicates over Bluetooth. The rover also has a servo motor, which is where we intended to mount the camera, that is controlled by a potentiometer on the remote. The camera streams a live video feed to Facebook.
How we built it
The project consists of three components. The first is the remote control, which consists of an Arduino Uno, push buttons, a potentiometer, and a Bluetooth transmitter. It broadcasts information about which buttons are pushed and the value of the potentiometer at regular intervals. The second component is the rover itself, which has an Arduino Uno, two DC motors, a servo motor, and a Bluetooth receiver. The Arduino Uno interprets the information from the remote and controls the DC motors accordingly. The DC motors are attached to their own 9V power supply. Finally, we used a Raspberry Pi with a camera module to run the live stream. It captures video using the raspivid command, encodes it in H264 using ffmpeg, and sends the encoded data to Facebook's servers using the RTMP protocol.
Challenges we ran into
Like any project, we encountered several problems and challenges, most of which we solved. We had some initial trouble wiring for the motors correctly and had to rewire them several times to get them working. Furthermore, we had some challenges with the video feed. Originally, we were planning to use an ArduCam, which as the name suggests, is really designed for an Arduino and not a Raspberry Pi. Still, we found some hacky tutorials online that claimed to explain how to use the ArduCam with the Pi.
We did not have much success with these methods, so Palmer decided to use his own official Raspberry Pi Camera Module for the project. Another challenge related to the video feed was installing the H264 encoders. We found a Docker image with pre-built ffmpeg and related binaries for Raspberry Pi, but it proved to be too large to fit on the Pi's limited memory. Instead, we compiled the libraries that we needed ourselves. At one point, these libraries failed to download because the time on the Pi was incorrect (I believe that this was breaking SSL). We resolved this issue by forcing the Pi to connect to the internet earlier in the boot process so that it could connect to an NTP server and fetch the correct time.
Furthermore, there were challenges in terms of the work distribution. This project ended up being very code heavy, so there was a lot of pressure on Palmer to do a large portion of the project.
Accomplishments that we're proud of
It was very satisfying to steer the rover. We put in a lot of time to get to that point, and we were very proud once we got it working (we even showed it off to some of our friends regardless of whether or not they were interested in seeing it). Additionally, we were very excited when Palmer was able to link the Raspberry Pi Camera to Facebook Live, giving a live video feed.
What we learned
We learned that hardware is called *hard*ware for a good reason. A couple of times, the Bluetooth modules fell out of sync for seemingly random reasons. At one point, one of the breadboards we were using began behaving unreliably. Furthermore, some available documentation on the circuitry proved to be unreliable and wrong. When dealing with physical parts, you can no longer rely solely on the abstraction of the system. As a consequence, we also learned that you need to be patient and flexible in your goals when working with hardware.
What's next for RovoSpy
We want to find a way to properly mount the Raspberry Pi camera on the rover. This problem is actually more complicated than it might sound. For starters, we would need a suitable mobile power supply for the Pi. We tried using 9V batteries and USB phone chargers, but neither could supply enough power to the Pi to keep the live stream running smoothly. We also need to find space on the rover to put the Pi, as the rover is already getting quite crowded.
It would also be cool to offer an option to control the rover over WiFi. We tried using both an Arduino Uno WiFi and a regular Arduino Uno with a WiFi shield for this purpose, but were unable to find proper libraries for establishing a WebSocket connection between the Arduino and a web browser. Our mentor, also suggested that we should try using RF to control the rover, a possibility that would be interesting to explore in the future. One final possible extension would be to add limited self-driving capability to the rover. We could do this by applying computer vision techniques to the video feed to identify and steer towards target objects. We could also add infrared and ping sensors. These would use the light / heat emissions and ultrasonic responses from the nearby boundaries.
We would like to thank our mentor, Frank Masuelli, for his assistance throughout all stages of the project. We also would like to thank Arush Jain for his advice on several matters related to the project.