-->
Page 1 of 2

Deep Sleep with battery monitor

PostPosted: Sat May 02, 2015 1:13 am
by Aes
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.

DEEP_SLEEP_TEMPLATE.ino.txt

Re: Deep Sleep with battery monitor

PostPosted: Sat May 02, 2015 1:20 am
by ArnieO
Coop! Would you mind sharing photos showing how you did the modifications on the ESP-01?

Re: Deep Sleep with battery monitor

PostPosted: Sat May 02, 2015 1:50 am
by Aes
ArnieO wrote:Coop! Would you mind sharing photos showing how you did the modifications on the ESP-01?

Sure
ESP-01a,jpg.jpg

final result soldering
ESP-01b,jpg.jpg

from two ESP-01 one worked completely, one only GPIO16 and TOUT not.

Re: Deep Sleep with battery monitor

PostPosted: Sat May 02, 2015 6:07 am
by ArnieO
@Eas:
Wow, especially the first photo is a soldering that is close to impossible to do by hand in my book. Impressive!