ESP32-Skid-Steer
Bruder Catepillar Skid Steer model converted to RC, controlled by an ESP32 with 2 analog joysticks and a receiver that is an ESP32 on the model.
Written with StackEdit.
ESP32 Skid Steer Project
In this project I converted a Bruder Skid Steer model into a remote controlled version controlled by 2 analog joysticks, of which is then transmitted by an ESP32 to another ESP32 via ESPNOW protocol. The receiver ESP controls the servos with PWM after mapping the raw data from the sender ESP32.
⚙️
Parts used
Note that these parts below are the ones that i used in my build, you do not need to use the exact same servos. If you are not in a time crunch I recommend buying some of these parts from aliexpress.com, you can save a little bit of money in exchange for longer delivery time.
- Bruder Skid Steer
- 2x ESP32 dev modules The sender and receiver modules
- 1 high torque servo like KS-3518, MG996r or any equivalent strength for moving the arm
- 1 MG90s servo for controlling the bucket
- 4 MG90s continuous moving for driving the wheels, note you may want to pick better quality servos as these have a lot of slop in them, which is why i used a washer in between the wheel and servo as you'll see later
- OLED SSD1306 i2c dislpay 128x64
- 2 Joystick modules
- 18k and 10k resistor and optional capacitors (I used 47uF but anything really works)
- Buck converter 7.4v to 5v, any brand works however i realized later on that this is not necessary as the ESP32 can handle 7.4v (on vin pin)! However i am still using it .
- (optional) Y servo connector, connects the two servos on each side together, you could optionally just solder them together
- Perforate DIY breadboard for easy soldering
- Will need access to a 3D printer for certain parts
📚
Libraries Used
#include <ESP32Servo.h>
#include <esp_now.h>
#include <WiFi.h>
#include "DifferentialSteering.h"
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_I2CDevice.h>
- ESP32Servo library
- DifferentialSteering library The rest you should be able to download from the library manager on Arduino
🛠
How to build
Watch this video, and this one. These videos provide a great help and converting the model into the RC version, I followed everything in that video except for the motors for the wheels, converting the servo into continuous for me and the creator resulted in random jitter as it was very difficult to center the internal potentiometer.
The 3D files I used which was for the servo bucket attachment, i did not use the other parts as i messed up my wheels and used a different servo for the arm.
The 3D files I created the washer to fix the wheel wobble, inner wheel hub, and the tool used to make the hole circular in the rubber tire. The tool is meant to be wrapped with sandpaper and put into a drill so that making the hole circular is easy.
For connections
Receiver ESP32 | Sender ESP32 |
---|---|
Pin 16 will be used for arm PWM | Pin 36 connected to the right x joystick |
Pin 17 will be used for bucket PWM | Pin 39 connected to the right y joystick |
Pin 4 will be used for the left servos PWM | Pin 35 connected to the left x joystick |
Pin 18 will be used for the right servos PWM | Pin 34 connected to the left y joystick |
Pin 34 will be used for the reading analog battery level | Pin 23 connected to the right joystick button |
Pin 22 connected to the left joystick button | |
Pin 17 to SDA of OLED | |
Pin 16 to SCK of OLED | |
For the Receiver ESP32 it will be easier if you create a row of 3 long header pins that make it easier to connect servos to. |
In addition to this you may find it useful to solder in a capacitor between the 5v and ground connection of both receiver and sender.
I am omitting the instructions to incorporate the motors into the model due to the fact that the videos mentioned above do a great job explaining.
🖥
Code
To use the provided code you must first use the following sketch to find the Mac Address of each device
// Complete Instructions to Get and Change ESP MAC Address: https://RandomNerdTutorials.com/get-change-esp32-esp8266-mac-address-arduino/
#ifdef ESP32
#include <WiFi.h>
#else
#include <ESP8266WiFi.h>
#endif
void setup(){
Serial.begin(115200);
Serial.println();
Serial.print("ESP Board MAC Address: ");
Serial.println(WiFi.macAddress());
}
void loop(){
}
Upload this code and both devices and write down each of the Mac Addresses, into the respective copy and replace these addresses in the sender and receiver files above.
Once you have replaced the following you are able to upload the code to each, once uploaded you are most likely going to need to fix the mapping of the joysticks, i tried using math to add a value to the map to fix the issue known as comp_value
but this is very poorly done.
Thanks!
That is all for this project, i would like to give special thanks to Rui Santos who has the code on his website Random Nerd Tutorials, this site helped a lot!
Thanks,
Mason Lopez [email protected]