In this tutorial, I show you how to make a voice-controlled robotic tank controlled using a smartphone, Google Assistant, IFTTT, and Adafruit.io platforms. An ESP8266 Wemos D1 board was used in this project. It receives commands from a Wi-Fi network and control the speed of the motors. Other development boards might also be used (NodeMCU, Firebeetle, etc.), and the principles presented in this tutorial can be applied on other models of robots and other IoT gadgets.
Solder iron and wire. The DC motors already came with wires soldered to its terminals... But it will eventually break and you might have to resolder it. So consider having a good solder iron and wire neaby.
EVA foam sheet (or other non-conductive material). The robot chassis I used in this project is made of aluminum, and circuit boards are installed on this metal parts. I used a layer of foam sheet between the boards and the metal plate to avoid possible short-circuits.
Double sided tape. It was used for glueing the foam sheets to the circuit boards, and for the installation of the H-Bridge modue.
Scissors, for cutting some foam sheet rectangles.
I used the following hardware parts for my project:
Wemos D1 ESP8266 dev board (link). Wemos D1 board is really easy to use and program with Arduino IDE. It has the same footprint of and ordinary Arduino Uno! This way most of Arduino shield will also work with this board. It has built-in Wi-Fi module, so you can use it in a variaty of projects.You can also use other ESP8266 based boards (link / link).
L298N dual channel H-bridge module (link). This module allows the 3.3V signals from the Wemos (or an Arduino) to be amplified to the 12V needed for the motors.
DIY Robot Chassis Tank (link). This awesome kit has with everything you need to built a tank: two DC motors, gears, tracks, bolts, nuts, etc. It already comes with the tools need for assembling the chassis, which is great for beginners!
18650 3.7V batteries (x3) (link). I used to power the whole circuit. This tank uses 12V motors. I used three 3.7V batteries in series for powering them.
3S 18650 battery holder (link). It can hold three 18650 batteries in serie, and can be easilly be attached to the back of the tank.
18650 battery charger (link). Your batteries will eventually run out of power. When that happens, a battery charger will come to your rescue.
Jumpers (link). I used 6 male-female jumpers for signals between the h-bridge an the Wemos, and 2 male-male jumpers for 5V and Gnd. You might need more if you plan to add some sensors.
Micro USB cable. You'll need this for uploading your code. Most of the boards already come with its own cable.
The links above are only a suggestion of where you can find the items used in this tutorial (and maybe support my future tutorials). Feel free to search for them elsewhere and buy at your favorite local or online store.
Assembling the Robot
The first part of this project was the assembly of the robot structure.
In previous projects I developed the structure of my own robot, using easily accessible materials (without the need for complex tools, 3D printers or laser cutting machines). You can find this project in the link below:
This time I decided to give a chance for a robotic kit obtained from an online store. You can find a link to the robot chassis at the following link: http://bit.ly/2ycI8fP. If you're looking for a kit, I think it's a good option!.
At first it seemed that the assembly would be complex or that I would run into problems like the lack of parts (given the amount of parts that make up the kit). But this kit really surprised me! All the pieces seem to me of good quality, and several spare parts accompanied the kit. Thus, a screw lost underneath the workbench won't make it impossible to carry out your project, which I found to be excellent (especially after losing a couple of screws).
Another positive point is that all the tools needed to mount the robot are included in the kit (a couple of Allen wrenches and the screwdriver). I believe this makes the kit excellent for starters who doesn't have lots of tools!
As a negative aspect I would highlight the lack of documentation. The robot's assembly manual (a spreadsheet file in Chinese) is not extremely user friendly, and there isn't a lot of tutorials online for that tank. And so I decided to document the process of assembling my robot in the video above! Another point of attention concerns the material of the robot structure. The base is entirely made of aluminum, which can cause some short circuit if the pins of the printed circuit boards touch the frame.
There are other online kits that you can use. You can even maker your own structure, as I described above.
Wiring Up the Circuit (Wemos D1)
In the video above I show you how you can assemble the electronics in the robot structure.
A power pack made of three 18650 batteries was installed on the back of the robot. It provides 11.1V (3 x 3.7V) to the robot. That's enough to power the 12V DC motors.
A L298N dual channel H-bridge was used for the control of the motors. It receives some 3.3V signals of the Wemos board, and provide higher voltages for the motors. It also allow the motors to run in both directions, depenting on the combination of those input signals.
Each device was connected according to the schematics.
Follows a list of the pins you'll need to connect: