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.

In the realm of DIY electronics, combining aesthetics with functionality is a common goal. One such example is the innovative use of WS2812B LEDs in timekeeping devices. This article delves into a unique project: the ESPHome Seven-Segment Clock, enhanced with the vibrant capabilities of WS2812B LEDs. Let's explore how this project not only serves as a practical timepiece but also as a colorful addition to any maker's collection.

Contents

Why So Many Esphome Projects Use WS2812B LEDs

The WS2812B LEDs are popular among makers for their affordability and ease of use. These LEDs are perfect for adding RGB lighting with effects to various projects. In a featured ESPHome project, Thingiverse user Alex18881 has creatively modified a seven-segment clock using an ESP-01s and WS2812B LEDs.

This seven-segment clock offers a vibrant alternative to traditional analogue clocks. Its RGB LEDs bring a burst of colour to any room, ensuring it remains an engaging piece.

More Than Just an Ordinary Clock

The reason Alex18881 chose to share this project on Thingiverse is unclear, especially since it incorporates models designed by random1101 without offering new designs. However, Alex18881 contributes valuable code essential for operating this project, for which I am grateful.

Perhaps GitHub would have been a more suitable platform for hosting the code. Nonetheless, we are fortunate to benefit from the groundwork laid by others.

The integration of this seven-segment clock with WS2812B LEDs and ESPHome allows for seamless compatibility with Home Assistant. Users can customize the colours of the hour and minute digits, as well as the dots. Additionally, the LEDs can be turned off, a practical feature for those planning to place the clock in a bedroom.

A screenshot of the Home Assistant Dashboard showing controls for a seven-segment display clock integrated using ESPHome.
You can adjust the seven segment clock using Home Assistant (Thingiverse)

Necessary Hardware for the ESPHome Seven-Segment Clock

The project creator selected an ESP-01 for their ESPHome seven-segment clock. The reason behind this choice is not specified, but a notable benefit of the ESP-01 is its compact size compared to alternatives like the LOLIN D1 mini. The LOLIN D1 mini or a similar ESP8266 module offers the convenience of built-in USB and 5V power compatibility, matching the requirements of WS2812B LEDs.

Speaking of WS2812B LEDs, you'll need 30: seven for each digit and two for the dots. When purchasing LEDs or LED strips online, I highly recommend BTF-LIGHTING. I have used various BTF-LIGHTING strips, including those with WS2812B LEDs, and have consistently been satisfied with their quality.

If you choose an ESP-01, remember to include a buck converter to step down the voltage to 3.3V. Without it, you'll need separate power supplies for the WS2812B LEDs and the ESP-01. It's also important to select an ESP-01 with 1 MB of flash memory, not the 512 kB version.

Since the ESP-01 lacks a USB port and cannot be programmed directly, a programmer adapter is a must-have. However, opting for the LOLIN D1 mini from the start simplifies the process.

The Seven-Segment Models

The models for this project were printed on an Ender 3 3D printer, a budget-friendly option. The final product includes four digits, two dots, and several bases for assembly and concealing the wiring.

A few M3 bolts and some glue will secure the structure. The WS2812B LEDs, mounted directly behind the digits and diffused by the white filament, create a unified light source.

A photograph of 3D-printed models of a seven-segment display clock powered by ESPHome.
A photograph of 3D-printed models of a seven-segment display clock powered by ESPHome.

Assembling the ESPHome Seven-Segment Clock

Once you've printed the models and wired the WS2812B LEDs, assembly can begin. The daisy-chainable nature of WS2812B LEDs means you only need one free pin on your chosen ESP device. With the hardware set up, the final step is to upload the provided code. And there you have it: your very own seven-segment clock with WS2812B LEDs, 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.

Comments

  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 Reply to Cor Cancel reply

Share to...