08 May 2012

Make your own high-precision sundial

What not to do

Want your own sundial?  Go to your local garden centre, bye one and put it in your garden. If you are of the fussy kind, you will have its "stick" (technically, its stylus) face north.

 The following days you will notice that there is no relation whatsoever between your sundial and your watch. The explanation is simple: there is no universal sundial. It has to be specifically designed for the place where you live. Frustrated, you will order a new one from a firm which tailors them individually, adapted to your place. If it has been set up, look into the dark starry sky along the stylus. It should point exactly at the Pole Star. If it does, fine. The following days you will notice there is still no relation between your garden time and your watch. When your sundial says it's twelve, your watch may say it's ten to one, and the next week it may say half past twelve. What your expensive sundial gives you is local time. If it says noon, it is definitely right, because this is evidently the time when the sun is highest in the sky. Unfortunately, local time has been abandoned ever since people have abandoned living in disconnected villages. People in the village next to yours will have their own sundials telling their local time. If you want a sundial agreeing with your watch, read on. I'll tell you how to make one: hardware, software and procedure.


A lacquered zinc die-cast tripod base (PHYWE Product No: 02002-55). Won't be easily blown away (it's 1.8 kg) and can be perfectly leveled thanks to three adjusting screws.

A flat, lacquered iron plate, 4 mm thick and measuring 317 by 230 mm (this is A4 plus a 10 mm margin, but the exact measures are irrelevant) with a central rod, 10 mm in diameter and 40 mm high (again, no precision needed). This is the only component I had to have specifically made.

A set of reasonably strong pill magnets and a very strong nickel-plated Neodymium rod magnet, 6 mm in diameter and 10 mm high (Supermagnete Product No: S-06-10-N). A chipboard screw, height 20 mm, diameter of the head 6 mm. Three circular bullseye plastic spirit levels (Leveldevelopments Product No: AVF26, also available as camera equipment 'Kaiser 6386 self adhesive spirit level'). Four sheets of A4 paper.

I also consulted these:

Philipp Janert, Gnuplot In Action, Manning Publications 2009, ISBN: 1933988398 ISBN-13: 978-1933988399. (On the title page of the book, Manning specifies "Greenwich (74° w. long.)", a charming detail.)

Jean Meeus, Astronomical Algorithms, 2nd ed, Willmann-Bell, Inc., 1998, ISBN 0-943396-61-1. Invaluable and very entertaining if you enjoy to compute, say, the positions of the satellites of Saturn a few centuries ahead.

I could have (reluctantly) done without the first, but not without the second. For my previous sundials (this must be the fifth) I used approximating formulas that had to be found and adapted each year. Meeus has them all.


Gnuplot, an open source graphing utility, which also allows double precision computing and C style programming.

A graphics editor (my choice is Inkscape, an open source SVG graphics editor). 

A text editor (my choice is Fraise, a free text editor for Mac).


1. Use your text editor to write a text file, say "mysundial.txt", containing gnuplot instructions. To save time, you could start from mine. (Feel free to donate.) Gnuplot stops reading a line when it meets #, so that's where comments are. The first section contains data you may want to change. Unless you want to design a gift for my garden, I strongly recommend you to change

lengte en breedte into the longitude and latitude of your garden.

JAAR is the year you want to use your sundial. In principle, the formulas involved do change over time, but a sundial, even "high precision", is hardly affected.  

monotoon is set to 1 if you are in the northern hemisphere and want a sundial for the half year consisting of spring and the preceding winter, and to -1 for the half year consisting of summer and autumn. It's a lot easier to design a single sundial for the whole year, but these are very difficult to read, even if two colours are used. They display a bunch of overlapping very elongated figures 8, while their "halves" are non-overlapping very elongated letters S. (The name monotoon refers to the sense in which the sun's declination is monotonically varying. It's independent of the season in your particular hemisphere.) 

set output defines the name you want for your eps file, say "mysundial.eps"

Z is the total height of the screw plus the height of the cilinder on which it sits; diam is the cilinder's diameter. You can shift the whole vertically by varying Y.

2. Start gnuplot. On a Mac you open the terminal and type


in the command line. At the gnuplot prompt, type


which will show gnuplot's working directory. Move your "mysundial.txt" file to that directory. Now type (quotation marks included)

