battery level ESP8266
Moderators: grovkillen, Stuntteam, TD-er
battery level ESP8266
Hello!
i want to measure the voltage level on the battery
connected as follows
to the pin, the ADC connected the output from the battery (where the plus was output through the 10K resistor and minus through the 5K resistor), then all these resistors are connected in one and the output is connected to the ADC) the controller itself flashed firmware ESP_Easy_mega-20180723_test_ESP8266_4096_VCC.bin, but the battery charge I did not see, I also noticed that on the ADC pin the voltage is 1.3V with a charged battery.
tell me what I'm doing not how I get the battery level.
If I add the device Analog input - internal
then the value is -1
Thank you
i want to measure the voltage level on the battery
connected as follows
to the pin, the ADC connected the output from the battery (where the plus was output through the 10K resistor and minus through the 5K resistor), then all these resistors are connected in one and the output is connected to the ADC) the controller itself flashed firmware ESP_Easy_mega-20180723_test_ESP8266_4096_VCC.bin, but the battery charge I did not see, I also noticed that on the ADC pin the voltage is 1.3V with a charged battery.
tell me what I'm doing not how I get the battery level.
If I add the device Analog input - internal
then the value is -1
Thank you
Re: battery level ESP8266
It needs a bit more info.
Please can you give a schematic?
Are you using a "naked" ESP8266 or a nodeMCU / WeMOS?
Maybe a hint:
The ADC built into the ESP uses 10 bits over a range of 0...1 V.
10 bits gives 1024 output steps from 0 to 1023.
So one outupt step from ADC equals a voltage of 0,977 mV.
If you use a divider of 10K/5K on a blank ESP and a usual Lithium battery this can't work.
The fully charged battery has a voltage of around 3,7V.
10K/5K divides down to 1/3 this giving 1,23 V - far over the limit of the ESP's ADC.
If you use 20K/5K divider a charged battery will give 0.925 V, the ADC will show 947.
Be aware resistors have some tolerances so the value shown from the ADC may differ a bit.
For more info about ADC and handling out values see wiki:
https://letscontrolit.com/wiki/index.ph ... Converters
Please can you give a schematic?
Are you using a "naked" ESP8266 or a nodeMCU / WeMOS?
Maybe a hint:
The ADC built into the ESP uses 10 bits over a range of 0...1 V.
10 bits gives 1024 output steps from 0 to 1023.
So one outupt step from ADC equals a voltage of 0,977 mV.
If you use a divider of 10K/5K on a blank ESP and a usual Lithium battery this can't work.
The fully charged battery has a voltage of around 3,7V.
10K/5K divides down to 1/3 this giving 1,23 V - far over the limit of the ESP's ADC.
If you use 20K/5K divider a charged battery will give 0.925 V, the ADC will show 947.
Be aware resistors have some tolerances so the value shown from the ADC may differ a bit.
For more info about ADC and handling out values see wiki:
https://letscontrolit.com/wiki/index.ph ... Converters
Regards
Shardan
Shardan
Re: battery level ESP8266
i use naked ESP8266
chem i attachment
most likely you are right, I need to replace 10K at 20K
chem i attachment
most likely you are right, I need to replace 10K at 20K
- Attachments
-
- P_20180724_150521.jpg (1.23 MiB) Viewed 8176 times
Re: battery level ESP8266
i change resistor from 5k to 8.3K
and 5K to 26.7
in pin ADC i have 0.945V but in devices Analog value is -1.00
and 5K to 26.7
in pin ADC i have 0.945V but in devices Analog value is -1.00
Re: battery level ESP8266
wheen i upgrade firmware from vcc to dev analog input show me current voltage.
Re: battery level ESP8266
The ADC input of the ESP8266 is very high impedance (needs to draw an infinitesimally small amount of current) so you can get away with fairly large values of resistors in the divider network (the higher the better as these are directly across the battery and adding to drain).
Your original 15K total divider was having a constant drain on a 4v battery of 266 microamps .. quite a lot compared to the ESP8266 in deep sleep!
I am successfully running a li-ion battery sense network comprising a 120k and 390k resistor divider. This has a direct drain on the battery of approx 8 microamps. I suspect resistors even higher could be used.
Your original 15K total divider was having a constant drain on a 4v battery of 266 microamps .. quite a lot compared to the ESP8266 in deep sleep!
I am successfully running a li-ion battery sense network comprising a 120k and 390k resistor divider. This has a direct drain on the battery of approx 8 microamps. I suspect resistors even higher could be used.
Re: battery level ESP8266
that is, you to save battery consumption and to the port of ADS it is better to use high-resistance resistors
Re: battery level ESP8266
That's correct.
The ESP8266 datasheet sadly doesn't say anything about ADC imput impedance.
It just gives a maximum currant for this pin of 50nA. As the max. voltage is 1V,
Ohm's law gives a resistance of 20 MOhm for the ADC pin, i assume it's even more.
So a voltage divider made of 5 MOhm / 1 MOhm should work.
20 MOhm in parallel to 1 MOhm gives already a small influence to the output,
but it is far below the tolerances of your resistors so that might be ignored without
issues.
For battery life this is the better way. It results in a current of about 0,67 µA
on the battery.
The ESP8266 datasheet sadly doesn't say anything about ADC imput impedance.
It just gives a maximum currant for this pin of 50nA. As the max. voltage is 1V,
Ohm's law gives a resistance of 20 MOhm for the ADC pin, i assume it's even more.
So a voltage divider made of 5 MOhm / 1 MOhm should work.
20 MOhm in parallel to 1 MOhm gives already a small influence to the output,
but it is far below the tolerances of your resistors so that might be ignored without
issues.
For battery life this is the better way. It results in a current of about 0,67 µA
on the battery.
Regards
Shardan
Shardan
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 30 guests