Make Your Own Sea Shell Sand Clock
Make Your Own Sea Shell Sand Clock
This comprehensive project guide blends servos, a stylus, sand, and C (as well as some 3-D printed bits) to make your own beach-themed clock.
Join the DZone community and get the full member experience.Join For Free
The year is coming to an end, and the holiday season is approaching. In case you are looking for a nice present, I have completed my version of a sand clock: a clock writing the time into sand:
If you are interested in building your own version, I have documented the different steps with tips and tricks.
The idea is based on the famous ‘Plotclock’ by the Fab Lab Nürnberg. That Plotclock is using a whiteboard marker to write the time and erases it with a wiper ever minute: very cool idea!
There is a lot of flexibility. I have used the following materials:
- Microcontroller board, I have used the tinyK20 using the NXP Kinetis K20DX128 microcontroller (ARM Cortex-M4 running at 50 MHz).
- 3 micro servos e.g. from Dx.com.
- RTC (Realtime Clock) to keep the time with battery backup. I used the DS1307 from DX.com which I have used in another clock project.
- For battery power: battery and DC-DC converter. I’m using the Adafruit power boost 500 charger.
- Vibration motors to erase the writing, e.g. the one from SeedStudio (DX.com).
- Adafruit 16-Channel PWM/Servo Driver.
- 3D Printer or laser cutter: something to construct the chassis.
- Decoration: sand, sea shells or whatever you like, plus a box or something similar to put everything into place.
- Cables, nuts, and bolts.
From Plotclock to Sandclock
The original concept is using a wiper to erase the writing, but after a while, things don't get quite as clean. So, instead of using a wiper, I wanted to use a stylus to write the time into sand. The computer magazine C’t published an idea like that as PlotClock 2.0 using a laser cutter. Based on that design, I have created my first prototype based on laser-cut wood (many thanks to Claudio for helping me with that!):
The bottom servo is responsible for lifting the pen and the drawing servos:
3D Printed Parts
I have printed the needed extra parts with an Ultimaker on PLA. Below are all the parts used:
For some parts, several iterations were needed:
As the microcontroller, I used the tinyK20 board (NXP Kinetis K20), an ARM Cortex-M4 running at 50 MHz:
Adafruit 16-Channel 12-bit PWM/Servo Driver
In the first phase, I experimented with various components and used breadboards to connect the parts.
Because the original laser-cut arms did not work well, I designed them for 3D-printing: That way, I can change the size and cut the weight:
I used small vibration motors from Seedstudio: They are small and can be attached with small screws to the sandbox. I have used motors.
Initially, I used normal GPIO pins to drive the motors:
Because this was not flexible enough for leveling the sand, I switched to using the PCA9685 for the motors, too.
With a rectangular sandbox, my sand was building hills and valleys. So I printed a round sandbox:
The sandbox is held in place by four springs for better vibration and decoupling from the rest of the chassis:
That worked pretty well, as shown in the following video:
Larger Sand Box
Well, that first sandbox was too small: The digits are very close together. So the next iteration was printing a larger box:
That one worked better:
To have things look nice, everything gets placed into a wooden box with a glass cover. Space is tight, so the servos, RTC, and the NXP PCA9685 module all get placed inside the base chassis:
That one gets screwed on a base plate which then gets inserted into the wooden box. the 4 white LEDs get connected to the PCA9685 module as well so I can control and dim them over I²C:
Then it gets placed into the box below a top cover built out of wood:
To cover the 3D printed plastic parts, I experimented with glue and sand:
It's simple enough.Put some glue on the parts, then cover them with sand. From here, sand started to spill around everywhere. To lessen the mess, I tried to keep the sand in a plastic box:
With the sand, I’m able to cover most of the plastic parts:
The motors and electronics can be powered with the tinyK20 USB port. I have added a LiPo battery (1000 mAh to last for several days) combined with a battery charger. Here, again, I used an Adafruit 500 mA Power Boost, which can charge and give power the same time.
I added headers to the module. And with that module, I added an ON/OFF switch to completely turn off the clock.
The clock digits are more visible if there is good lighting with shadow. For this, I added four white LEDs, two on each side:
The microcontroller board gets a 3D printed enclosure.
Both the microcontroller board and the battery charging unit get placed on the underside:
I have found various sea shells in local stores. The LEDs get placed into sea shells and illuminate the sandy area. Shells are used to cover the power switch and the two hooks on each side, which are needed to get the clock out of the wood box:
To cover the other areas, more shells are added and glued to the ground. A small cover is covering the part where the servo arms are coming out:
The top of the wooden box has a glass window:
Here's a video of the clock in the box, but the vibration motor sequence still needs some tuning:
Getting toward the end, the writing implement is using a pointy shell:
One of the most challenging problems was to get the sand vibrations right: depending on motor placement, the frequency, and duration of vibration, the sand was building mountains and valleys, up to the point where I had to add more sand. Oh, and I think I will have sand all over the place for the next few months.
The sand has to be like a powder: small and round grains. I tried several kinds, including ‘cleaning sand’ for small animals. The best one I've found is a package of decoration sand found in a nearby store:
I tried to find good patterns with a small amount of sand, then filled up the sandbox and adjusted the settings. The following pictures and videos show some of the patterns I have observed:
With some motor/frequency combination, the sand was moving to one or the other end:
A video of the sand moving around:
Research indicated that this is a complex problem to solve and influenced by many factors. With the help of my colleagues, I have built a ‘sweeping’ table stimulating the sand with a sequence of frequency/duration patterns. With this, the sand was leveling properly without spilling out of the designated area.
The project and sources are available on GitHub. I have used the original ‘Plotclock’ code from the FabLab Nürnberg and ported it to ARM Cortex/NXP Kinetis, using the free Eclipse based Kinetis Design Studio and GNU build tools:
The original code is in ‘Plotclock.c’ and has been greatly extended and is using FreeRTOS for scalability:
It includes a USB CDC stack and command line interface: I have a lot of commands and configuration options:
That way, I can drive all the servos, lights, and functions of the clock with a command line interface, as well as check the status.
I’m happy with the result, and the clock is working well:
It took me a while to get it done, but now I have a nice gift. The most challenging part was getting the sand vibrating in a way that it levels out properly. This clock has a “beach” theme, but there are plenty of other ideas. For a “Halloween” theme, you could try small pumpkins, and a bleeding finger writing the time into black seeds, or a dedicated Christmas theme with glittering balls and a Christmas tree writing the time into a bed of wax, erased with a Peltier element. Or something. Post a comment if you have more ideas.
PS: I deeply apologize for all the sand flying around the office and at home. I would use wanting to have a beach feeling in the Swiss Mountains as an excuse
Published at DZone with permission of Erich Styger , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.