A beginner project exploring the capabilities of the ESP8266 with a WiFi-controllable tank robot

Similar projects worth following
The ESPtank is a fun, simple little project that I put together to learn and iron out the development quirks of the ESP8266 (as it is my first project with the module).

As of now, it is able to drive around and honk its "horn" via WiFi. Again, simple, but it has fulfilled its purpose for the moment. (And is fun to drive around!)

The Hardware

I decided to begin with Adafruit's Huzzah board, for its built-in level shifting, reset and bootloader buttons, and easy (unobstructed) access to the ESP-12E module, which I may use in future projects. I also wanted to support Adafruit's awesomeness! Their guides and released schematics are golden!

The tank base comes in several easy-to-assemble parts from Tamiya (bought off Pololu), and is controlled by a DRV8833 Dual H-Bridge breakout by Pololu. I made some standoffs from metal strapping to mount a plexiglass platform to the base tank.

Power is provided by a pair of 18650s from a laptop battery I tore apart a while back, which I charge with a Turnigy Accucell 6 (although any Li-Ion Charger should work with some caution). These are held in a 3D-printed battery pack designed by [enif] on Thingiverse. On the first working version, there is a Breadboard Power Supply by Adafruit for regulation, but it is only used to supply 3.3V to the Huzzah. I have since realized that this is completely unnecessary, as the Huzzah has an on-board 3.3V regulator (updated pictures to come).

Just for fun, I recently added a small 3-6V buzzer I found (as the "horn") to add some comedy to the test runs, although it's probably not very good on the '8266 current-wise.

If anyone is interested, I can make some Fritzing schematics for how everything goes together (I will be adding a basic written pinout to the github repo at some point).

The Software

There are several ways the tank can run at the software level (which I have thought of so far):

  • Autonomous Loop

This is the easiest to implement, and I have tested several of the tank's features this way (the current github repo has a simple loop for testing the hardware).

  • Blynk App

This was the platform that I used for my first attempt at wireless control. Blynk is awesome: amazing graphics, an easy interface, and rich platform support make it powerful. It's one downfall for my situation was that it requires a connection to their server to work. My tank worked indoors at my house, but with some lag depending on where I was in regards to my router. Good for prototyping, but on to better solutions!

  • RoboRemo App

A somewhat less documented and professional-looking solution came up in my search for a direct connection solution between my tablet and the tank. The video below looked promising though, and I thought I would give it a try.

It worked great! The app works by taking values from virtual sliders and buttons much like Blynk, but instead of going to a remote server and back via a router, they go directly to your ESP8266 (which you set up as a TCP server) in a continuous string. Code on the '8266 breaks up the string by pre-defined keyword, and interprets the values from the inputs as commands.

It took some head-scratching to port the example code for my purpose, but it works now (and is up on the github repo for anyone to take a look at). Thanks RoboRemo!

[Edit]: Now that I have attempted testing this at school and other locations unsuccessfully, I have found that though my tablet always directly connects to the tank, the ESP8266 refuses to connect to the app with any stability unless the tank is also connected to a router. I have found that it works at home because it stores WiFi credentials in memory until replaced. If anyone has any suggestions/help they could offer, it would be much appreciated.

  • Local HTML Server

I haven't gotten around to this yet (It's high school robotics season, and I have some exciting projects coming up!), but I would like to build a simple web server with HTML buttons on the '8266 to make the interface more universal among devices.

  • 1 × Adafruit Huzzah Adafruit's esp8266 dev platform
  • 1 × Pololu DRV8833 Dual Motor Driver Carrier Breakout for TI's DRV8833
  • 1 × Tamiya 70098 [universal plate set] Chassis Part 1
  • 1 × Tamiya 70097 [twin-motor gearbox kit] Chassis Part 2
  • 1 × Tamiya 70100 [track and wheel set] Chassis Part 3

