Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By Aes
#16246 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
You do not have the required permissions to view the files attached to this post.
User avatar
By Aes
#16252
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.
You do not have the required permissions to view the files attached to this post.