Battery Powered Wifi IoT – Temperature, Humidity & Soil Moisture Sensors

Battery Powered Wifi IoT – Temperature, Humidity & Soil Moisture Sensors

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

TempHumMoistureIoTv2

HW parts

  • ESP-01
  • ATTINY13A
  • ATTINY85
  • 3.3 power 1A boost
  • resistors
  • mosfet

HW prototyping

DSC_0158 DSC_0162 DSC_0171

DSC_0172 DSC_0173 DSC_0175

DSC_0177

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. 😎
DSC_0179

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:
iot-battery17w
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.
ESP-battery-3xAAA A ESP-battery-3xAAA B ESP-battery-3xAAA C

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}

iot-temp-hum-result

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

.

11 thoughts on “Battery Powered Wifi IoT – Temperature, Humidity & Soil Moisture Sensors

  1. Benoit

    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.

    1. Tomas

      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.

  2. 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.

    1. Tomas

      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.

  3. Jonte

    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.

  4. Arjan de Vries

    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

  5. Dealah in Kóma

    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!

  6. Stanislas Mauser

    What was the Code to read the Voltage value of the connected power Source? Or did you measured it by hand?

Leave a Reply

Your email address will not be published. Required fields are marked *