In this tutorial we will build a Cat on a Tank chassis that is controlled by a mobile phone through HTTP requests. The tank is a WiFi hotspot so everyone who can login, goes to a IPaddress and can control the beast.
Step 1: Getting Started
- Tank Chassis
- L298N Dual Bridge DC stepper controller Board:
- I used the Velleman dual motorshield (409D)
- Voltage converter*
- Wemos D1 mini
- With pins soldered onto the Wemos.
- Male to Female (2x
- Male to Male
- Female to Female (4x
- For wires and connecting 3D model onto the tank chassis.
Paint, black oil based for metal
- In the tail, for connection feedback.
- Length: 18,5cm (7,28inch)
- Width: 4,5cm (1,77inch)
What you need
- Solder Iron
*The voltage converter has to be able to convert 3,3V into 5V. As the motors on the tank chassis use 5V, and the Wemos D1 mini uses 3,3V on output.
*Or similar software for preparing 3D models to be printed.
Step 2: Installation
Step 3: Code
Code for the Wemos D1 mini
- Open up the Arduino IDE
- Copy/paste the code onto a new sketch (CTRL+N/CMD+N). The code provided is based on the example file in Arduino IDE: File > Examples > ESP8266 WiFi > WiFi Access PointUse the correct settings to upload the sketch
- Upload the sketch onto the Wemos D1 mini
Use these settings for uploading sketches onto the Wemos D1 mini:
Board: "Wemos D1 R2 & Mini"
CPU frequency: "80mhz"
Flash size: "4M SPIFFS"
Upload speed: "115200"
Port: "[your serial COM port]"*
* You have to connect a mini USB cable in the Wemos D1 and computer. If you don't see a COM port listed, the driver is not installed or there is no USB connection.
Step 4: Wiring
Check out the wiring diagram (PDF) for how your wires are connected.
I made use of different type of wires:
Male to Female, Male to Male and Female to Female.
By cutting the edge of a small breadboard to have more GND and more 5V output (check photo in this step).
You don't have to cut it but all the wires will fit more easily if you do.
Step 5: 3D Model
If you don't want/can not 3D print
Make a model 5.5CM wide and 18.5CM in length using paper mache or buy a toy Cat to fit on the tank.
The model of a cat I found on the internet.
Then I used blender to cut the Cat's legg's off (ouch!) and make the model hollow so the electrical parts fit inside.
The tail of the Cat is also hollow so 2 wires and 1 resistor can fit in it with the LED on top.
Use software like Cura to prepare your model for 3D printing.
You can be smart and lay the back part flat on the surface and add support (option in Cura).
By using an electrical screwdriver you can drill a hole on the top of the tail.
You have to get rid of the support with a knife or a trench. When you use a trench you can rotate to make the whole thing easily coming off. I cut the base of the parts off so you can fit the wires and motor shield nicely inside the body.
Use oil-based paint (I used black) for steel and paint the cat black. Add whiskers by cutting off some hairs off a paintbrush. Glue them when the oily paint is still wet on the cheecks for a nice little detail.
Step 6: Connecting
Connecting the tank
Put the batteries in the batter holder (I had to get rid of the middle part in the battery holder as the batteries didn't touch each other).
Use the red switch on the front of the chassis to power the tank.
After 10 seconds a Access Point is live where you can connect to: ? Use password 12341234.
Use a mobile web browser to go to the IP address 192.168.4.1 and you can control the tank by using the webpage.
We have a be nice policy.
Please be positive and constructive.