I have just made a prototype of ESP8266 (ESP-01) IoT temperature & humidity SI7021 sensor and also 2x three pin soil moisture sensors with only 0.006mA (6µA) current drain during the sleep.
The idea is simple and consist of the following decisions:
- ESP-01 as wifi and I2C master for temperature and humidity SI7021 sensor
- ATTINY85 for 2xAD readings of moisture sensors and 1xAD reading of battery voltage level
- ATTINY13A to completely turn off all the rest circuits (to minimize sleep consumption 6µA) via mosfet
- 2x AA batteries with 3.3 power 1A boost to power hungry ESP8266
Wiring
HW parts
- ESP-01
- ATTINY13A
- ATTINY85
- 3.3 power 1A boost
- resistors
- mosfet
HW prototyping
I made also version with 1x moisture sensor and 1x light sensor (any two analog or digital sensors can be used).
Challenges
- Power boost vs step down. I think the 1A 3.3 power boost is will be better (need to prove it by real tests)
- SI7021 sensor and not DHT22 anymore. Si7021 is much faster (doesn’t need 2s) with the same (or better) accuracy
- battery type = 2xAA and now I’m considering CR123A
- Uptime = esp wifi communication takes up to 3.5s from power down
- Moisture sensor takes 20mA. With 2 of them 40mA is quite a big value.
- Communcation from ATTINY85 to ESP-01 = via only one TXpin by SoftwareSerial.h
Battery life
Power consumption of the project during the sleep time is really outperforming all other battery powered projects with only 6µA (0.006mA) current consumption! Much less then using just deep sleep mode. 😎
I will do the test with these battery types:
- 2x AA battery (Tesco power Hi Tech) which should last more then 3 months (based on Temperature sensor project)
- 1x 18650 850 mAh battery (older UltraFire sold as 5300mAh but real 850mAh) took only 17 days. I will repeat the test with new 18650 battery.
- 3x AAA battery (Ikea). I will test.
- 3x AA battery (Ikea). 7741 measurements during 17weeks!
- 1x CR123A (need to buy one 😉 )
Test with 1x older 850mAh 18650 battery after 11 days was promising. The battery was still above 3.7V. However day 17 was the turn point and the battery was decresing 0.1V an hour.
Version with only SI7021 temperature and humidity sensor and 3xIkea AA:
After 50 days the interim batteries voltage level is 4.08V with WiFi transferring and 4.34V (1.44V each!) during sleep mode. After 7741 measurements (4 months) the project stopped sending data:
Project stopped with 3.9V in rest and 3.64V in wifi on. So I removed the mini Step-UP-Down Power regulator and connected battery directly to wifi and the project continues to send data (now 3 additional weeks). Next time I will use directly 3xAA without step-up-down power regulator.
Version with only SI7021 temperature and humidity sensor and 1xCR123A 3V battery:
Soon to be started…
Results
The version with SI7021 temperature and humidity, 1x moisture sensor and 1x light sensor.
Sample of results with 1 moisture sensor and 3xAA batteries
{"temp":"23.51","hum":"55","serial":"M1=655M2=0B=650","milis":"3426","datetime":"2016-05-02 23:04:56","epoch":1462223096} {"temp":"23.51","hum":"55","serial":"M1=655M2=0B=650","milis":"3420","datetime":"2016-05-02 23:16:07","epoch":1462223767} {"temp":"23.51","hum":"56","serial":"M1=655M2=0B=650","milis":"3424","datetime":"2016-05-02 23:27:17","epoch":1462224437} {"temp":"23.50","hum":"56","serial":"M1=655M2=0B=650","milis":"3424","datetime":"2016-05-02 23:38:28","epoch":1462225108}
This blog will be updated….
The ESP8266 code: link (not optimized but running stable)
The ATtiny85 code: https://gitlab.com/snippets/1853459
The ATtiny13a code: https://gitlab.com/snippets/30510
Other possibilities
Temperature Humidity Barometric Pressure BME280 Digital Sensor
.