Building a DIY Sand Table / Kinetic Art Table with a Raspberry Pi or ESP32 Controller
- NEMA 17 stepper motors, 2x
- Stepper motor drivers, e.g. TMC2209 or A4988, 2x
- Raspberry Pi 4 or Raspberry Pi Zero 2 W
- ESP32 development board (alternative controller to Pi)
- GT2 timing belt and pulleys kit
- Strong neodymium ring or disc magnet
- Polished steel ball bearing, 15-25mm
- Fine white play sand
- Linear rail or drawer slide for the rho (extension) axis
- Limit/homing microswitches, 2x
- 24V power supply for stepper drivers
- Round wooden tray or shallow bowl base, 300-500mm diameter
- Slip ring, 6-wire (optional, for continuous arm rotation)
A kinetic sand table — the kind that slowly drags a steel ball through sand to trace evolving geometric patterns, often called a "Sisyphus table" after the best-known commercial version — is one of the most satisfying motion projects a maker shop can build, combining laser-cut or 3D-printed mechanical parts, stepper motion control, and a surprisingly approachable control system. This project walks through a polar (rotate-and-extend) build using a magnet under the table pulled by two stepper motors, controlled by either a Raspberry Pi or an ESP32, running theta-rho pattern files.
How It Works
A steel ball sits on top of a shallow bed of fine sand. Underneath, a magnet is dragged around on a two-axis mechanism — typically one stepper rotating the entire arm assembly (theta) and a second stepper extending a carriage along that arm (rho), so the magnet's position is described in polar coordinates rather than X/Y. The magnet pulls the ball through the sand from below, drawing a continuous line as it moves, with the sand behind the ball settling back into a smooth furrow. Patterns are stored as theta-rho coordinate lists (".thr" files, an established open format already supported by several open-source player projects) and played back point by point.
Building the Mechanism
Mount the theta stepper at the center of the table base, driving a rotating arm directly or through a small belt reduction for smoother, higher-resolution rotation. Mount the rho stepper on the rotating arm itself, driving the magnet carriage in and out along a short linear rail — this means the rho motor's wiring has to either tolerate being spun continuously (hence the optional slip ring) or be limited to patterns that don't require full continuous theta rotation without occasionally unwinding. Many hobbyist builds skip the slip ring and simply let software track cumulative rotation, periodically "unwinding" between patterns; decide which approach you want before finalizing your wiring run lengths.
3D print or laser-cut the arm as a single rigid piece if possible — any flex in the arm shows up directly as pattern distortion, since the ball's path is only as accurate as the arm's repeatable position.
Controller Setup
A Raspberry Pi running an open-source theta-rho player (several exist in the maker community with web UIs for uploading and queuing .thr pattern files) gives you a browser-based interface to pick patterns, control speed, and queue a sequence — genuinely pleasant for a piece meant to sit on display and run unattended. An ESP32 alternative trades the web UI convenience for a simpler, lower-power standalone controller better suited to a battery-powered or minimalist build, driving the same stepper drivers directly from GPIO with pattern files stored on SPIFFS/LittleFS, following the same GPIO and motor-driving fundamentals covered in this site's general ESP32 motor control guides.
Homing and Calibration
Install microswitches at the theta zero position and rho's innermost position so the controller can home reliably on every startup — without this, any power loss mid-pattern leaves the mechanism's software position out of sync with where the magnet actually is, which shows up as the next pattern starting from the wrong point entirely. Run a plain circle and a straight radial line as your first test patterns before attempting anything complex; these immediately reveal centering errors, arm flex, or belt backlash that would otherwise be hard to diagnose from a complex pattern alone.
Safety Note
Neodymium magnets of the size used here are strong enough to pinch skin painfully or snap together and shatter if allowed to jump together unexpectedly during assembly — keep them away from laptops, external hard drives, and pacemakers during the build, and mount the table magnet securely before final assembly so it can't suddenly leap toward a tool or another magnet nearby.