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
.
Hello! Where did you buy the dc-dc boost converter ? Do you have a reference / link to share? I bought one on aliexpress and it’s efficiency is 50% at max.
Now I use the very cheap one: http://www.ebay.com/itm/2pcs-DC-1-8V-3V-3-7V-5V-to-3-3V-Step-UP-Down-Power-Supply-Module-replace-AMS1117-/261950171859?hash=item3cfd726ad3
Input is from 1.8-5V but in my experience from 2.5-5V so I use this for 3xAA batteries. It starts at 4.5V and is working couple of months and should work 6+ months. Since booster is in circuit behind the MOSFET, it is completely off during the wait time so with 0 quiescent current.
2xAA batteries last more then 60 days, check http://homecircuits.eu/blog/battery-powered-esp8266-iot-logger/
I will try also this one: http://www.ebay.com/itm/231062865700?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT with only 1 AA.
I am using this one (same manufacturer) : http://www.ebay.com/itm/mini-DC-DC-0-8-3-3V-DC-3-3V-Step-UP-Boost-Power-Module-Breadboard-Arduino-/281556288481?pt=LH_DefaultDomain_0&hash=item418e1003e1 since it is rated for 500 mA max (yours is rated 100-150 mA) and the esp826 can draw up to 300 mA…. I will double check my circuit again and buy your reference. Thanks for your advice.
Hi Tomas, thanks for publishing the code for the DHT22 project. As you suggested, I made a new PCB for the Si7021 project and also added some silkscreen text: https://easyeda.com/sirprize/Temperaturlogger_copy-0bff1a92e3ce4a6397da4e2c6f1cfaf0
To save on space, I left out the Tiny85 and connected the analog inputs to the Tiny13 – is that a problem? In my understanding, the Tiny13 could do the same AD conversions and also send the data to the ESP8266.
BTW: I did not order the Si7021 PCB yet as I am waiting for the DHT22 PCB – I want to check the production quality.
Cheers from Germany, Michael.
I was trying to have serial data from ATTiny13, but not successful. Another advantage of separate tiny85 is the reference voltage 3.3V also if powered from less voltage batteries. If you will find the way of serial communication with tiny13A, please give me a hint. Thanks for sharing PCB.
Hi! What kind of MOSFET do you use? I have had a hard time finding a mosfet that switches 3.3v with 3.3v gate voltage.
I have used N-channel MOSFET IRL2230 which has Static Drain-to-Source On-Resistance RDS(on) 10mOhm. So with 200mA it is 2mV drop.
IRL2230 specs: http://www.infineon.com/dgdl/irl2203n.pdf?fileId=5546d462533600a40153565b549324f9
Hi Thomas,
Good idea using an attiny to lower the power. I have build the project but also some improvements:
– (done) im using the wifi manager for the 8266 so i can easily configure the ssid and password.
– (done) post the data to a PHP script for mysql logging
– (done) used dygraph for visualisation
– (todo) add an feed back cable from the 8266 to the attiny so it can initiate the power down.
– (todo) cache data and send it after x time over wifi (i think this saves power)
– (todo) add extra configuration options in the wifi manger like wake up interval, cache size
Thanks, Arjan
gosh I need exactly something similar to this. Tomas don’t you plan selling this pre-build?
I’d be happy buying quite a few and focus on the software development part.
Amazing work though, congratulation!
What was the Code to read the Voltage value of the connected power Source? Or did you measured it by hand?