Intro

Oliver is a small track-driven robot controlled via a web application using MQTT to send instructions to an ESP8266 brain. Keep in mind that the ESP8266 runs on 3.3v logic, so the usual sensors you would use to do things like obstacle detection won’t work here. However, you’re more than welcome to use a 5v Arduino board and use something else for control instead of the ESP8266

Material Requirements

  • Tank Chassis – https://www.osepp.com/robotic-kits/4-tank-mechanical-kit I used a whole tank kit from OSEPP. The chassis is high quality extruded aluminum, but the tracks are made of a pretty cheap rubber that doesn’t seem to work well on high friction surfaces like carpet. But it also includes two motors that fit perfectly with the chassis to make for a pretty solid drivetrain system; so the tradeoff was worth it.
  • Motor Driver L298N – https://www.amazon.com/Qunqi-2Packs-Controller-Stepper-Arduino/dp/B01M29YK5U This is a pretty bulky breakout board, but it includes a heatsink. I tried a smaller chip but had issues with heat when the motors were under heavy load.
  • HiLetgo ESP8266 NodeMCU – https://www.amazon.com/HiLetgo-Internet-Development-Wireless-Micropython/dp/B010N1SPRK This is the main brain of the robot. The ESP8266 comes WiFi-Enabled by default and has a fairly large ecosystem around it, which made finding libraries for sending/receiving MQTT pretty easy! I used the HiLetgo brand of ESP8266, they are considerably cheaper than the adafruit alternative and work just as well in my experience. But everything I’m doing should be translatable to just about any arduino board, you just have to change the pinout references.
  • Breadboard – https://www.amazon.com/Antrader-Solderless-Breadboard-Tie-points-Prototyping/dp/B07G731PHQ I used a solderless breadboard since I prototype quickly and change components often. (Like adding/removing obstacle detection and NeoPixel Strips). But you are more than welcome to make your final product with a solderable protoboard if this isn’t your first time attempting project like this, if this is your first arduino project than I highly recommend the solderless breadboard
  • GPIO Jumpers – https://www.amazon.com/Kuman-Breadboard-Arduino-Raspberry-Multicolored/dp/B01BV3Z342 You can make your own or buy them preassembled. Buying them saves a lot of time
  • Battery – https://www.amazon.com/GOLDBAT-1500mAh-Softcase-Battery-Airplane/dp/B07LGYSGZH The battery is really up to you, you could use 6 AAs and get a good result (Although it would be wasteful as the AAs would be drained rather quickly). So any rechargeable battery should do so long as it is between 6-12v and can fit on your chassis.
  • Neopixels Strip (Optional) – https://www.adafruit.com/product/1426 I use the neopixels strip to show when Oliver has connected to the Access Point and the MQTT broker. It can also show cool effects like a Cylon eye for added intimidation!
  • Raspberry Pi (Optional) – https://www.amazon.com/CanaKit-Raspberry-Premium-Clear-Supply/dp/B07BC7BMHY/ref=sr_1_3 Oliver was developed with DEFCON in mind; and I wanted to take Oliver to DEFCON and drive him around while I was there. In order to do this I needed to run a local, secure, MQTT broker and a wireless Access Point, and I needed it to be portable. If this isn’t the case, then you can connect to your home wifi and run an MQTT broker from your local server or Digital Ocean box or something.
  • Zipties (Optional) I used zipties to affix my battery since I bought the wrong size. You may end up not needing them depending on which battery you buy.

Step 1: Put together your Chassis

  1. Breadboard
  2. L298N Motor Driver
  3. Battery
  4. Cargo Area

The OSEPP Robot Kit comes with some pretty good instructions, and it’s fairly modular. I bought an extra set of Aluminum Beams from OSEPP to make my Oliver a little wider. All it took was replacing the step where it said “Connect the Left to the Right side” with 2 Beams instead of just one.

Next pile your components onto the chassis. I put my breadboard in a central location with the motor driver just in front of it. Then attached the second black plate to the front to provide a spot for cargo. (At DEFCON I put the raspberry pi there)

Step 2: Wire Motors to the L298N Board

Each Motor has both a white and black/white striped wire. These will be connected to the output terminal blocks on the L298N board. Just follow the diagram below (if you are using the same kit as me, otherwise there may be some trial and error to determine which polarity to use for your motors. If one, or both, motors are turning in the wrong direction and you know the code is correct, then try swapping Output 1 for Output 2 or Output 3 for Output 4.

Step 3: Wiring the Inputs

Now we need to wire the PWM pins from the ESP8266 to the Motor Driver board. I’ll be referencing the below pinout diagram. Yours may be different, in that case just google “[My Arduino Board] Pinout Diagram” and go to images.

EN1 and EN2 are our Enable pins. When sent a PWM value of 0-255 we can tell the motors how fast to go. EN1 for Motor1 and EN2 for Motor2. IN1-4 are used to tell the motor which direction to go. For example, if we send a HIGH output to IN1 and LOW to IN2, then Motor1 will spin forward as fast we tell EN1 to.

2023-03-09

⬆︎TOP