load "mysundial.txt"

3. Start your graphics editor, open a new A4 landscape page, and import "mysundial.eps" which you'll find in the working directory. Something like this, border included, should pop up (winter version):

The whole drawing is a single object consisting of grouped components. (No need ungrouping.) Adjust its width to 277 mm and its height to 190 mm. (This is A4 minus a 10 mm margin.) Print. Take a graduated ruler and measure the rectangle. Probably, it won't be exactly 277 mm by 190 mm. Use your graphics editor to scale the figure in such a way that the print has the exact dimensions. (In my configuration, this requires scaling the height by 100.529%.) Use the "text" tool of your graphics editor to add hour marks to the lines. The fattest line in the figure, running more or less vertically, corresponds to 12h Universal Time. Take your time zone into account (which is a social convention and has nothing astronomical to it). The hours are in solid line. They are separated by dashed lines a quarter of an hour apart. Add whatever other fancy stuff you want. This is my own summer version.

In case you're curious, my Dutch text says:

Shadow of a point 30 mm above the mark, at 51°02' North and 3°48' West, in spring (below the straight line) of the year 2012, and previous winter (above the line). Atmospherical aberration has been taken into account. W/Z = Universal Time + 1 resp. 2 hours. Control frame of 277 by 190 mm. Lines begin and end when the sun's center is apparently 15° (1 hour) above the horizon. The table must be set level, and so directed that this text runs from East to West. The East-West axis can be determined by connecting two shadows of equal length on the same day, or by Mutio Oddi's construction (De gli horologi solari, 1614) out of three shadows of unequal lengths.

Print your adorned sundial. By now, you have used two of your four sheets of paper. Use the remaining two to print your sundial for the next half year. For astronomical sectarians who refuse to look at the date or the trees to tell which season they're in, you could add: to determine which half year you are in, compare the shortest shadows of the same object on two different days. If the shadows get shorter, you are in winter or spring; if they get longer, you are in summer or autumn. (BTW, on March 21 and September 23, the shadow on your sundial will move along the straight line. Just in case you were among those who think that autumn starts on September 21: no, it doesn't and yes, the solar system, like the whole universe, is a lousy design.)

4. Go to any copy center and have your two finished sheets laminated, which makes them both stiff and weatherproof. Use the pill magnets to fix the right one to the plate. Put the strong magnet on the mark (it will fit exactly) and the screw on top of it (the magnet holds it tightly). Put the tripod in a convenient (i.e., sunny) place. Use the three bullseye levels and the three screws on the tripod to perfectly level it. (I wasted several supermarket levels before admitting they are too imprecise to be of any use here. Any two of them contradicted each other.)

Face south, lower the plate with the rod in the opening of the tripod. Below the plate there is not enough space to have your hand turn the central screw. Therefore, hold the plate at a comfortable height and turn the screw far enough to hold the plate but less than immobile. Before fixing it tightly, turn the plate so, that the time on the sundial agrees with your watch. Check a last time that the plate is level. (Previous sundials have revealed that this is critical, especially in late afternoon when shadows are long.)

As for the watch, do I hear the word "cheating"? Note that it serves merely as an instrument for orientation. If your conscience still objects, use any of the two geometrical constructions I mention on my sundial. They are far less accurate, because the sun is not a point but a disk, casting blurry shadows. Here they come.

First, to determine a North-South axis by connecting two equally long shadows. Multiple sets of such corresponding shadows will improve accuracy, as below. (Both illustrations taken from M. Minnaert, De natuurkunde van 't vrije veld, Deel 3.)

 Throwing in some household tools one can even highly improve accuracy.

And this is the second method:

explained here (in Italian, from 1614). It's a mathematical beauty, but not very practical. Anyway, whatever your orientation method, fix the rod and plate by turning tight the central screw on the tripod, and you're done.

The lines come every quarter of an hour, and it's very easy to interpolate up to five minutes. (Looking through your eyelashes may improve the observation.)  If you do so, you won't be off by more than two and a half minutes. This is about as precise as a sundial can intrinsically be.

Disclaimer. If it's not performing as it should, blame global warming for the sun's misbehaviour. Or else, check the program for any other anthropogenic error, and let me know.