ESP8266 Based 8 Digit LED NTP Clock With YouTube Statistics Display

by adrian-smith31 in Circuits > Clocks

204 Views, 1 Favorites, 0 Comments

ESP8266 Based 8 Digit LED NTP Clock With YouTube Statistics Display

PXL_20210226_153219391.jpg
PXL_20210305_115738241.jpg
PXL_20210305_115744440.jpg
PXL_20210305_115916781.jpg
PXL_20220731_121050105.jpg
PXL_20220731_121112384_exported_1205_1659269496798.jpg
ESP8266 NTP clock with YouTube subscriber & views counter display. Configured via web interface.

This project is an universal 8 digit internet connected display which could be used for a number of things but in this instructable it will display the time from the NTP time service and also provide YouTube statistics of your channel showing subscriber count and total video view count. Due to YouTube’s limitations implemented in 2019 the counter will only show exact numbers of subscribers up to 999. After that it will begin rounding them down on a sliding scale starting with the lowest 10. For example 1234 subscribers will show as 1230 and 12345 subscribers will show as 12300 subscribers. Hence this product is suitable for small channels and producers who want to keep an eye on their subscribers as well as know the time!

This project was created for a desktop unit that could show me my channel statistics and as a side function display the time from an accurate time source.

There is also a clock only version of the code on my website too for those that want to use this as a clock only and are not interested in the YouTube stats function.

This is my first instructable and I hope I have made it clear. Please comment below if you have any questions.

Supplies

Custom made PCB - Gerber files at https://www.adrian-smith31.co.uk/blog/wp-content/uploads/2021/03/ICM7228-Display-ESP8266-V1.1.zip

ICM7218AIPI or ICM7228AIPI LED display driver IC x1 (either will work)

ModeMCU Lolin V3 (wide version with CH340 serial IC) x1

220K resistor x1

100nf capacitor x3

HDSP-5501 Common Anode 0.56" 7 segment display (or equivalent) x8

Pin headers 2.54mm x2

Push button switch 2 pin

Assemble the PCB

ICM7228_Schematic.png
PXL_20210305_115543979.jpg

Gather your components and assemble the PCB so it looks as shown. Or, if you wish design your own PCB; the circuit is a bit too complex for veroboard or perfboard and you can get PCB's made cheap enough now. However for those with some patience making it on veroboard isn't out of the question especially for a one-off. I would recommend putting the LED displays into sockets to increase their height over the chips. Turned pin sockets or headers cut to size work best to avoid intermittent connections to the LED display pins.

Program the NodeMCU

Arduino boards manager.jpg
Realterm.jpg

Next you will need to program the NodeMCU ESP8266 module using the Arduino IDE with support for ESP8266 modules. You can add this using the boards manager function within the Arduino IDE pasting the following URL. http://arduino.esp8266.com/stable/package_esp8266com_index.json

Note that I used version 2.6.0 - some compilation issues may occur with older or later versions.

Once programmed and the board is rebooted it should display 8. on all displays then a row of dashes followed by --HELP-- after a short while. This indicates that the ESP8266 is working and needs connecting to the internet.

Please note that the source code is set for UTC timezone. As the NTP servers do not support local time zones you will need to edit this line of code "long utcOffsetInSeconds = 0;" to your timezone before compiling the source code. There are 3600 seconds per hour so for example in CET timezone you would enter "long utcOffsetInSeconds = 3600;" and for Western US time you would enter "long utcOffsetInSeconds = -180000;"

Precompiled binaries are available for UK and Europe on my blog site which can be flashed with the esp8266flasher.exe tool. There are two versions for each timezone; one that saves power by turning off the display at night and one that does not and the display is always on.

If you struggle to compile the code let me know and I can compile a version for you. Just let me know what your timezone is.

Lastly there is a serial diagnostics function on this project for troubleshooting. Error messages and status information is sent to the serial port for analysis if required.

Clock only version NTP clock only version of my ESP8266 based display – Adrian’s electronics blog (adrian-smith31.co.uk)

Configure the Network and YouTube API Key

I will attach a PDF instruction file for this step as it requires a few configurations to be made

Downloads

Assemble Into a Suitable Case

PXL_20210308_095844163 (2).jpg
PXL_20210226_153253481.jpg

I used a deep photo frame for the case but you can use anything you wish. You will need to solder the push button switch to the PCB as per the instructions and fit it to a suitable place on the case. For a final touch you could add some transparent window tint to the glass to make the display easier to read in sunlight and to hide the PCB.

That's It, You Are Done!

Enjoy your clock and stats display!