My Coffee Table is a Robot – The Sand Plotter

Apparently I didn’t write this one up already. Here’s a build from a couple of years ago:


It’s a coffee table with a bed of sand, and underneath is a CNC plaform and a powerful magnet to drag around a stylus and make patterns.

The hardware is pretty straight forward. I bought a coffee table from Ikea and mounted a wooden frame underneath:


Then mounted the CNC gantry under that: IMG_7311.JPG

I spent a while troubleshooting the motion. Nick and I both made tables previously, and the secret seemed to be having a soft base underneath the sand, and also using a cylindrical disc magnet rather than a ball.


Spherical magnet made the pattern on the left, and a disc magnet mad the circles on the right

This is to minimize the amount of ‘uphill’ work the magnet has to do. A cylinder is just dragged through the sand horzontally, whereas a sphere tends to jump and skitter irregularly, which is bad for both the smoothness of the pattern, and how pleasing the sound is to hear.

Coffee Table v01.JPG

It has a glass top, but we removed it some of the photos.

Here’s it in the Powerhouse Museum, briefly brought in for a photoshoot before Maker Faire a couple of years ago. That’s right, something I made belongs in a museum 😀


Edit: As requested, here’s the processing code used to make the patterns. It was very quick and dirty but might serve as a starting point:


This entry was posted in Uncategorized. Bookmark the permalink.

10 Responses to My Coffee Table is a Robot – The Sand Plotter

  1. Dushyant says:

    Can you please share the code and how you send the images to the table.

    Liked by 1 person

  2. Achraf says:

    Dear Gavin,
    Your table looks really cool!
    I am working on a similar project, however on polar/circular plotter. I noticed on the youtube link you posted that you already built a similar design.

    Can you please advice on which firmware you used to drive the motors in the video? I am trying to use a Marlin fork that is supposed to handle polar movements but so far I didn’t manage to get it to work properly.

    Can you explain a little bit your technique on designing the patterns? Do you create your gcode by hand? Do you use a program to transform patterns into gcode?

    What kind of magnet do use? an electric or a permenant magnet?

    Do you have a video for the movement of the cylindrical disc magnet?

    Last question, when you say “soft base under the sand” do you mean something like a bed of cork?

    Sorry for all these questions but your project’s success is very motivating to finish mine 🙂

    Thank you.


    • Hi Achraf,

      Sorry for the late reply. Lovely to hear you’re working on something similar!

      I didn’t design the circular one, a friend of mine, Nick, did. I think the code is here:
      He made a dedicated website around it and a pattern generating language that used a genetic algorithm to create patterns which were sent to human beings for approval.

      For my table I kept it very simple and made a processing script to generate G-code for lissajous figures. You could probably make something better easily, but I’m happy to send it to you if you like.

      I used permanent rare earth magnets both above and below the table. It’s very important that the one on the table be a cylinders, not a sphere. The soft base we found most useful was thin craft felt.

      (We were also playing around with having a small magnet drag hidden under the sand drag a paper shark fin around, which was fun)

      Please send me a link when you’ve finished yours, I’d love to see it.



  3. Pingback: Zen Tense III: Not all Dead, Which Means it’s Slightly Alive |

  4. Karl Tinsley says:

    Hi Gavin,

    I am currently building a similar table. I’m looking for a way to generate the lissajous figure gcode. Could you you share your processor with me? Do you know of other such processors?

    Thanks so much for such a cool project!



    • Hi Karl,
      No worries, I’ve just edited the post and put a ZIP file of the processing code at the end. Good luck with your table, and I’d love to see photos!


      • Karl Tinsley says:

        I’m still in the planning stage and looking for a suitable existing table to build it into. I’ll definitely share my result when it’s done!

        Thanks for posting your code. I’m not sure how to use it – it’s a .pde file, so I guess it runs on an arduino? Does it run on a separate arduino than the one controlling the movement? I’m going to use either a ramps or grbl setup, and was thinking I’d probably need a separate controller – like a pi zero w – to feed the gcode to the machine. Is that how you set yours up?

        Thanks again!



      • Hi Karl,

        No problem. The code runs in ‘Processing’ on the computer, and generates a text file with G-code in it, which can be interpreted by most CNC controllers:

        Yep, although my sand table didn’t use the ramps board, I usually use it for most other projects and it’s pretty respectable.



  5. Karl Tinsley says:

    Hi Gavin,

    Thanks so much for your help so far! I haven’t gotten to play with Processing yet, but I read up on it and will give it a try soon. I’ve been using this tool to generate some simple art to get started:

    I’m quite a bit further along now, and have a couple more questions, if you don’t mind.

    I have the gantry built and mounted on my table, and last night tried my first actual movements with sand. I think I encountered the same thing you did – on bare wood (it’s actually a 3/16″ white masonite-like panel), the magnet on the surface jumps and skips around too much. You mention using thin craft felt. Did you just glue the felt down and then put sand on it? Is that still your recommendation after having it for a while – I was thinking the felt might eventually fill with sand or wear out and become ineffective.

    Did you try other materials, like glass, or hdpe?

    My other question is about the size of magnets you used. My driving magnet is a stack of 8 or 10 13mm neodymium magnets, and the surface magnet is two of the same stacked. They work fine (except for the jumping around I mentioned), but I was wondering what you used, in case I should make mine even bigger.

    Thanks again for your help! Once I have mine done I’ll post it somewhere and provide a link so you can check it out.


    Liked by 1 person

  6. Karl Tinsley says:

    Hi Gavin,

    I’ve made a lot of progress on my table! I posted a video here: if you want to check it out.

    I’m getting a lot of lint in my sand from the felt. It does make for smooth movement of the magnet, but I’ve started looking for another solution. On the advice of some other folks, I’m going to try using a steel ball and replacing the sand with baking soda tonight.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s