Comments (4)
Hmm, if I set my refVoltage
to 3306, which is what I measure across the 3V3 pin and GND (despite powering from 5V USB) then the figures are much closer. Still half a volt out, but I guess it's better than nothing and I can fudge the numbers ..
from batterysense.
from batterysense.
Hi @rlogiacco, thanks. I have a Wemos S2 mini which is an ESP32-S2FN4R2.
I do not understand how to discovery the correct ref voltage.. :(
This ESP32-S2 document mentions 1100mV as the ADC calibration reference voltage but that sounds way too low to me..
from batterysense.
Yours is a 3.3V board and also the ADC seems to be recommending an external 100nF capacitor:
So, it would help if you change the begin
method parameter to 3300
(as for ´3.3V´) and add the capacitor. I also suggest measuring the real values of the two resistors used for the voltage divider to increase accuracy: unless you go for precision resistors, values might be quite different from what you expect.
To be clear, the ESP32 (the MCU at the core of your board) has a 1.1V
vRef (specs from the manufacturer state this is just a median value though), this is then converted to a 3.3V
reference by the board (by using a voltage divider, which might be introducing inaccuracy), on top of that you are using an additional voltage divider... Sadly the board you are using is not really the best choice for your goal if accuracy is key.
BTW, I do not own the board you are using, thus I’m only reading specifications found on the internet.
from batterysense.
Related Issues (13)
- Unsteady reading result HOT 2
- higher-on-demand circuit HOT 5
- Double ADC read when accessing voltage and level HOT 1
- Thinking error. HOT 2
- Non linear discharge model HOT 5
- Error in the guide?!
- Arduino MKR WiFi 1010 Battery Level HOT 4
- Library conflict HOT 2
- Library assumes 10-bit ADC HOT 9
- Higher voltage than expected HOT 6
- Small error in OnDemandDoubleLiIon HOT 2
- Which voltage divider for 3.3v board? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from batterysense.