Ds3231 RTC and Deepsleep

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
budman1758
Normal user
Posts: 301
Joined: 15 Apr 2017, 05:13
Location: Riverside CA USA

Ds3231 RTC and Deepsleep

#1 Post by budman1758 » 17 Oct 2018, 07:57

This is an extension/reboot of another topic that kinda diverged from its original subject so I thought it deserved a new topic.
viewtopic.php?p=32374#p32374
The goal here is to use the DS3231 RTC to enable deepsleep for longer than the ESP's built in limit of approx 71 minutes.
The DS4341 has timers than can be configured for hours to days and so on. My project idea here is a battery powered, solar recharged soil moisture array.
The general idea is for it to have up to whatever the practical limit of separate sensors is and it sleeps for say, for example 3 to 9 hours, wakes up, sends data, goes back to sleep. Awake time could be up to several minutes.

User enesbcs memberlist.php?mode=viewprofile&u=2764 has developed a DS3231 plugin and its working quite well. There is a link to a bin file with it on the above mentioned thread.
After experimenting with the timer function for a while though a problem has come up. See the last few posts on the above mentioned topic for some detail.
What I am looking for is a circuit that will turn the alarm output into a short negative pulse to reset the ESP module and wake it up. The DS3231 output does not pulse. It currently goes from 3.3v (pulled up) to approx .034 volts. It stays there until the alarm flag in the chip is reset by the ESP after wakeup. (this seems to be by design in the DS3231 chip)

Hoping some of the electronics wizards here can point me in the right direction. 555 timer chips have been mentioned but I'm not sure if they will function @3.3 volts. Keep in mind that this is battery powered. The less power used while sleeping the better.

Thanks!!!
"The glass is twice as big as it needs to be".

Dakhaas
New user
Posts: 1
Joined: 18 Oct 2018, 01:11

Re: Ds3231 RTC and Deepsleep

#2 Post by Dakhaas » 18 Oct 2018, 01:28

Hi,
I'm new here and by accident read your question.
I have a similar test case almost like you want it.
I have a simple DHT22 on a single wemos d1 mini with battery shield on a 18650 and solar panel.
The unit gets the actual time from my router (functioning as a local NTP server to all projects).
It does nothing with the time for now, as the MQTT broker also uses the NTP server.
it also can get a variable from the MQTT broker/Node RED.

If it is ok, then your unit could wake up llike every hour, send a 'I am here' to the MQTT broker/Node-red, which keeps track of how much time has passed(how many times it has gone to sleep),
returns another variable with which the wemos determines whether it should go to sleep again or run the sensor first.

I use the system now to send (by smartphone) variable sleep timings to the MQTT broker, which it sends to the wemos when it is awake. :geek: The time the wemos is awake is each time less than a second.(a led flash).
maybe it is not what you wanted, but I see some advantages:
- You get a MQTT message every hour that the unit still works.
- the sensors stay smaller
- it's easier to maintain, as the settings are set in the server.

User avatar
budman1758
Normal user
Posts: 301
Joined: 15 Apr 2017, 05:13
Location: Riverside CA USA

Re: Ds3231 RTC and Deepsleep

#3 Post by budman1758 » 18 Oct 2018, 03:09

Dakhaas wrote: 18 Oct 2018, 01:28 The unit gets the actual time from my router (functioning as a local NTP server to all projects).
It does nothing with the time for now, as the MQTT broker also uses the NTP server.
it also can get a variable from the MQTT broker/Node RED.
Thanks for that. However the main thing is not so much the time function but the alarm function so as to sleep for several hours at a time.
"The glass is twice as big as it needs to be".

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests