Build an ESP32-Controlled Automatic Dice Tower with Servo Tumbling and LED Effects
A dice tower solves a real problem at the gaming table — dice rolled by hand on a cluttered table get nudged, caught against rulebooks, or rerolled by habit when someone doesn't trust the result. A tower with a mechanized tumbling stage removes the human variable entirely: dice drop in, get genuinely randomized by a motor-driven paddle wheel or shaking tray, and land in a visible result tray with an LED flourish to mark the roll. This project builds a 3D-printed or laser-cut tower frame with an ESP32 running a servo-driven tumbler and an addressable LED strip, controlled by a single push-button so it's as simple to use as a normal dice tower but adds a mechanical randomization stage and a bit of table presence.
How It Works
Dice drop through a top funnel into a tumbling chamber where a continuous-rotation servo drives a small paddle wheel or vibrating platform for a set duration (1–2 seconds is enough to thoroughly randomize a handful of dice without annoying players who roll often). After the tumble cycle, the dice fall through to a flat landing tray at the base. An addressable LED strip (WS2812B) around the tower's interior runs a brief animation during the tumble — a spinning color chase works well — and then settles to a steady color once the cycle finishes, giving a clear, satisfying signal that the roll is ready to read.
Parts List
- ESP32 DevKit board (any common variant with enough GPIO for one servo, one LED data line, and one button)
- Continuous-rotation hobby servo (a standard 180° servo works too, driven with brief direction reversals instead)
- WS2812B addressable LED strip, 1 meter, 30 or 60 LED/m density
- Momentary push-button, panel mount
- 5V 2A USB power supply (LED strips at full brightness draw more current than the ESP32 alone can safely source)
- Logic-level N-channel MOSFET or a simple level-shifter if your ESP32's 3.3V data line needs boosting for reliable LED signal integrity over the strip length
- Laser-cut plywood or acrylic for the tower panels and internal paddle wheel, or 3D-printed equivalents for the same parts
- M3 screws and heat-set inserts or T-nuts for panel assembly
- Small perfboard or protoboard for wiring connections, plus dupont jumper wires
Wiring
ComponentESP32 PinNotes Servo signalGPIO 18 (PWM-capable)Servo power comes from the 5V rail, not the ESP32's 3.3V output — share ground only LED strip dataGPIO 5Route through a level shifter or a 300–500Ω series resistor on the data line for signal reliability Push-buttonGPIO 4 (input, pull-up)Debounce in software — a 20–30ms software debounce is sufficient for a mechanical button 5V power inVIN / 5V pinFeed both the ESP32 and the LED strip from the same 5V supply, sized for LED strip peak current plus headroomFirmware Logic
The control loop is simple and doesn't need a real-time OS or complex state machine: wait for a button press, run the LED chase animation and drive the servo at full speed for the tumble duration, stop the servo, hold a solid "ready" LED color, and return to waiting. Using the Arduino core for ESP32 with the FastLED or Adafruit_NeoPixel library for the strip and the standard ESP32Servo library for the tumbler motor covers the entire project without needing custom drivers. A short randomized delay (a few hundred milliseconds, seeded from the ESP32's hardware random number generator) before starting the tumble gives a slightly less mechanical, more natural feel to the cycle timing if you want that touch, though it has no effect on dice randomness itself — that comes entirely from the physical tumbling.
Mechanical Design Notes
The paddle wheel diameter and the chamber's internal height need to match: too much clearance and dice can avoid the paddles entirely by settling in a corner; too little and the wheel jams against large dice like a d20. Sizing the chamber for the largest die you'll regularly use (typically a d20 at roughly 20mm per edge) with the paddle wheel diameter at about 60–70% of the chamber's internal width gives reliable tumbling without jamming. If you're 3D printing the paddle wheel, print it in PETG rather than PLA — it's taking repeated mechanical impact from dice and PLA's brittleness shows up as cracked paddles within a few hundred cycles.
Assembly and Finishing
Laser-cut tower panels in 3mm or 6mm plywood assemble with simple tab-and-slot joinery and wood glue at the permanent joints, leaving the top funnel panel removable for clearing a jammed die or doing maintenance on the servo. If printing the frame instead, design the panels with the same tab-and-slot approach so the mechanical fasteners are shared between the two fabrication methods — it makes the project buildable either way depending on which machine you have available.
This is a project that scales easily to the skill level you want to bring to it — the core button-tumble-light cycle is a weekend build, and from there it's straightforward to add a small speaker for sound effects, a display showing roll history, or a second tumbling chamber for larger dice pools without touching the fundamental mechanism.
Related Guides
- How to Program Addressable LED Strips: WS2812B Patterns, Effects, and Power Design
- Designing Enclosures for Electronics Projects: Materials, IP Ratings, Ventilation, and Cable Entry
- Build a Word Clock: Laser-Cut Face, WS2812B LEDs, and ESP32
- Build a Flipper Zero Desk Dock and Charging Stand with Status LED
- How to Control Motors with Arduino and ESP32: Stepper, DC, and Servo Drivers
- How to Use OpenSCAD for Parametric Maker Projects: Code-Based 3D Design
- How to Use FreeCAD for Makers: Parametric CAD for 3D Printing, Laser Cutting, and CNC
- Driving Many Servos with a PCA9685 PWM Driver: I2C Wiring for Raspberry Pi and ESP32 Robotics