We ran out of hackathon ideas and we like bubbles. We also liked how cool remote control vehicles are.

What it does

It is a tracked vehicle (tank) with a bubble gun on it. It creates a WiFi hotspot, and you can connect to it to access a web app that allows you to drive it as well as aim and fire the bubble gun.

How we built it

An old remote controlled toy was chosen as a platform for the vehicle. It was stripped of its broken electronics and everything we thought wasn't necessary until we were left with only some tracks and the motors to drive them. We chose to use a Raspberry Pi to provide the WiFi hotspot and web interface. An Arduino Pro Mini controls the bubble gun servos and the DC motors that drive the tracks.

Foam board was used to make a frame to mount the servos to and to support the bubble gun so that not all the stress is on the bottom servo that rotates the gun.

The web app on the Raspberry Pi is provided by an app that we wrote in Go. It creates a web server that serves out the Javascript and HTML, and then it uses websockets to allow the Javascript to send commands back to the Pi. The Pi then forwards these commands to the Arduino, which is connected via the serial port. By using websockets, this allows the interface to maintain a persistent connection with the Pi, minimize latency, and gives us the unexpected benefit of allowing multiple people to control the tank at the same time.

Web Interface

The Arduino receives commands from its serial port and determines the angles of the servos and the speeds of the DC motors. It uses an Adafruit Motor Shield v1 to drive the DC motors. The servos are driven directly from the digital pins using PWM and the Servo library.

The entire tank is powered from a 3 cell Lipo battery. An ESC (electronic speed controller; used to drive brushless motors) was used because it had a voltage regulator on it which could step down the battery voltage to 5 V in order to power the Arduino and motor shield.

Challenges we ran into

We ran into various issues including bugs in the Arduino code, wiring issues, and magic smoke. This caused us to take almost the entire 24 hours to finish Bubble Tank and we had to work around the clock.

Some of the major roadblocks we had to overcome were:

We initially planned on using an Arduino Leonardo as the motor and servo controller. It had the same footprint as an Arduino Uno and plugged in directly to the motor shield. Unfortunately, in the early stages of writing the Arduino software, the DC motor library (AFMotor) would not compile on the Leonardo due to the fact that it has a different microcontroller than the Uno. We lost a few hours trying to troubleshoot it, and then we decided to move to plan B and switch it out for the only other Arduino we had with us, the Pro Mini. The Pro Mini is electrically identical to the Uno and has the same number of pins, however the wiring got messy because we had to jumper all the pins on the motor shield to the pins on Pro Mini. Thankfully though, the motor library compiled and worked flawlessly.

Powering everything also turned out to be an issue. We brought some old ESC on the idea that we could use their on-board BEC circuits to provide a stable 5 V for the Arduino, motor shield, and Raspberry Pi. Our initial tests using one ESC to power everything seemed to work, but we quickly noticed that the Pi no longer created a WiFi hotspot and the ESC was getting super hot. The Pi was drawing so much current that the ESC couldn't provide a steady 5 V and was exceeding its 2 A limit. We attempted to add another ESC for the sole purpose of powering the Pi, but it promptly got really hot as well and eventually exploded, releasing its magic smoke. We are not entirely sure why it exploded. It might have had a slightly lower maximum current limit or was faulty. Left with no alternatives to power the Pi from the battery, we opted to use a 10 ft USB cable to power the Pi from an external source, such as a USB port on a laptop or a USB wall charger.

After final assembly, we connected power to make sure that everything worked probably, and we notice our second round of magic smoke, but this time coming from the voltage regulator on the Arduino. Somehow we had messed up the polarity of some of the wires that provided power, and we had to dig through the rats nest of wires troubleshooting everything. Had we assembled everything outside of the tank body and had tested each part individually before assembling it all together, we could have avoided some issues including this one. We eventually found the issue and replaced the Arduino with a spare we had.

Accomplishments that we're proud of

This is our first hackathon project that we were able to get working by the end of the weekend. It is able to do all the basic functions that we had hoped for.

What we learned

Robots are a lot of work. We also found it that it is a good idea to test each part of the project individually first before assembling everything, as it allows us to find and fix bugs. Corey and Stephen gained more experience getting things to be controlled by servos and motors as well as wiring and troubleshooting hardware. Corey was introduced to the Arduino platform and got to write some basic Arduino code. Aaron learned the more complicated aspects of Arduino programming and serial communication. Ian learned Go, websockets, and how to get a Pi to talk to other devices. We had fun doing a hardware hack that had an equal amount of work to do on the hardware side as well as the software side, and we will certainly try to do more hardware hacks at future hackathons.

What's next for Bubble Tank

We will be replacing the 3 cell battery with a 4 cell one in order to provide the DC motors with a higher voltage and therefore more torque. This will allow it to drive better over a variety of surfaces.

The current way that everything is powered needs to be changed to a dedicated voltage regulator module so we are not at risk of blowing up the ESC and so that the Raspberry Pi does not need to be plugged into an external power source. This will allow Bubble Tank to drive anywhere without the need to be tethered to a laptop or USB wall charger.

Nearing the end of the hackathon, we had to abandon the idea of adding a webcam to see where the gun is aimed. The webcam is still mounted to the tank, and there is a placeholder for the webcam image in the web interface. All we need to do is finish working on the webcam code and then we add this to the list of features.

Share this project: