Some insights gained while working on my https://revspace.nl/EspWifiTracker tonight:

Some insights gained while working on my https://revspace.nl/EspWifiTracker tonight:

  • to get long battery life in a battery powered IOT-like application with an ESP8266, it is essential that the device can sleep efficiently
  • the DS3231 is a nice 3.3V compatible real-time-clock chip but you cannot directly use its alarm output to trigger ESP8266 wakeup because it has a level-like output. If you tie it directly to the ESP8266 reset pin, it will keep the ESP in reset, so the ESP is unable to clear the DS3231 alarm (a dead-lock / chicken-and-egg problem).
  • however, if you put a 1 uF capacitor in series to the ESP reset input, the DS3231 low-level alarm output is converted into a low-going pulse, which asserts the ESP reset only momentarily. This is a bit like how the classic arduinos receive a short reset pulse when the DTR signal goes low.

This should allow arbitrary long sleep times, with wakeup exactly on the time programmed into the DS3231 RTC.

What is the DS3231 good for in your tracker? The ESP8266 does have internal RTC, kind of.

I could not find a good example of using the ESP8266 built-in RTC, with some sources even suggesting that there is no real RTC in it. Here’s a thread on the espressif forum suggesting that the internal RTC is reset to 0 when waking up from deep sleep: http://bbs.espressif.com/viewtopic.php?t=1184

I’m sure you’ve seen this craziness (3d mapping of wifi w an esp8266) https://www.youtube.com/watch?v=aqqEYz38ens. I have about 10 ESP’s around my place. If I capture the rssi of all the other esp’s, I have been wondering if I can detect intra-house location by the change in the field due to the transfer function I apply as I walk through my home. I just wrote an android app (https://github.com/physiii/beacon) that captures wifi beacons (I create an ordered list) then I use those values to detect location but obviously not having to carry my phone around my place is superior and I feel I have enough beacons that it is feasible.

@Andy_Payne I am a bit surprised that the field strength varies that much in space and is apparently not smooth at all. I’m looking forward to the ESP-32 which should also be able to do bluetooth low energy and detect BLE beacons.

Cool man - I’ll definitely be buying some but I’m not that excited for the esp32 because generally I wouldn’t design a mixed application because they require different approaches but the next boards I’m hooking up to my automation site are a room sensor - feeding mic data to my backend server for detecting room presence and commands - and a IR blaster

Are you saying the built in RTC is not very accurate? I haven’t tried sleeping more than 6 hours at a time… I was wondering what would happen sleeping for several days or weeks. Would this be an application for the ESP14 series, which has a built in Atmel microcontroller - the uC can serve as a rtc / watchdog for the SoC?

Another chip to consider, the PIC 12F1840 (soic-8) … it draws even less power than the dallas clock chip (300nA with an external 32khz crystal). i2c interface to talk to the ESP (or plain uart). Configure it to emit a brief wake-up pulse to reset the ESP.