Here comes the sun[light]: An ambient Daylight Clock with time and space controls
I built a Daylight Clock!
This analog clock has a 24-hour period, with midnight at the bottom and noon at the top. The lights around the circumference illuminate the current daylight span, based on the clock’s home latitude and longitude.
I also built a time-and-space control box:
What does this controller do?
-
The knob at the bottom controls time, in increments of one week per click.1
The time knob in action:
The sudden
springs forward and falls backdaylight shifts are when Daylight Savings Time begins and ends. -
The toggle on the side switches enables the control box’s time and space overrides; when this switch is off, the time knob controls the brightness of the edge lighting.2
-
The vertical slider is a latitude selector, designed so that the world map—Equal Earth projection!—lines up with the length of the slider.3
The latitude slider in action:
-
The three-way “relative longitude” toggle at the top sets position within the current time zone—i.e., whether the daylight computation is based on the west, central, or east edge of the given timezone.4
The longitude toggle in action:
Based on the relative longitude video, is it possible that this entire project was a way for me to illustrate the time zone grudge I’ve held for years? Not intentionally, but….
The grudge: I grew up in Michigan, on the west edge of the Eastern Time Zone (US); I later moved to the eastern side of that same zone, where the sun rises and sets a full hour earlier. This is distressing in the summer—by rights, the sun ought to set late in the summer!—and borders on criminal in the winter: the sun sets just after 4pm on the solstice. 😱
Envy-driven development (EDD):5 cceckman’s daylight-aware clock
My clock’s provenance is wholly attributable to my friend Charles and his very cool daylight-aware clock. In Charles’s words:
I’ve always lived at middle latitudes of 35-40 degrees. I notice the change in daylight / nighttime hours across the course of a year; in the winter, ending work at a reasonable hour still feels like “working into the night”.
I wanted to have a little passive reminder about how much daylight I am / am not getting. Not one tied to my computer or phone – something more ambient. Naturally, a reminder of the passage of time is… a clock!
Photo credit: Charles Eckman.
When Charles started building his clock I was covetous, and knew I had to build my own.
We made a few different design choices—his time display is digital, mine analog; his daylight illuminates outward from the circumference of the clock, mine inward6—but we both put noon at the top,7 and I used his daylight calculation code wholesale. Also his pair programming assistance to sleuth out a mysterious failure mode!8 9
My clock’s time-space control box was inspired by Charles’s nifty virtual interactive daylight visualization:
[Source]
Physical design and construction: Clock body
The clock movement is an off-the-shelf 24-hour movement. You can just buy these!10
I designed the body of the clock and the body of the controller box in Cuttle.xyz, and cut the pieces on the laser-cutter at my local library’s free maker space(!).11 I designed the clock to have a circumference of exactly 48 neopixels on an Adafruit neopixel strip, so that the lights would subdivide nicely into the hours of the day.
Cuttle design here.
The outer decoration is from the astronomical face of the astronomical clock of the Zytglogge, in Bern, Switzerland. I digitized a photo of the Zytglogge, then cleaned it up and scaled it properly in Cuttle.
Photo credit Sandstein, Public domain, via Wikimedia Commons.
Painting was…an experience.
I used wood glue to make the press-fit connections permanent.
I painted the clock with acrylic paint, and attached the outer decorated ring with Blu Tack so that I can easily remove it and swap it for a different decoration.
Physical design and construction: Controller box
I designed the controller box in Cuttle, too.
Cuttle design here.
I used wood sealant on the front and acrylic paint on the sides.
I failed to make the box deep enough to fit the ensuing tangle of wires crammed inside, so it doesn’t sit completely flush against the wall. Ah well, can’t win ’em all.
Hardware design
The Daylight Clock runs off an Adafruit Feather RP2040 microcontroller. The rest of the components are:
- A strand of 48 neopixels,
- A real-time clock (RTC) component assembly, to maintain the current date and time even when the board isn’t powered, so that I don’t have to hand-set it every time I plug in the clock12
- A two-way toggle to enable/disable switch between “daylight based on current time” vs “daylight based on control box settings”
- A linear potentiometer, i.e., the slider to control latitude
- A rotary encoder, i.e., the knob to control date
- A three-way toggle to switch between the different longitude locations (west, middle, east), and
- Three LEDs to show that current longitude selection.
The microcontroller and all components live in the control box, except for the neopixels around the clock face, which are connected to the microcontroller via some hand-braided wires and a few connectors.The connectors are so that I can easily change the distance between clock and control box, without doing any additional soldering. The neopixels are powered through the board, which plugs in via standard wall wart.
The new-to-me aspects of this project were the RTC and—less glamorously!—the crimped wire connectors.
Software design
I programmed the Adafruit Feather with CircuitPython, relying heavily on the
asyncio library. asyncio allowed me to separate
monitoring the state of the input controllers—“has the slider position changed? the toggle toggled? the knob turned?”—from re-computing each neopixel’s resultant color.
I ported the sunrise and sunset calculations from Charles’s Rust implementation of the NOAA solar calculator.
I’ve made the code available here—and standard houseplant programming caveats apply.
Retrospective
This project took a lot of calendar time, and a disproportionate amount of mental space.
Challenges:
- Deciding what I wanted the clock frame to look like
- Deciding how I wanted to decorate the clock face
- Deciding how I wanted to decorate the outer ring around the clock’s face
- Deciding that I was going to :just-flag: use a cardboard box for the controller…and then doing that, and discovering that I hated it and wanted to cut something out of wood
- Purchasing pre-painted wood to speed up the cut/paint processes
- Discovering that the library policies had changed so I couldn’t use their laser cutter on this wood
- Attempting to use a different maker space and/or hire a local shop to cut this wood for me
- Deciding to :just: use the default library wood and paint it myself afterwards
- A series of painting mishaps with the decorative face that resulted in an unusable mess after accidentally using an oil-based ink over some acrylic
- Recutting the face (…plus the wait time of signing up for a slot…)
- Discovering that I’d glued the clock sides upside down (luckily the sizing still fit backwards, and I didn’t have to go re-cut everything again…)
- Discovering that I’d installed the neopixel strip backwards (counterclockwise instead of clockwise)
Thankfully the result looks really cool, and works as intended, and I love having it on the wall.
I bet you want to make one of your own now, yeah?
Go for it!
To get you started:
Feel free to ask if you are building one and need more guidance at any step; I didn’t want to take the time (heh) to write a full tutorial, but I’m more than happy to assist retroactively.
Also, if you want to make one, but don’t want to deal with quite so many electronics:
- You could skip the control box: The majority of the technical challenges I encountered—both design and implementation—came from the addition of the controls. A Daylight Clock sans control box would still be pretty cool.
- You could use one of the Adafruit Feathers that is WiFi-enabled, and get the time via request, so you could skip setting up the RTC component.
- If using a WiFi-enabled microcontroller, you could create a webpage-based control panel instead of the physical one, which would also be pretty cool!
Thanks to Charles! Also AF, for build [emotional] support.
Footnotes
-
Originally I was going to scan in increments of “day”, but after playing with it, “day” felt too short and required too many turns to see a difference, or to have a true understanding of how much time had passed. After experimenting, “week” had the most pleasing connection between turning the knob and seeing a physical shift in daylight.↩︎
-
Brightness is controlled by the time knob too, when the clock is in “explore time and space” mode:
The extreme contrast in all of these videos is because I turned the clock to full brightness for
dramaenhanced visibility, which resulted in some strange color autobalancing. The color in the photos is more representative.↩︎ -
I’m particularly proud of that bit!↩︎
-
Because the clock hands are not connected to the electronics, there’s no way for the clock hands to jump to a new time when a change in longitude crosses a time zone! Within a single time zone, however, there’s no need for the clock hands to shift. The longitude toggle therefore sets the relative longitude position within the clock’s default time zone—west, central, east. This makes visible the daylight shift across those different locations for the same time of day.↩︎
-
EDD follows a grand tradition of other driven developments…↩︎
-
I actually prefer the outward illumination of his to the inward illumination of mine, but when I started I didn’t know where I was going to hang my clock, or whether there’d be enough space around it on the wall to have a nice effect. The inward illumination makes the result slightly more self-contained.↩︎
-
It seems like the convention is for standard 24-hour analog clocks to place midnight at the top of the circle rather than at the bottom—but it felt more right to me for “day” to be the top half of this clock: with noon at the top of the clock, it feels like the hour hand tracks the sun’s the progress across the sky. Which, it turns out in hindsight, follows the Astronomical Clock convention! And there are a lot of cool astronomical clocks out there…↩︎
-
I thought maybe I’d mucked up something in my translation of his Rust to my CircuitPython, but the issue turned out to be due to the specifics of datetime handling in Python vs CircuitPython; I’d gotten the translation correct, but applied CircuitPython’s datetime incorrectly. An easy fix, once we found it. Programming: so fun. 🙄↩︎
-
The real bug fixes are the friends we make along the way!↩︎
-
One can also theoretically purchase phase-of-the-moon 28-day movements (!), although I haven’t managed it yet, as I’ve only seen factory-scale batches for sale and I’m not really interested in having 500 of them…↩︎
-
If you’ve read any of my other project write-ups, you may notice a pattern here…↩︎
-
The PR2040 doesn’t have Internet or Bluetooth connectivity, so I can’t :just: automatically grab the current time over an external connection. Thus, the RTC.↩︎
- Created: 2026-11-06
- Type: Project write-up
- Tags: friendship-as-a-gateway-drug-to-electronics, long-held-grudge-against-the-1915-detroit-auto-lobby, hardware, data-viz, cad
I attended the Recurse Center and all I got was this lousy blog footer