'CNC' Stepper Motor powered LEGO Technic Tank

Using an ESP32 and 'CNC' Stepper motors to power a LEGO Technic track vehicle.

Similar projects worth following
For this project I used 2x NEMA 8 steppers motor to drive a tank built from LEGO Technic bricks.
The microcontroller is an Adafruit Feather ESP32.

The Vehicle

The micro controller is an Adafruit Feather ESP32.  This board has the advantage of being very small.

The Stepper Motor Drivers

I designed an built a custom stepper motor "shield/wing" to drive the stepper motors.  See the files section for the gerber files if you want to have your own printed.  The board holds up to 4 Pololu DRV8835 motor drivers.

These can control 1 stepper motor each (not current limited) or 2 DC motors each.  For a total of 4 stepper motors or 8 DC brushed motors.

The Stepper Motors

The stepper motors are Pololu "1204" Nema 8 stepper motors, but any Nema 8 sized stepper motor with an appropriate length shaft and voltage rating should do.

The motors have 3D printed face plates that let them interface with the LEGO pin holes.

The Software

The ESP32 has been programmed with a web server that serves a page that lets you control the vehicle.  The page contains javascript controls that send input to the controller through a websocket.

Control is with a touch base onscreen joystick.  I use the X/Y to skid-steer algorithm from here:

The ESP32 then uses hardware interrupt timers to precisely control its motors.

ESP32 2018-04-24

Gerber files to make the stepper driver 'shield/wing' PCB

x-zip-compressed - 72.83 kB - 05/20/2018 at 08:44


Motor Plate Nema8 - 15_4mm.stl

Motor face plate for 15.4mm Nema 8 motors

Standard Tesselated Geometry - 197.35 kB - 05/20/2018 at 08:41


Motor Plate Nema8 - 16mm.stl

Motor face plate for 16mm Nema 8 motors

Standard Tesselated Geometry - 205.25 kB - 05/20/2018 at 08:41


Motor Pin.stl

Motor pin for the rear side of the motor

Standard Tesselated Geometry - 59.87 kB - 05/20/2018 at 08:41


View all 2 project logs

Enjoy this project?



fabrice.petesch wrote 11/13/2018 at 09:31 point

Hi, very cool build ! : Did you have already all the lego pieces, or did you buy them somewhere ? (I am checking if I may redo the build for a christmas gift for my kids) i have already a lot of them, but some will be missing that are not sold on the lego website (and I don't know if 3D print will be precise enough)

  Are you sure? yes | no

Vishnu Mohanan wrote 05/24/2018 at 17:18 point

Nice build ;)

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates