Skip to content

RTC unit

kornel-schrenk edited this page Nov 14, 2022 · 6 revisions

Motivation

Ideally when M5ezWatch is turned on, it is expected to show the current time. Unfortunately it is not the case, because if it is turned off, the current time has been lost. M5ezWatch has to connect to an available Wifi network first in order to be able to sync the time. What happens if there is no available Wifi connection? The time on the watch remains out of sync...

The solution for this problem is an additional Real Time Clock module, which is connected to the main M5Stack ESP32 Basic Core device through its GROVE I2C port. The more recent M5Stack RTC Unit can be used for this purpose.

In the past M5Stack didn't sell such a unit, so a prototype RTC Unit was built from:

This document explains the creation of this custom RTC unit.

First look

The fully assembled RTC unit looks like this:

It can be connected to the main M5ezWatch pretty easily through the GROVE I2C port:

Again this is prototype - a more user friendly version yet to be built.

Build the unit

Let's disassemble the prototype RTC unit:

The Adafruit DS3231 Precision RTC Breakout has some male header pins soldered onto the PCB, otherwise it is unchanged. The real wiring happens on the M5Stack 2.54mm Mini Proto Unit.

As the first step let's remove the plastic cover!

8 hole female header is soldered onthe the M5Stack 2.54mm Mini Proto Unit PCB. The Adafruit DS3231 Precision RTC Breakout nicely fits into this socket.

The remaining part of the assembly is to wire the GROVE I2C port pins marked as G 5 O I with the right socket pin.

The wiring is done with 22AWG Solid Core wires:

  1. Red - VIN - 5V -> Goes to 5
  2. Black - Ground -> Goes to G
  3. Yellow - SCL -> Goes to I
  4. Green - SDA -> Goes to O

The other pins of the 8 hole female header remains empty.

How to use it

Once the new RTC Unit is ready, just plug it into the GROVE I2C port of the M5Stack ESP32 Basic Core. No additional changes on the software side is needed.

Please do an Update on the Home Screen!

After the next M5ezWatch power off and on cycle, the current time will be displayed without a Wifi sync.

Battery replacement

Please note that the required CR1220 battery is not part of the Adafruit DS3231 Precision RTC Breakout board. You have to buy it separately!

When the battery is low, the RTC Unit won't remember for the current time. If this happens, please replace the old battery with a new one!