-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ESP.getVcc() doesn't read exact values #721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I doubt the accuracy spec for the part (if it has one) is better than 1%. Let's assume the "actual" voltage is 3.750. The readings you are seeing are +0.043 to -0.048. Let's say 0.05. Now 0.05/3.75 is 1.33%. Bottom line, you should only be looking at one digit past the radix (decimal) point, the rest is noise. If you want, you can take several readings at the same time and average them and perhaps get a little more information/stable number. |
I get with my modules (ESP8266-01 and ESP826612) the same trash. The voltage is 3.3V but the output from the Have anyone the same problem? Greets |
well, after some very poor results I decided to supply my esp directly from a li-ion battery. for 4.05 volts on baterry it gives me from ADC value 3854 for me it works fine. |
Also i use vcc and adc , but my mac arrive to max 1000ma on usb and is enough .
|
I try different external power supplies and the best result is:
With 6% difference it is not usable. |
I had problems getting reliable AD readings too. I had multiple devices available so I discovered that each esp gives different readings. Some ESPs are almost accurate but in general the value I was reading was always higher then when measured with a scope of multimeter. A good thing was that at least each individual ESP gives consistent reading. So my solution was to apply a voltage that is known (in my case 4.2V of a full lipo battery) to calibrate each esp. With calibration it was quite accurate. |
//1.- The range of operating voltage of ESP8266 is 1.8V~3.6V ADC_MODE(ADC_VCC); float voltaje=0.00f; |
Hi, I use NodeMcu v2, and I have set:
I got this with my nodemcu v2:
Any thought? I powered it from USB port, and measure it with my DMM, the voltage between 3.3v pin and GND is 3.29 volt. |
I got the same values as minida28 for 3.3V And values like this for |
@jindrichsirucek |
Ok thanks for the tip, Ill check that out.. I have Lolin nodemcu V3 board.. I think there is some capacitor - but I will try it.. |
The caps does not solve the problem in this case. |
Yes @davidegironi you are right - its not about capacitor its because of voltage divider at nodemcu board.. thx.. |
So to solve the problem, we have to remove the voltage divider resistors, any one have tried it? :)
Edit: |
With the voltage divider removed from one of my nodemcu v3 board it's 3.07V, caps once again does not make any difference. It's not yet like the plain ESP12E, cause ADC does not work properly, it works like this issue here: #3168 |
@davidegironi |
@minida28 |
Hello. I own LoLin module. If A0 is not connected ESP.getVcc() returns 2720 (mV). Vcc is 3.290V measured with multimeter. Difference is probably from interference on input resistor divider 220k/100k with internal divider. This is eliminating if just connecting A0 with Vcc (i use green dupont wire for this test video) and then ESP.getVcc() returns 3290 - exact as measured. Please anyone test with different ESP8266 module and/or different Vcc. For me ESP.getVcc() works fine. (I apologise for my english. I use Google translate.) |
For WEMOS D1: The A0 pin is not directly connected to TOUT. If you connect 3.3V to A0 of the WEMOS module it will be divided so the following is true: Solution:
or shorter but not that exact ("3.299 V" (above code) turns into "3.30" (this code))
Now you can read "3.300 V" on the console. IMPORTANT: I read through the documentation of Expressifs ESP8266: DO THIS ON YOUR OWN RISC! It may damage your ESP8266. Please Note: A0 and TOUT are different pins! I think some here mixed that up. |
Yesterday I discovered strange phenomenon. When measuring Vcc after 20 seconds of operation, it measures exact values. |
The adc range wont measure above, but it might be protected against, worth checking into |
@tablatronix ESP8266 is quite robust but a limit is a limit and it may damage the input in a way you don't see immediately. (Linearity,...) |
I believe that the ADC input is limited to 0-1V range. To measure in the range 0-3.3V, board manufacturers put a resistor divider on the pin, to map the range. However, resistors have tolerance, the most common being 5%. |
So I have a wireless node sensor nodeMCU v1.0 with ESP12-E on it (http://www.aliexpress.com/item/2PCS-V3-NodeMcu-Lua-WIFI-development-board-based-ESP8266-LoLin-with-newest-firmware/32368521069.html).
The problem is with the received values from the ADC, for power supply voltage I get the following :
3.739
3.702
3.708
3.711
3.755
3.721
3.761
3.764
3.732
3.734
3.737
3.741
3.744
3.745
3.753
3.793
all these values were from the same source, 1minute delay between them with deep sleep mode in that minute.
It there any hardware thing I should do? to solder something on A0 pin?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: