• The story so far

    Rich Holmes03/18/2026 at 13:40 0 comments

    I'm building a bedside clock.

    Nothing in the way of especially novel features. I just wanted a clock that does what I want it to do the way I want it to do it.

    A couple years ago I bought a clock. It was cheap — I tend to buy cheap — but I liked its features. Most notably, it has built in ambient sounds to sleep by. Long story, but I like to have the sound of a fan going to mask more disruptive sounds.

    It works, but it's kind of bad. The quality of the ambient sounds is low. For whatever reason, one can hear periodic variations in the sound every few seconds. I don't think it's simply looping, because to me those variations sound different at different times, but if it's not looping I don't know what it is. Anyway, it can be distracting, which is kind of counter to the point of ambient sounds. And you're stuck with the sounds it has built in. 

    The user interface is terrible: There are eight small tact buttons on top, each with a tiny incomprehensible icon, and they do different things on short and long presses as is badly explained in the instruction booklet. 

    And now, a couple years later, the fluorescent 7-segment display is going bad. It's dimming and different segments are different brightnesses, so it's hard to read.

    I think I can do better.

    Currently what I have on the breadboard consists of:

    • An ESP32 HUZZAH Feather from AdaFruit
    • A 7-segment LED Feather wing from AdaFruit
    • A Music Maker Feather wing from AdaFruit
    • A 1.3" OLED display from Amazon Marketplace
    • A rotary encoder from my stash
    • Two speakers from AdaFruit

    In addition to the encoder the final version will include a rotary switch and five tact buttons. For now they're emulated in software — I can "press" the buttons or "turn" the rotary switch by typing letters into the serial console.

    Putting that hardware together was the work of maybe half an hour. Programming it to do what I wanted took a lot longer than that. The code is, shall we say, idiosyncratic and very much designed for me, not for John Q. Public, but it works.

    It displays the time. There is currently no provision for manually setting the time. I'll add that if I think it's needed but so far it isn't. The ESP32 connects over WiFi to a network time server and sets the time from that. Does it handle Daylight Saving Time? As of a week ago last Sunday I can say for sure: Yes. It does.

    The Music Maker board has a Micro SD slot. On the micro SD card are sound files in three directories: Alarms, ambients, and music.

    I'm retired so I don't wake to an alarm often, and when I do my phone works adequately, but I figured this should have alarm capability. Especially since I hate all the alarm sounds on my phone. For one thing they're not alarming enough. It's probably possible to add my own alarm sounds on my phone, isn't it? It's definitely possible on this clock, and it's loaded with some very wake-up-now kinds of sounds.

    I don't think of this as a capable music player; my phone does a decent enough job of that. I'm not interested in trying to have it connect to a streaming service or download songs wirelessly from my computer; that would be a lot harder than it's worth. But it will play through a small number of songs stored on the micro SD card.

    The ambient sounds likewise are limited to what's on the card, but who needs more than that?

    There is a menu system based around the encoder and OLED that lets you set alarms, choose song play mode (single song or all songs, once or looping), manually initiate an NTS time update (it's never been needed but it's there) and switch between 12- and 24-hour display on the LED. When the OLED doesn't need to show a menu it displays the time including seconds, date, and day of the week.

    The buttons let you switch between sounds and songs and control the LED and OLED brightness — their function depends on the rotary switch setting.

    The 7-segment display is always on unless you switch it off. The OLED blanks itself after a certain amount...

    Read more »