logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

LED clock on WS2812B (NTP)

efi222  53 13965 Cool? (+55)
📢 Listen (AI):

TL;DR

  • A large WS2812B LED clock shows time and weekdays, with digits 79 mm high and the day line placed above or below the numbers.
  • The enclosure uses PLA-printed parts, a glued two-piece mounting frame, an HDF back wall, and white self-adhesive foil inside the partitions.
  • The display is tuned for the popular 60 LED/m strip, and the current time is downloaded from NTP servers every hour by default.
  • It offers many colors and animations, including nine display colors, a "Patriot" pattern, and a very slow vertical color change.
  • The build depends on access to a 3D printer, and the author still needs to finish the GUI.
Generated by the language model.
Digital clock with an LED display showing the time 23:54.

Hello :)
Watches featuring WS2812B have already been published on Elektroda. I would like to present my version. I had some of this tape left over from recent projects and decided to use it. Access to a 3D printer may make this project difficult.

The clock has digits that are 79 mm high. It`s big, but you get used to it. After several experiments, it seems that this height is optimal when using the most popular strip with a density of 60 LED/m. In addition to the dots, there are two diodes (on the tape) per digit segment. I also tested with smaller displays. The minimum height is 45mm (one diode per segment, without removing the LED from the strip).

The clock shows the days of the week in addition to the time. A friend of mine talked me into it and I think it was a good idea. The day display can be placed above or below the numbers. The current time is downloaded from NTP servers every hour by default. Undoubtedly, the advantage of this design is the almost unlimited display in terms of colors and animations. You can also link the display to the calendar and display different patterns on specific dates.

All elements except the back wall (HDF) are printed from PLA. The mounting frame is glued from two parts.

Black mounting frame for a clock, assembled for installation.

And as a finishing touch, a furniture edge is pressed onto it.

Clock frame with LED display and digit segments.

I glued the partition-type elements from the inside with white self-adhesive foil. In my opinion it goes faster than painting white. And the job is clean.

Two black plastic frames for LED clock digits.

After unsuccessfully searching for white PVC for matte screens, I experimented with a white print. I think it looks quite nice. Up close you can barely see the print threads, but from a distance of several dozen centimeters you have to look closely to see them. And if someone doesn`t know about their existence, they don`t notice them :)

White sheets printed on a 3D printer lying on a brown background.
Close-up of an LED display segment with blue LEDs.

connected sections of tape

Close-up of LED clock construction using WS2812B.

installation

Exploded view of LED clock housing with spacer, frame, and base.
Black mounting frame on a flat surface
Digital LED clock with segment display on a table.
Mounting frame for a clock with printed numerical segments.
Black 3D-printed LED clock frame prepared for assembly.
Digital LED clock module with exposed electronics and wires.

More interesting patterns

DIY digital clock with large digits and colorful LEDs.
I called this pattern "Patriot". Good for days off from work :)
Digital clock displaying colorful numbers 23:54 on an LED display.
Very slow vertical color change.
The remaining patterns are different display colors. There are 9 of them.

Digital LED clock on a wooden table.

Electronics:
Rear view of LED clock with visible electronics.

I still have to think about the GUI. I am attaching the development code in the Arduino IDE.

device diagram
Electronic schematic of an NTP clock with WS2812B LEDs.

Well, that`s it in a nutshell :)
Attachments:
  • Zegar_WS2812_Elektroda_STL.zip (321.91 KB) You must be logged in to download this attachment.
  • Zegar_WS2812_Elektroda.zip (5.29 KB) You must be logged in to download this attachment.

About Author
efi222
efi222 wrote 652 posts with rating 1055 , helped 12 times. Live in city Toruń. Been with us since 2019 year.

Comments

krzbor 10 Dec 2023 00:08

Very nice design, but the diagram looks interesting - only a few elements! [Read more]

efi222 10 Dec 2023 01:13

With the exception of the ADC circuit for auto-adjusting the display brightness, these are the basic elements needed for the proper operation of the ESP8266. [Read more]

michcz 10 Dec 2023 01:41

