Close
0%
0%

Epaper Deepsleep digital clock

Powered by an ESP32 this inefficient, imprecise and over-engineered digital clock can be a great learning resource for ESP-IDF beginners

Similar projects worth following
Even an impresice click is right at least once a day.
This project's mission is to make an epaper digital clock with the lowest power consumption in ESP32

It will do this 3 things and this three things only:

1. It will Sync with internet time using our own super fast IoT API to retrieve time once a day
2. The epaper will render the day, Month and in next line the Hour:Minute just as any digital clock
3. It will go to seep N minutes defined in the beginning of sleepMinutes (Does not matter, can be 2 minutes, 5 minutes, etc)

This is a demo project made with the intention to learn more about C++ and ESP-IDF framework and about epaper partial refresh. Check a small demo of how it updates:

https://twitter.com/martinfasani/status/1278385134501351424

ESP-IDF is a great framework to build small embedded devices. This project does not use Arduino-esp32 framework but only Espressif IoT framework. As a pre-requisite to compile this you should be familiar with ESP-IDF framework and know how to use the idf.py tool to build and flash your ESP32 board.

Disclaimer: Because of the nature of ESP32 deepsleep this clock it's not precise. It may differ 4 or 5 minutes a day, depending on temperature and other factors that are deeply out of my understanding. That's precisely why is cool to research and use this concepts for other Internet of the Things applications.

The idea is to have fun making an over-engineered, imprecise, and cool ESP32 digital epaper clock that is fully customizable. Along the journey you can gain experience with many Espressif things, like NVS key-value storage, epaper displays and using C++ in ESP-IDF.

Learning IDF

It's a nice example to learn how to store values in Non Volatile Storage of the ESP32 where you can store value types like integers and \0 terminated strings in a way that is persisted even if the chip is powered off. I call \0 terminated strings char arrays but I'm not sure if that is the best denomination. Is also interesting to practice doing short internet queries and to learn how to do it in Espressif's own IoT development framework without any Arduino boilerplate functions on top.

  • 1 × TTGO T5s (2.7 inch epaper) Or any other epaper display connected with an SPI interface to ESP32
  • 1 × If you don't use a TTGO then any ESP32 If possible with a very good deepsleep consumption under 1 mA. Tinypico.com consumes 0.08 mA/hr when sleeping
  • 1 × A 3D printed case from Thingiverse https://www.thingiverse.com/movil/designs -> You can find many in my designs including TTGO T5 & Good display 4.2 and 5.83
  • 1 × Any supported epaper with an SPI interface Check the GitHub wiki to see the supported eink displays
  • 1 × A 3.7v Lithium Ion battery If the esp32 board does not have battery management you will have to build one or use an external Adafruit module

  • A more precise clock with RTC

    Martin Fasani09/14/2022 at 19:07 0 comments

    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 adds also color epaper classes

    Martin Fasani09/15/2020 at 10:11 0 comments


    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:

    https://github.com/martinberlin/cale-idf

    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:

    https://github.com/martinberlin/cale-idf/wiki


  • Wrist esp32 epaper watch get's a housing and updated C++

    Martin Fasani07/20/2020 at 14:46 0 comments

    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.

    3D model ready for the printer:

    https://www.thingiverse.com/thing:4546700

    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.

    Repository is the same just in branch refactor/oop:
    https://github.com/martinberlin/cale-idf/tree/refactor/oop/main
    C++ source: demo-sleep-clock-v2.cpp
    Happy builds!

  • Wrist digital Epaper watch

    Martin Fasani07/12/2020 at 08:09 0 comments

    While on holidays I found in the studio of my father a small 1.54 inches epaper

    Why not to add a tinyPICO esp32 as a controller and make a real epaper clock using a customized version of the clock firmware?

    Me thinks is a cool idea and will be a cheap make, with the exception of the esp32 that is about 22 dollars. But is worth it!

    The difference with cheap boards makes it a good choice:

    • Deepsleep consumption with dotstar led Turned off is 0.08 mA
    • Has 4 MB spiram (pseudo static ram)
    • It’s super small!

    Additionally we will need a:

    1. Small battery
    2.  3D printed case for the watch body
    3. Watch strap

    no buttons for now! It will be a button less digital clock

    A small preview just with the epaper on my wrist :)

    Do you like the idea? Would you walk with an esp32 in deepsleep mode on your wrist?

  • New 7.5 inches build

    Martin Fasani07/09/2020 at 06:57 0 comments

    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:

    https://github.com/martinberlin/cale-idf/tree/carlos/7.5-digital

    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:

    void deepsleep(){
        esp_deep_sleep(1000000LL * 60 * sleepMinutes - microsCorrection + microsBootPrediction); // + microsBootPrediction
    }

  • CalEPD is the epaper component behind this clock

    Martin Fasani07/04/2020 at 20:37 0 comments

    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.

View all 6 project logs

  • 1
    Clone the cale-idf repository
  • 2
    Swith to the development branch: refactor/oop

    cd cale-idf
    git checkout develop

  • 3
    ESP-IDF set the target for your project
    idf.py set-target esp32 


    Alternatively this Firmware will run also in the ESP32S2. If you want to build it for that target:

    idf.py set-target esp32s2 

View all 6 instructions

Enjoy this project?

Share

Discussions

Martin Fasani wrote 07/04/2020 at 07:30 point

Thanks. All my housing designs are available in the Thingiverse link. Per request I can also send the .blender file for custom modifications. Make one :)

You will like this fun clock. Thanks for the support!

  Are you sure? yes | no

Waldo Wolmarans wrote 07/02/2020 at 20:16 point

Nice 3D printed case design.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates