Advertisement

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.

Advertisement
The ESPHome seven segment clock with WS2812B LEDs standing on a table

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.

Advertisement

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’re planning on placing 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 other than 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.

Advertisement

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. It is also 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 a number of bases to stand everything on and hide the wiring in.

Sale
Creality Ender 3 V2 3D Printer with Silent Mainboard Meanwell Power Glass Bed and Resume Printing...
  • 【Convenient printing】The upgraded ender 3 v2 3d printer can directly use the SD card to print and upgrade the firmware. These upgrades make printing easier. The integrated structure design makes installation faster and easier. 60g filaments(1.75mm) are intimately equipped with the factory, which can be used directly after installation.
  • 【Self-developed Silent Motherboard】 Creality Ender 3v2 with TMC2208 stepper drivers and 32 Bits Silent Mainboard of version 4.2.2 always ensures smooth movement below 50dB and no noise during printing. At the same time, ender 3 v2 is equipped with UL Certified MeanWell Power Supply MeanWell power supply meeting all the needs of fast heating and long-time printing.

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 fillament, 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.

Advertisement
Liam Alexander Colman, the author and maintainer of Home Assistant Guides.

About Liam Alexander Colman

Liam Alexander Colman has been using Home Assistant for various projects for quite some time. What started of with a Raspberry Pi quickly became three Raspberry Pis and eventually a full-blown server. I now use Unraid as my operating system and Home Assistant happily runs in a Docker container. My personal setup includes many Zigbee devices as well as integrations with existing products such as my Android TV box. Read on to find out more on how I got started with Home Assistant.

3 thoughts on “The ESPHome seven segment clock with WS2812B LEDs”

  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.

    Reply
    • 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.

      Reply

Leave a comment

Advertisement