The ESPHome seven segment clock with WS2812B LEDs

Disclosure: This post contains affiliate links. If you click through and make a purchase, I will earn a commission, at no additional cost to you. Read my full disclosure here.

An illustration of a woman looking at a digital clock.

What makes the WS2812B LEDs  so attractive for makers, is how cheap and easy to work with they are. They allow us to include RGB lighting with effects in just about any project. In today's featured ESPHome project, Thingiverse user Alex18881 modified an existing a seven segment clock using an ESP-01s, some WS2812B LEDs.


This seven segment clock is a nice alternative to the analogue clocks we've become accustomed to. Because it uses RGB LEDs, it can lend a splash of colour to any room and surely won't become boring anytime soon.

Not just any boring old clock

Why user Alex18881 decided to place this project on Thingiverse I do not know, as it uses the models designed by random1101 and doesn't provide any of its own. What Alex18881 does provide, and this I am very grateful for, is the valuable code which powers this project.

Perhaps GitHub would have been a more fitting place to store it. Either way, we can count ourselves lucky that someone else has done the heavy lifting.

Because this seven segment clock with WS2812B LEDs uses ESPHome, it ties in smoothly with Home Assistant. In Home Assistant you can adjust the colour of the hours and minutes digits and that of the dots. You can also turn off the LEDs, which will surely come in useful if you intend to place the seven segment clock in your bedroom.

Controlling the ESPHome seven segment clock with WS2812B LEDs in Home Assistant
You can adjust the seven segment clock using Home Assistant (Thingiverse)

Hardware you will need for the ESPHome seven segment clock

The creator of this project uses an ESP-01 for their ESPHome seven segment clock. The reason for this decision is not given, and the only advantage I can see is that the ESP-01 is much smaller than something like the LOLIN D1 mini (link to the official store on AliExpress). The LOLIN D1 mini or an equivalent ESP8266 has the advantage of USB being built in, and it can be powered 5V, which is what the WS2812B LEDs use.

Speaking of the WS2812B LEDs, you will need 30 of them. Seven for each digit and two for the dots. When it comes to buying LEDs or LED strips online, I suggest nothing besides BTF-LIGHTING (AliExpress). I have multiple different strips from BTF-LIGHTING in my home, including ones using WS2812B LEDs, and have never been disappointed by them.

If you do opt to go with an ESP-01, make sure you also order a buck converter that will step down the voltage to 3.3V. Without such a buck converter, you would have to use individual power supplies for the WS2812B LEDs and the ESP-01. Furthermore, It is crucial that you select an ESP-01 with 1 MB of flash memory and not the 512 kB version.

Because an ESP-01 can't be programmed directly (it has no USB port) you will also need to make sure you have a programmer adapter on your shopping list. As I mentioned, going with the LOLIN D1 mini, to begin with, is the easier option.

The seven segment models

The creator of the models printed theirs on an Ender 3 3D printer, which is one of the more affordable options on the market. What you will end up with are four digits, two dots, and several bases to stand everything on and hide the wiring in.

A couple of M3 bolts and glue will hold the whole thing together. The WS2812B LEDs are attached directly to the back of the digits and are diffused by the white filament, making it appear as one single light source.

Attaching WS2812B LEDs to the seven segment digits
Attaching WS2812B LEDs to the seven segment digits

Putting the ESPHome seven segment clock together

With the models printed and the WS2812B LEDs wired up, you can start putting everything together. Because WS2812B LEDs can be daisy-chained, all you need is one free pin on the ESP device you went with. With the hardware ready, all that is left to do is flash the code provided by the creator of this featured ESPHome project. And just like that, you have built your seven segment clock that uses WS2812B LEDs and is powered by ESPHome.

A portrait photo oif Liam Alexander Colman, the author, creator, and owner of Home Assistant Guide wearing a suit.

About Liam Alexander Colman

is an experienced Home Assistant user who has been utilizing the platform for a variety of projects over an extended period. His journey began with a Raspberry Pi, which quickly grew to three Raspberry Pis and eventually a full-fledged server. Liam's current operating system of choice is Unraid, with Home Assistant comfortably running in a Docker container.
With a deep understanding of the intricacies of Home Assistant, Liam has an impressive setup, consisting of various Zigbee devices, and seamless integrations with existing products such as his Android TV box. For those interested in learning more about Liam's experience with Home Assistant, he shares his insights on how he first started using the platform and his subsequent journey.


  1. Thanks for the clock Esphome code
    I made this and used a D1mini.
    I’m just getting my feet wet in esp home and don’t know much coding.
    I noticed if I turn down the brightness in HA below 60% the LEDs flicker and below 50% no light.
    I thought it was a hardware or wire issue so I used bench power supply and a d1min with WLED and lights work fine.
    So I’m guessing the code lambda uses brightness to make numbers and when using home assistant to turn down brightness for the whole clock it messes with it and causing flickering.

    • Hello there. I’ve actually experienced similar issues to what you are describing. The same LED strip would flicker below a certain brightness with ESPHome, but not with WLED. There seem to be a couple of suggestions in the repository: Either switch to an ESP32 or try using the neopixelbus instead of fastled.


Leave a comment

Share to...