View all 9 components

  • Code Fix!

    Benjamin Broce04/20/2016 at 02:34 0 comments

    Success! After a long break from ESPtank for school and other projects, I stumbled across a great Sparkfun article that seemed like it would solve my aforementioned connectivity problem (the android device not being able to connect to the tank out of range of my home router - presumably because it was stuck trying to connect to the internet simultaneously).

    According to the article, you need to make the following call in the Arduino code to lock the '8266 into station (WIFI_STA), access point (WIFI_AP - what I used for ESPtank), or combined (WIFI_STA_AP - default) mode:


    This seems like it would fix the bug, but instead it threw a compiler error.


    I looked around a little more, and found this page, also by Sparkfun, that has example code using this command instead (with the same parameters):


    I tried it out, and it worked!

    [If someone at Sparkfun sees this, you might want to fix that first article... but thanks for the resources!]

    Lesson learned - make sure you set your WiFi mode when writing in Arduino for the ESP8266!

    I seem to have left this post in "Draft" mode for a while... sorry!

    Video & wiring diagrams in a couple weeks (busy summer)!

View project log

Enjoy this project?



Turo Heikkinen wrote 09/26/2017 at 07:59 point

Hi Benjamin!

Any new control methods for the tank you've found? I'm looking for some simple beginner friendly Logo turtle-like programming environment for such an ESP robot, not bumped into a decent one yet. The idea would be to make it follow simple programs like "L30 F50" (left 30 degrees, forward 50 units) to accomplish missions, like the ones kids nowadays have in their schoolbooks, to transfer these on-paper excercises to the physical world.

BTW, been a while since the conversation about battery terminals, but these are good for printed battery cases. Also these strips I have used, with bumps printed in the minus end under the strip.

  Are you sure? yes | no

Benjamin Broce wrote 09/27/2017 at 04:35 point

Hey Turo! Thanks for the battery holder suggestions (cheap 18650 packs are great for robotics)! I haven't messed with the ESPtank too much since I got it working (I've been teaching programming for my school robotics club and building a reprap in the meantime), and in my most recent attempt to program it, I managed to brick the ESP8266 on it (though I'm not quite sure how).

I've been pretty excited for micropython [] on the ESP systems lately, and have put a bit of thought into using it for the tank. When I get a replacement for the '8266 on the bot, I can definitely look into implementing a simple wireless serial command system like you're suggesting. The major limitation to using it in an educational environment like you suggest is that my particular design is pretty bare-bones, and doesn't include encoders on the motor shafts. This just means that unless you add some kind of rotation sensor on the motors, the commands would be based more around motor direction, motor power, and time than accurate unit movements and degree turns.

Regarding the mechanical design, the tank was easy to build and is pretty great for traversing obstacles, but a 3d printed "can bot" [] or other 3d printable tank might be cheaper. The electronics would remain essentially the same.

  Are you sure? yes | no

Audrey Robinel wrote 03/13/2016 at 02:55 point

Hi, i am interested in how you did the battery tabs? For my project (, i printed the box and got the tabs from a commercial battery box, but i'm looking for other ways to do it. Could you give me more details about it?

  Are you sure? yes | no

Benjamin Broce wrote 03/14/2016 at 01:51 point

Hi Audrey! It took me a while to figure out how to mount 18650s in a convenient, reliable way, and I still haven't quite figured out a clean solution. I've used 3 methods so far (all with varying improvisation based on what I had): 

1. Right-angle wood channel with glued-on perfboard end caps & metal strapping fashioned into "springs." Worked well, but took time to assemble and was too easy to remove the battery.

2. The 3D-printed design I referenced above by [enif], which has awesome integrated springs (but requires you to wrap wire through tiny slots - very time consuming and tedious, and melted the PLA a bit when soldered). This is the version currently on the robot.

3. The same 3D-printed design with thin metal strips cut from the strapping (any thin sheet metal would work the same) instead of wire. This is quite a bit easier to get through the slots (more so on the flat side than the spring side), and is what I'm currently using in my parallel battery charging setup (external).

Sorry that these are so difficult to replicate (your method seems almost better in this regard), they were just easy to make with materials I had on hand. Pictures to come.

  Are you sure? yes | no

Audrey Robinel wrote 03/14/2016 at 05:36 point

Hi, thanks for the insights. As you mentioned, i'm looking for a method to produce this easily at low cost, so ideally i wish i could find just the battery tabs alone... however i still have to buy the battery boxes and get the tabs out of it (and i am left with the plastic boxes afterwards, maybe i can turn those in battery storages?)

Anyway, thanks for the answers, and keep on hacking, this one is a really neat project!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates