Long time ago, I bought "wooden" clock from Aliexpress. I thought it was good purchase, until I noticed it tends to run too fast in a week or two. I am too lazy to reset correct time each few weeks, so I was on my way to trash bin with it. But then I gave it second thoughts. What if it has some sort of TM16xx chip inside? Then I could plug it to ESP board and have NTP to update correct time periodically. To my success it had TM1628 chip and what a convience - 5-pin header! After some googling, some trial and error I managed to light up segments. From there - easy walk in a park. I've found BlockThor's arduino library for TM1628 chip, few corrections, few dozens lines of coding and bingo! Clock shows correct time. Also, it has two smaller segments, which are dedicated to temperature and humidity display. Since I don't have any sensors on my ESP, I've decided to use MQTT to read temperature and humidity. Feel free to edit / reuse code as you wish.
CLOCK | ESP32 | DESC |
---|---|---|
1 | GPIO19 | DIO |
2 | GPIO18 | CLK |
3 | GPIO5 | STB |
4 | GND | GND |
5 | 3V3 | VCC |
*Note: PIN1 on the clock is furthest from the opening hole.
I've reused original barrel-type power plug. Just keep in mind, that you need to scratch/remove traces to not provide power to original board. If your ESP keeps rebooting, it might be too long power cable. I had to shorten mine to 30-40cm. ESP32 convienently fit on the back of original board with some hot glue. Also, AFAIK ESP8266 / Wemos / etc. won't work as it does not have internal RTC.
BlockThor - https://github.com/BlockThor/TM1628