The cock is very cool and aesthetic. Would there be a chance to make STL available? Maybe I`d finally have an excuse this Christmas to dust off the printer. :) You can get rid of striations on the focusing... [Read more]

efi222 10 Dec 2023 08:52

There is no problem with providing *.stl. I t try anything with acetone. But these stripes are really hard to see. Maybe they even add charm :) . Matte is one layer from a 0.4 nozzle with a path width... [Read more]

madamsz1 10 Dec 2023 09:47

Maybe something from a damaged TV matrix would meet the requirements. I used to have these nice 1mm sheets from an older one. Best with CCFL backlighting. Overall, a very nice project. [Read more]

efi222 10 Dec 2023 12:43

In other projects, I used 0.16 mm thick PVC as mats. 1 mm is much too thick. At this thickness, the light from the segments will be scattered onto adjacent segments. Here, the wall between the segments... [Read more]

CMS 10 Dec 2023 12:45

Very nice construction. I think that in this case these stripes add charm. [Read more]

efi222 10 Dec 2023 12:57

Photo in higher resolution. By the way, there were some artifacts that needed to be cleaned around the dots.. :) [Read more]

robig 10 Dec 2023 13:45

Acetone for PLA? It will not work, this method only with ABS and ASA. For PLA, chloroform, which you can`t buy, or sodium hydroxide, a strong base that is better not to play with. Efi222 - great idea... [Read more]

LA72 10 Dec 2023 13:51

Spray plastic works great with PLA. [Read more]

efi222 10 Dec 2023 14:46

I will add from myself (I am writing from practice) that to print such a matting sheet you need to properly set the table and warm up the entire machine. Without this, each subsequent copy may come out... [Read more]

Anonymous 10 Dec 2023 16:47

Well, I`m wondering if a mistake was made there? The ADC in ESP8266 is up to 1V. And from the calculations, the average GL5516 is 7.5kOhm for "bright" to ground 33kOhm, the voltage divider will give 2.9V... [Read more]

krzbor 10 Dec 2023 17:01

You are right - the author did not notice that the ADC is up to 1V. Here is my solution for photoresistor-controlled backlighting Link . I used a large resistor to ground (1M) to achieve high resolution... [Read more]

gulson 10 Dec 2023 17:40

A wonderful effect, contact me with information about the Parcel Locker and I will send you a small gift. [Read more]

efi222 10 Dec 2023 18:51

Mr. @Jarzabek and @krzbor, you are 100% right. You can get confused sometimes with ADC. I remembered this 1V range. But somewhere after that it went into the bushes :D The photoresistor is behind a dark... [Read more]

krzbor 10 Dec 2023 19:13

That t (it s not dark, the LEDs can work at maximum anyway. Basically, what you have done (overdriving the ADC) is just using the lower voltage range (when it is dark). [Read more]

Anonymous 10 Dec 2023 20:24

The characteristics of the ADC in ESP8266 are as below. The maximum input voltage value of 1V should be considered optimistic. https://obrazki.elektroda.pl/9340200400_1702236224_bigthumb.jpg @efi222... [Read more]

efi222 10 Dec 2023 20:51

This is beyond my scope of knowledge at the moment. But I`ll try to educate myself. Thank you for your tips :) [Read more]

urkotrebor 10 Dec 2023 22:04

Some time ago, when I was playing with WS2812B diodes, I read that the control signal is 5V and you connect it directly to the ESP, did you have any problems with it? If I remember correctly, the library... [Read more]

FAQ

