So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By schufti
#70742 hi,
pcf8523 has a dedicated Vbat pin that should be connected to a coin cell battery.
The chip automatically switches between Vdd and battery.
from the datasheet
Code: Select allThe PCF8523 has a backup battery switch-over circuit, which detects power failures and
automatically switches to the battery supply when a power failure occurs.


If it stops running then there is obviously something wrong with your setup.

see adafruit breakout board https://www.adafruit.com/product/3295
User avatar
By gdsports
#70747 The ESP8266 depends on an internal timer to wake up from deep sleep. If this timer is not accurate enough for your application, you could try adding/subtracting an offset to calibrate it.

If the PCF8523 has the correct date/time after waking from deep sleep, it is working fine.

The TimeAlarms library depends on the CPU running. Since the ESP8266 CPU is not running during deep sleep, these software timers cannot wake up the ESP from deep sleep.

It might be possible to use an external RTC with alarm feature and interrupt out pin to reset the ESP8266 at the wake up time. You must read the PCF8523 datasheet and schematic to see if this is possible.
User avatar
By Paolo Cinaglia
#70808
gdsports wrote:The ESP8266 depends on an internal timer to wake up from deep sleep. If this timer is not accurate enough for your application, you could try adding/subtracting an offset to calibrate it.

If the PCF8523 has the correct date/time after waking from deep sleep, it is working fine.

The TimeAlarms library depends on the CPU running. Since the ESP8266 CPU is not running during deep sleep, these software timers cannot wake up the ESP from deep sleep.

It might be possible to use an external RTC with alarm feature and interrupt out pin to reset the ESP8266 at the wake up time. You must read the PCF8523 datasheet and schematic to see if this is possible.


Thanks alot gdsports. I thought about something like "rtc.always_on" (if someone has a solution like this please tell me) or else to keep the pcf awaken. I was wrong... it's not so simple...
User avatar
By rudy
#70812 @ Paolo

As long as the PCF8523 has power it should be working. Maybe the problem is with your code rather than the part.

Get this sketch working https://github.com/adafruit/RTClib/blob ... cf8523.ino

Set the clock, then reload the program without the clock setting function enabled. After that you should be able to turn off the power, turn the power back on, read the clock, and the time should be correct. As long as the clock chip has power from the line powered supply, or power from the battery, the clock should keep running.