5
\$\begingroup\$

I am building a circuit using the ESP8266-01 and a temperature sensor. For the final test I am using a 9V battery and I have many questions:

  • The 01 version only have two pins to read, but the GPIO0 should be grounded when programming, therefore how can I connect something to that pin? Putting in the code, placing in ground and then to the other sensor?
  • The other question is related with measuring the battery left in the 9V battery. How can I do it?I am going to explain the situation:

The data of the sensor are uploaded to thingspeak and I though in show a webserver with the battery left, accessing through the IP of the ESP8266. Can this be done? Also I think that knowing the total voltage (9V) and the current voltage can be know the % left in the battery, isn't?

Have Anyone tried this and could share what do you think about doing it?

\$\endgroup\$
3
\$\begingroup\$

GPIO-0 when pulled low during startup allows you to flash code in it. If GPIO-0 is HIGH during startup, it allows normal boot-up from flash. You will have to ensure that any sensor attached to it it not driving the pin LOW during a start-up sequence.

I am not sure about ESP-01 but other versions (ESP-07) has adc pin which has input range of 0-1V. You can make a voltage divider using resistors to scale your battery voltage (9V) to 1V and give that to adc pin as an input. Here is an example:

esp adc ckt

Keep the voltage divider Resistor values high because it will consume a current = Battery Voltage / Total Resistance, 0.1 mA in this case.

\$\endgroup\$
  • 2
    \$\begingroup\$ I have been researching and using the ESP-01 is impossible, because has not an analogue pin, so I have to upgrade to one of those versions 07,12. I will try this solution when I own the new version with analogue pin. Also this version make me easier to do the deep sleep mode. Thanks \$\endgroup\$ – CapAm Nov 14 '15 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.