TL;DR: A 79 mm-digit NTP clock driven by an ESP8266 and about 240 WS2812B LEDs shows time plus weekday bars; “these are the basic elements needed for the proper operation of the ESP8266” [Elektroda, efi222, post #20854324] Correct ≤ 1 V ADC wiring and optional 3.3 → 5 V level-shifting keep it reliable.

Why it matters: Small wiring errors (5 V logic, 2.9 V on ADC) can silently shorten the life of your ESP8266 clock.

Quick Facts

• Digit height options: 79 mm (2 LEDs/segment) or 45 mm (1 LED/segment) [Elektroda, efi222, post #20853923] • WS2812B strip density: 60 LEDs / m, daisy-chainable to 1 024 LEDs per pin [Worldsemi, WS2812B Datasheet] • NTP resync period: default 1 h, adjustable in code [Elektroda, efi222, post #20853923] • ESP8266 ADC safe range: 0–1 V; divider with 1 MΩ gives high resolution in low light [Elektroda, krzbor, post #20855139] • WS2812B DIN-HIGH spec: ≥ 0.7 VDD ≈ 3.5 V when powered at 5 V [Worldsemi, WS2812B Datasheet]

What hardware do I need to replicate the WS2812B NTP clock?

Essential parts: 1 × ESP8266 module, ~240 × WS2812B LEDs on 60 LED/m strip, 5 V ⎓ 4–5 A power brick, photo-resistor (GL5516) with 1 MΩ–33 kΩ divider for auto-dimming, HDF back-plate, PLA 3-D printed frame, plus optional CD4050 or single WS2812B as a 3.3 → 5 V buffer [Elektroda, efi222, #20854324; #20855734].

How many LEDs does each 79 mm digit use?

A seven-segment digit uses 2 LEDs per segment plus two for the colon, so 16 LEDs. Four digits and separators total about 68 LEDs; weekday bars raise the count to roughly 240 when animations are included [Elektroda, efi222, post #20853923]

How does the clock stay accurate over time?

Firmware queries public NTP servers every hour, updates the Real-Time Clock structure, and adjusts automatically for daylight-saving rules in code [Elektroda, efi222, post #20853923]

Do I really need a level shifter between ESP8266 and WS2812B?

At 5 V supply the WS2812B spec calls for ≥ 3.5 V HIGH. An un-shifted 3.3 V line often works but is outside spec. Adding a CD4050 or one spare WS2812B as a buffer guarantees compliance and protects the ESP against 5 V reflections [Worldsemi Datasheet; Elektroda, efi222, #20855734].

What diffuser material and thickness give sharp segments?

White PLA printed in a single 0.17–0.20 mm layer from a 0.4 mm nozzle, or 0.16 mm PVC, blocks light bleed while staying thin enough for uniform brightness; anything ≈ 1 mm lets light spill into adjacent segments [Elektroda, efi222, #20854445; #20854706].

How can I remove visible layer lines on PLA diffusers?

Acetone vapor only works on ABS/ASA. For PLA use spray filler, sodium hydroxide vapor (hazardous), or sand and re-print with finer extrusion width; chemical smoothing can worsen optical uniformity [Elektroda, robig, #20854796; efi222, #20854913].

What happens if the ADC pin sees 2.9 V?

That exceeds the 1 V absolute-max; the ESP8266 still runs but readings flatten near full-scale and long-term damage is possible, as noticed when brightness behaved "strangely in very bright rooms" [Elektroda, efi222, post #20855310]

How many WS2812B LEDs can one ESP8266 pin drive?

Worldsemi allows up to 1 024 cascaded LEDs per data line. At 800 kHz this equals 30 ms frame time, so animations stay smooth up to ~500 LEDs; beyond that frame rate drops [Worldsemi, Datasheet].

Can the clock run from a single Li-ion cell?

Yes. The ESP8266 tolerated 4.2 V for months in deep-sleep tests but current was ≈ 1 mA, ten-times higher than at 3.3 V, so a regulator is recommended for efficient always-on clocks [Elektroda, efi222, post #20856366]

Edge case: what if my diffuser is too thick?

A 1 mm sheet scatters light into neighboring segments, reducing contrast and destroying the crisp “7-segment” look [Elektroda, efi222, post #20854706]

How do I re-calibrate auto-dimming?

  1. Measure room-dark ADC reading; adjust lower PWM bound.
  2. Shine bright light, verify ADC ≤ 1 V; tweak divider.
  3. Update curve_w[] lookup to map ADC 0–1023 to PWM 0–255 exponentially. "Vision works logarithmically" [Elektroda, krzbor, post #20855376]

Can I add date or holiday animations?

Yes. The firmware already holds nine colour patterns and a "Patriot" animation; linking to a calendar file lets you trigger special palettes on specific dates via simple if-statements in the main loop [Elektroda, efi222, post #20853923]
Generated by the language model.
%}