Early in 1774, a Dutch preacher and amateur astronomer, Eelco Alta, scared his compatriots out of their wits by predicting that the world would end on 8 May. His scientific arguments seemed plausible and terrifying. Astronomers in Dresden had just calculated that there would be a rare conjunction of four planets and our Moon on that day. Alta believed that the celestial bodies would crash, hurling Earth into the Sun.

One pendulum propels the six planets known in the 1770s around the Sun at the centre of the ceiling. Credit: C. HOMMEMA/ROYAL EISE EISINGA PLANETARIUM

Fortunately the Low Countries were also home to a smarter amateur astronomer, Eise Eisinga. The wool-comber, only 30 years old at the time, decided that the locals of his native town Franeker in Friesland needed to see for themselves why such a catastrophe could never happen. To the consternation of his wife, Eisinga built a planetarium into his living-room ceiling. It took seven years. He carved its extraordinarily intricate clockwork elements from oak, and individually forged each of the 10,000 nails for the gearing teeth. The immense workings, with more than 60 wheels, lie in the roof space above the living-room with its inbuilt cupboard bed. They still drive what is now the world's oldest functioning planetarium — and without doubt the most charming.

Just one pendulum propels the six planets that were known at the time along their concentric orbits around a painted Sun at the centre of the ceiling. The planets are wooden balls suspended on metal pins that move imperceptibly, completing one circumlocution per real-time orbit. So Mercury takes 88 days, while the outermost Saturn takes 29 years and 164 days. Uranus was discovered in 1781, just as Eisinga's work was complete — which is just as well because it would have busted the perfect 1:1012 scale of the planetarium that fitted Eisinga's living-room so neatly.

The pendulum is also the pacemaker for other dials on the ceiling and walls that indicate, with near-perfect accuracy, the date, weekday and hour, as well as lunar phenomena such as phase and rising and setting times. It is powered by weights that must be raised by hand at defined times, the heaviest every five days, the lightest every six months.

When Eisinga sketched out his plans, he calculated on the basis of a metre-long pendulum that would swing at 60 strokes per minute. Only when he set about the physical work did he realize that the attic space was not quite high enough. His long-suffering wife put her foot down when he raised the possibility of cutting a hole directly above the bed so the pendulum could swing freely. Seeing no room for negotiation, he re-calculated the entire gearing system on the basis of a faster-swinging 75-centimetre pendulum.

Eisinga was a man of artistic skills too. His painting and gilding are decorative and informative. True orbits are elliptical, not circular, so Eisinga has marked the points where each planet is closest, or farthest away from, the Sun. And since the planets lie close to, but not within, the ecliptic plane, he indicates in white circles of varying thickness around each orbit the orientation of each planet at any time. The ceiling-sky is divided into the signs of the zodiac to indicate the sky segment. All this information allows the planetarium user to pinpoint exactly the position of each planet in the night sky outside.

A visitor making the 125-kilometre drive across the dykes from Amsterdam may wonder: how did something so sophisticated spring up in such a remote, watery landscape?

Now just another pretty medieval town, Franeker in the seventeenth and eighteenth centuries was a thriving university city. The university was founded by Prince Maurits in 1585, during the Netherlands' 80-year war with the Spanish Empire, as a reward for the town's political support. When Franeker remained politically neutral during the violent revolutionary movement in the 1790s, it set the seeds of its own decline. Franeker's decline went into freefall after Napoleon closed the university in 1811.

Happily, the planetarium, whose guestbook was first signed in 1781, has never closed to visitors — even when politics and violence forced them to enter through the back door.