Deep Sleep with battery monitor
Posted: Sat May 02, 2015 1:13 am
Just a template I created for me to read some sensors once in a while and report the readings to thingspeak. Includes reading of supply voltage via the internal ADC. I successfully did this with an ESP-01 by soldering GPIO16 to RST and a wire to the TOUT pin to do the ADC readings.
Be aware that the internal ADC does its readings in the 0...1V range. You will need a voltage divider to read the power supply voltage. I use a 470kOhm and 100kOhm divider, with is able to read up to 5,7V via the ADC.
The sketch uses the deep sleep option between readings to save power. It is intended to run from battery supply for longer times.
It reports some quality related data to thingspeak that could be changed to other sensor data.
You could see my test-device data (one TMP36 temperature sensor connected, reporting every 2 minutes on
https://thingspeak.com/channels/36172#publicview
first values are not valid and related to testing during programming.
When the recharchables are empty, I will recharge them and do a test run with full recharchables to get some data how long this sketch could run from them.
I run it directly from 3*AA recharchables with is a bit above the ratings of the esp without any voltage divider without any problems till now.
Be aware that the internal ADC does its readings in the 0...1V range. You will need a voltage divider to read the power supply voltage. I use a 470kOhm and 100kOhm divider, with is able to read up to 5,7V via the ADC.
The sketch uses the deep sleep option between readings to save power. It is intended to run from battery supply for longer times.
It reports some quality related data to thingspeak that could be changed to other sensor data.
You could see my test-device data (one TMP36 temperature sensor connected, reporting every 2 minutes on
https://thingspeak.com/channels/36172#publicview
first values are not valid and related to testing during programming.
When the recharchables are empty, I will recharge them and do a test run with full recharchables to get some data how long this sketch could run from them.
I run it directly from 3*AA recharchables with is a bit above the ratings of the esp without any voltage divider without any problems till now.