This was an experiment to make an easy, no external components, simple clock.
But of course they are dedicated chips when you want to have precise time. One of them is the popular DS3231, also not the cheapest if you add in a PCB, you can find it for around 3 USD in Aliexpress or eBay.
The DS3231 is a low-cost, extremely accurate I2C
real-time clock (RTC) with an integrated temperature- compensated
crystal oscillator (TCXO) and crystal.
Using this nice RTC that do are 2 Wire I2C and do not consume time, you can sync the controller chip with WiFi to get the NTP time and then you can set it on the DS3231. After this it will keep the time for long since it comes with a small coin battery, that can keep it up for at least 5 to 10 years. In my latest project:
Epaper weather station where I aim to design an open source controller PCB but also the code to drive it, I've designed an ESP32S3 PCB, that acts as a master SPI but also has a DS3231 on board. So you can have both things directly available in case you need to make an industrial clock. This RTC chip due to the compensated crystal allows also to read ambient temperature. If you are interested in the Epaper weather station project please follow it in Github to be aware of the new additions.
And now would be someone interested in having a demo code with one of this cheap RTC modules like the one below?
Cale-idf is where we test new versions of CalEPD esp-idf epaper component. Is a repository where CalEPD is working together with our fork of Adafruit GFX. We started adding some color epapers, already 5.83 and 7.5 inches from Good display are there:
E-paper component driver for the ESP-IDF framework and compatible with ESP32 / ESP32S2 can be found in this repository:
Codenamed Cal e-pe-de for the initials of E-Paper Display this is basically all what I’ve been doing the last weeks. Learning more about C++ object oriented coding and preparing a class that can be used to send graphic Buffers to different epaper displays. In order to do that I’m documenting on the go and building at the same time CALE-IDF that is our Firmware version for CALE.es but this time built on top of the Espressif IoT Development Framework (IDF)
The mission of this new component is to have a similar library for ESP-IDF that is easier to understand. If possible strictly meeting these requirements:
Extendable
Maintainable
Object-Oriented Programming with human-readable code and function names
Easy to add a new Epaper display drivers
Easy to implement and send stuff to your Epaper displays
Human-understandable
Well documented
ESP-IDF only (No Arduino classes)
Please find here the Wiki with the models that are already supported in the component:
As a preamble, due that this is very small, I used a tinypico.com ESP32. I took the steps done by Unexpected maker to turn off the Dotstar led so it consumes as less as possible in deepsleep (My measurement 0.08 mA)
With a Lipo battery of 80 mA tt has been working since Friday 11:30 am (146 hrs aprox.) If my maths are not wrong 80/146 is approx. 0.54 mA per hour consumption. Updating every 4 mins the epaper and WiFi sync only once per day less than 2 secs online using esp32 tinypico.
Smallest epaper option that I used is an Heltec 1.54 inches (200x200) Please note that at the moment I'm not measuring battery level, when it's over it will simply not update anymore, and you may see small droplets of black in the epaper (Current is not enough to turn it full black I guess) This is how it looked when it stopped:
I cannot guarantee that it will last that much, but provided connects only one per day to sync, then it should consume only what the epaper needs to refresh and go again to sleep.
This 800*480 epaper is sold by Waveshare but the display's brand is Good display. Never understood 100% how it is between those two but my thoughts are that waveshare adds electronics on top. Like the SPI interface. Or in some models even a PCB ready for an esp32. But the epapers for makers since ages are mostly from http://www.good-display.com
This new model I made for my father that is the one who really knows about electronics and usually compiles and tests some of my firmwares. He added some custom modifications in this branch:
Battery is 5000mA and esp32 used is a http://tinyPICO.com (0.08 mA/h deepsleep consumption w/dotstar turned off)
We added a microseconds int64 correction to compensate boot time. Doing so I realized the Boot-Time correction so the clock is more precise is about 0.3 seconds. That means when you power on the esp32 it takes aprox. 0.3 seconds to arrive to the startTime first measurement. It does his update, with internet sync or not depending on the hour, and at the end measures endTime. So it discounts that time to the next sleep round plus our correction time that we called microsBootPrediction. In other words the program runtime the is discounted from the minutes sleep round.
That number is discounted from the N minutes Deepsleep you select. As is given in microseconds calculation is done in this function:
cale-idf Wiki is where CalEPD component is being developed but also where each epaper module testing is being documented.
You can use this module to drive your ESP-IDF epaper project too independently from this project. CalEPD has it's own repository so you can use it as a git submodule for your ESP-IDF firmware.
If your epaper class is not there just add an issue in the repository.