Hello,
I am working with AM2302 (humidity and temperature) sensor to record the readings and send data and go to deep sleep for 20 seconds using internal RTC of esp8266 thing dev board. But now for more accurate time keeping I want to use external RTC (DS321SN) to make my board go to deep sleep and wake up after specific length of time to send data. However, I am unable to write the code for it. Can anyone please provide me a code which I could use as a base to learn how to use external RTC together with ESP8266 thing dev ? Thank You!!
I’ve changed the category from “issues an errors” to “Need help…” as it’s not an issue with Blynk.
Deep sleep for 20 seconds doesn’t seem worth it - by the time you’ve woken up and done the Wi-Fi reconnect then taken your reading and sent it off then gone back to sleep you’ll probably only have a 1:1 or 2:1 sleep/wake duty cycle.
I don’t think an external RTC is going to help with your timing. My understanding is that the ESP uses its internal clock during deep sleep. It would simplify the process of getting the correct time to concatenation with your temp/humidity readings, but that’s not necessary with Blynk anyway, as the readings are time stamped usimg the server clock. As you have the Blynk RTC available, and you’ll be connecting to Blynk every time you wake up then you’d be able to synchronise the time anyway - if you needed it for something else.
Also, Blynk averages readings for Superchart, so sending data more often than once every minute doesn’t really achieve very much.
Pete.
NO actually I am using 20 seconds time period for test purposes. In reality I will be using larger time interval. For some reason I need to go with external RTC. That is why I need to make it work.
I think you’re missing the point.
The RTC keeps a fairly accurate time, but your ESP only uses that time when it synchronises with the RTC. The ESP can’t do this when it’s asleep and anyway the ESP doesn’t use a date/time to choose when to wake-up, it uses the internal milis timer. When the specified number of milliseconds has passed the ESP will wake up. Adding an RTC doesn’t make the internal millis counter any more accurate during deep sleep.
Pete.
But the internal timer has limitation upto one hour whereas I want my device to sleep for a much longer time.
You can try an external timer of some sort… low power 555 based or something, and have it trigger an interrupt based wake mode.
Basically what you are looking for is still NOT Blynk specific and you will get better overall results with some Google searching or requesting some programming assistance on sites like Fiverr
Yes I am using external timer DS 3231SN but I don’t know how to make it work.
Google
Besides, that is a RTC, not a independent timer… yes it has a couple of Time-of-Day Alarms built in, but they will require a MCU to receive and process the I2C signal… not going to happen with a sleepy MCU.
You need a simple, adjustable and low power timer that simply toggles an inturupt pin HIGH or LOW
I’m guessing that you’ve googled how to extend the standard ESP deep sleep time from 71 minutes and found somewhere that talks about storing a counter in NVR or RTC RAM and assumed that this means adding an external RTC module to achieve that?
This isn’t the solution. The ESP has an internal memory location for RTC and these solutions are about using that memory location to store a counter for keeping track of how many 71 minute cycles have elapsed so far.
Once again, adding an external RTC won’t help to achieve deep sleep longer than 71 minutes.
Also, it would have been useful for all concerned if you’d provided more info in your original post.
Pete.