The modular design of the ESP32 robot car offers endless possibilities for extensions. Today we dive into a mechanical upgrade that turns your vehicle into a miniature forklift: the DIY forklift attachment!

This attachment combines 3D-printed precision with the power of a 12V linear motor. Everything is controlled by the versatile ESP32 and an additional but simple H-bridge motor driver just for the linear motor. Get ready to lift loads and, above all, have fun with your ESP32 robot car!

ESP32 robot car - forklift extension

ESP32 robot car – forklift extension

The mechanics: precision through 3D printing and a linear drive

The core of this extension is the lifting mechanism. I rely on a DIY solution with a gear motor and an integrated threaded rod. It is the perfect balance of power, precision and DIY spirit.

The heart of it: the 12V linear drive

For this I use an N20 DC gear motor with flange, which was developed specifically for this purpose.

Component Specification Function
Motor 12V, 200 RPM
Provides the driving force.
Threaded rod T5 x 160 mm
Converts the rotation of the motor into a 16 cm lifting movement.
Power transmission Lead screw thread (T5)
Enables a powerful and self-locking movement (the fork stays up even when the motor is switched off).

The entire fork structure, the carriage guide and the mounting brackets for the motor can easily be printed yourself. This ensures a perfect fit on your existing ESP32 chassis.

Here is the list of components I used.

You can get the linear motor I bought here on Amazon.

You also need the matching small motor driver to raise and lower the load.

Suitable limit switches are also important. I bought these ones.

Video of the forklift attachment

Here is one of the first videos showing the forklift attachment in action. Still without connected limit switches.

ESP32 robot car forklift attachment video

ESP32 robot car forklift attachment video

3D print files

The project is not quite finished yet and is still being optimized. Once everything works, I will also publish the 3D print files here.

Here you can find the pallet I used: https://www.printables.com/model/1263731-euro-pallet-n-scale/files

The electronics: control with ESP32 and an H-bridge

To raise or lower the fork, the 12V gear motor must be able to change its direction of rotation. This is where the motor driver comes in.

The motor driver: L9110S DC stepper motor driver board

The L9110S H-bridge motor driver is ideal for this project. It is compact, inexpensive and can supply the required current for the small 12V gear motor.

The H-bridge circuit allows us to reverse the polarity of the voltage at the motor.

  • Motor up (forward): control signal A HIGH, control signal B LOW.
  • Motor down (reverse): control signal A LOW, control signal B HIGH.
  • Motor stop: both signals LOW (or HIGH).

The wiring: from the ESP32 to the 12V motor

The challenge lies in the connection: the ESP32 works with 3.3V logic, while the motor needs 12V. The L9110S acts as the perfect interface:

  1. Power supply: The motor driver needs two separate power sources:
    • Logic Power (VCC): Connected to 3.3V or 5V from the ESP32 (depending on the board version).
    • Motor Power (VM): Connected to the 12V power source (e.g. a separate battery or a step-up converter), which supplies the motor directly. Caution: The GND connections (ground) of the ESP32 and the 12V source must be connected to each other!
  2. Control (logic): The two control inputs of the L9110S (INA/INB) are connected to any two GPIO pins of the ESP32.
  3. Output (motor): The motor outputs (OUTA/OUTB) are connected directly to the two terminals of the 12V gear motor.

The programming: simple control with the Arduino IDE

Controlling the lift is basically a simple digital control. I designed it here as an example.

In the code we define the two control pins. Then a simple function lets the motor run in the desired direction.

Note: The limit switches are not yet handled in the program, and the motor is not stopped automatically.

// Define the GPIO pins for the H-bridge
const int IN1_PIN = 25; // GPIO pin for motor A (up)
const int IN2_PIN = 26; // GPIO pin for motor B (down)

void setup() {
pinMode(IN1_PIN, OUTPUT);
pinMode(IN2_PIN, OUTPUT);
// Optional: start the motor in a known position
stoppMotor();
}

void hochfahren() {
digitalWrite(IN1_PIN, HIGH);
digitalWrite(IN2_PIN, LOW);
}

void runterfahren() {
digitalWrite(IN1_PIN, LOW);
digitalWrite(IN2_PIN, HIGH);
}

void stoppMotor() {
digitalWrite(IN1_PIN, LOW);
digitalWrite(IN2_PIN, LOW);
// Or HIGH/HIGH for electrical braking, depending on the driver
}

void loop() {
// Example: move up for 2 seconds, wait 1 second, move down for 2 seconds
hochfahren();
delay(2000);
stoppMotor();
delay(1000);

runterfahren();
delay(2000);
stoppMotor();
delay(1000);
}

Optimization: do not forget the limit switches!

To make sure the fork does not move beyond the maximum stroke (160 mm) and damage the motor or the mechanics, you should install limit switches (micro switches) at the upper and lower end points of the carriage. These are also connected to the ESP32 and cut the power to the motor as soon as the fork reaches the stop.

More on this in a second part about the DIY forklift extension for the ESP32 robot car.

ESP32 robot car forklift extension electronics

ESP32 robot car forklift extension electronics

Conclusion

With this extension, your ESP32 robot car becomes a versatile toy! The project is an excellent demonstration of how simple, readily available components and an ESP32 can realize complex mechanical functions such as a forklift with a 16 cm lift. I am already looking forward to programming it with GEMINI and controlling everything with the Sony PS5 controller. But I still need to optimize the mechanics a bit and, above all, adjust the tilt angle of the fork.