Temperature and Humidity cellar monitor
1.09.2017 - code updated:9.08.2019
This system wakes up every 4 hour to read sensors data, upload their data to ThingSpeak channel and return to deep sleep while data on display remains all the time. In my case there is no need to measure temperature frequently. Unfortunately ESP cannot stand more than approximately 70 minutes in deep sleep, so I needed to count and store number of deep sleeps somewhere and run the code after each fourth wake up. The data stored in EEPROM does not survive deep sleep but the data stored in RTC memory does. So I took advantage of an RTC memory to read and write number of wake-ups before main code is executed.
After the system wakes up, the counter read previously stored value from RTC memory and increase its value by one. If the number of the wakeups is less than 4 the system will return to deep sleep otherwise the main code (measuring, OLED print and data send/receive) will be executed.
OLED displays: inner temperature and humidity, outer temperature, time when measures were captured and network status about system connection. Date and time data are pulled from NTC server after ESP8266 is connected to AP and serve to monitor the last reading time. Network status also helps to indicate where the system hangs during connecting in case if data transmitted unsuccesfully. These informations are useful in places where low RSSI is noted like in the basement.
I've used LiFePo4 battery which has 3.2V nominal so no additional hardware for voltage adaptation is required to power ESP8266 properly. To protect battery from over charge/discharge additional BMS unit is attached to the battery.
Two I2C devices with a different addresses are connected to the same GPIOs.
Inner temperature and humidity data are provided by SHT31 - I2C sensor since DHT22 gave me a lot of inaccurate readings during testing period, especially humidity. Outer temperature is provided by DS18B20.
OLED SSD1306 also communicates over I2C protocol and serves for displaying measured data. It is refreshed every fourth hour and keeps the data till next reading occurs. Contrast of the OLED is set to minimum to extend battery life. It sinks about 3mA with current displayed graphics therefore a proper battery capacity is needed. This device runs more than a month with this battery.
This battery powered ESP8266 device which can send room temperature & humidity including outer temperature sensor's logs to ThingSpeak channel so the data can be observed on ThingSpeak channel or on my mobile phone's widget. Device is also equipped with 0.96" OLED so the data can be read any time on the spot without searching over mobile phone.
Project gallery & downloads:
Project gallery & downloads:
temperature & humidity sensor SHT31
temperature sensor DS18B20
rechargeable battery LiFePo4: 3V2/3300mAh