View on GitHub


Tracing sand on a polar plotter

Sandtrails Documentation Page

Screenshot Sandtrails video

This project and its documentation is very much work-in-progress.

If you have ideas, questions or want to help, head over to the V1 Engineering Forum.

These instructions should get you started on building your own sand plotter. For more pictures of what this could look like, see gallery.


Major todos

Off-the-shelf parts

The following are the parts we used. Feel free to adapt as you see fit.

Part description Part name Supplier Approx. cost
Raspberry pi Rasbperry Pi 2 B 40 USD
Motor nema 11 11HS20-0674S Stepper Online 2x 15 USD
Proto-board Perma-proto hat Adafruit 8 USD
Stepper motor driver DRV8825 Pololu 2 x 8 USD
Homing sensor Hall sensor RobotDyn 3x 1 USD
Service tray service tray Aliexpress 18 USD
Coffee table Malmsta Ikea 150 USD
L bracket 80x80x18 mm DIY store 4x 3 USD
L bracket 30x30x15 mm DIY store 4x 3 USD
Spur gear 28 tooth POM 2x 2 USD
Disc magnet Ø5 mm S-05-05-N 1 USD
Pot magnet Ø16 mm CSN-16 2 USD
Steel ball Ø13 mm ST-K-13-N 1 USD
Steel ball Ø20 mm ST-K-20-N 1 USD
Capacitors 10 uF Electronics store 2x 0 USD
Screws Raspberry Pi fixation M2.5 Various 4x 0USD
Standoffs M3, 10mm Various 4x 0USD
Screws motor fixation M2.5 x 16mm Various 4x 0 USD
Screws motor fixation M2.5 x 10mm Various 4x 0 USD
Power supply Raspberry Pi 5 VDC, 2.5 A Various 20 USD
Power supply stepper motors 12 VDC, 1.5 A Various 20 USD

Note that several of the very cheap components have minimum orders. So your “shopping list” will be considerably more expensive than the sum of the above. Shipping also adds up.

Custom parts

Custom parts are to be laser-cut. Most from MDF 5mm, a few of other thicknesses. See the PDF for details. CAD model view Photo of parts You can also download the latest drawings form the tab called “Lasercutting” in the Online Sandtrails CAD model.


For now, wiring is done via a GPIO T-cobbler on a full size solderless breadboard.

Wiring overview

This can and will be improved in the future. So the following instructions do not go into detail since this will be changing soon anyway.

Raspberry GPIO pinout

The GPIO pinout diagram Taken from

Follow the pinout definition set in

# Axes Configuration: [Theta Axis, Rho Axis]
DIR = [5, 21]            # GPIO pin: Stepper motor set direction
STEP = [6, 20]           # GPIO pin: Stepper motor trigger step
MODE = [(26, 19, 13), (22, 27, 17)]   # GPIO pin: Stepper motor microstep resolution
HOME = [25, 24, 23]       # GPIO pin number for homing switches [THETA 1, THETA 2, RHO]
ENABLE = [16, 12]         # GPIO pin number for enabling stepper motors [THETA, RHO]

To clarify: The numbers refer to the GPIO pin number in “BCM” mode (“Broadcom SOC channel”).

Stepper motor driver DRV8825

There is an excellent tutorial on how to set the current limit (important!) on the stepper driver and includes the following pinout of the DRV8825:

DRV8825 wiring with Rasberry Pi Taken from

Stepper motor leads

Lead colours of the stepper motors:

Stepper motor leads

Taken from

PDF including specs under assets/datasheets/Stepper-11HS20-0674S.pdf

Homing sensors (Hall sensors)

The hall sensor pinout is:

RobotDyn Hall sensor pinout Taken from

PDF under assets/datasheets/RobotDyn-HallSensor-Pinout.pdf

Hardware assembly

View the 3D model to get an idea of how the parts fit together: Online Sandtrails CAD model This is what we shall call things for the purpose of these instructions: Nomenclature 1 Nomenclature 1

Linear guide assembly

Align the linear guides around the rho stage. Use 4 to 6 2mm dowel pins to help with alignment. Glue guides in place with enough play to prevent overdue resistance but tight enough so the axis does not “wiggle”. Fixing Rho axis

With a similar technique, fix the “lids” on the liner guides. Lids on linear guides

Glue two spacers on each side of the rho stage to lift the magnet holder above the pinion of the Rho motor. Again, I used dowel pins (2mm) to align the parts for gluing. Spacers for magnet holder

Before gluing the magnet holder on top of this, measure how much distance is between the stack above and the bottom of your sand tray. This will depend on how you fix the sand tray relative to the motor mount plate. You might want to do this at the very end, when everything else is ready. Distance of motor mount plate to sand tray

Bend the magnet holder by heating it (eg. over a candle) to create a “spring” to press the magnet to the sand tray. Magnet holder "spring" pressing magnet upward

Push the homing magnets into the corresponding 5mm holes. 2x on the Theta stage and 1x on the Rho stage. Don’t glue them yet, you’ll need to check the polarity first before you do so. 5mm diameter, 5mm length homing magnets

Mounting the motors

Many of the screws need to be countersunk manually. (In the future, one might do this by engraving with the lasercutter, but for now that seemed overkill.) Example for the central “Rho” motor: Countersunk Rho motor screws Possibly use a 5mm drill for the heads of the M2.5 screws. Countersunk Rho motor screws

Unfortunately, the motor shafts are too long and will collide with the mechanics if mounted directly on the motor mounting plate. Instead of shortening the shafts (difficult to do), use the provided “spacers” to increase the distance from the motor to the motor mounting plate: Motor spacer Use a spacer of approx. 5mm thickness for the Rho motor. Use a spacer of approx 11mm for the Theta motor. (Using two 5mm spacers was just not enough in my case, used one 5mm MDF spacer plus one 6mm white POM spacer). Motor spacer

Mounting the electronics

Use standoffs to screw the Rasberry Pi to the hole pattern. Possibly use a 6mm drill to countersink the M3 screws. Raspberry Pi mounted on standoffs

Currently stepper motor drivers and GPIOS are accessed via a breakout board. This will be improved with a perma-proto hat for the raspberry pi soon. Glue this in place next to the Raspberry Pi for now. Look out for the limited flexibility of the 40-lead flat cable. Raspberry Pi breakout board

The “Theta” stage uses two of the hall sensors for homing. Countersink the holes and align the hall sensor with the “aiming” holes to make sure they line up with the magnets later. Mounting Theta homing sensors

The “Rho” stage uses a single hall sensor for homing. Countersink the hole and align it radially out from the motor mouting plate as shown. Mounting Rho homing sensor

Software installation

This section is still in its infancy. Basic steps are: