¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

VBAT resistor voltage divider, polynomial fitting, VBAT sampling


 

I used resistors to make a voltage divider, and tied the 20K across D2 and the 100K from D2- to C47 gnd.
In the attached image, currents with VBATEN on and off show 60 and 35 uA, respectively.
One image shows the resistors installed...they are the smallest 1% I have, and for the first time in a long time, I felt like a bull in a china shop using a baseball bat trying to solder those GIANT 1/8W resistors onto the SMD board.
The screen shows 3324 mV, and the batt measures 4200. It is, of course, uncalibrated. The Nano is using a voltage offset for a diode, and I have installed a voltage divider with a fixed scale of 1.4. It is reported ~900mV low. Not sure how to make sense of that, unless the version I am running is not actually accounting for any drop at all. I think that I am a version behind, and will correct that in the next day or so. Hmm...just checked. Running 0.4.3, the latest on my drive. Guess I don't know how to check or change the diode drop...

I'd like to work with a dev to test the stability of the voltage divider. Based on my experiences with real time embedded systems, the averaging of 32 samples should not be necessary. With any sampling system, there is a settling time after input is selected. I have not looked it up in the manual yet, but I understand many of the issues surrounding ADC sampling, in general. In fact, wrt the diode, that circuit might benefit from a small cap to stabilize the circuit.

How much to the 32 samples differ? That is, what are the stats: avg, std dev, etc? In terms of what we are doing, how much accuracy do we need?

A comment about data fitting. It is possible to fit almost any crummy data with a poly of high enough degree. The downside is that although all the data point may fit using that approach, twixt data points the poly might wander afar. It helps to have a feeling for the type of system response: linear, poly, power, trig, etc. Then determine what constitutes a reasonable fit. THEN analyze the data, and see if it meets your expectations.

I use the attached spreadsheet because I can have several data sets on the same sheet and keep them visually in mind.
The sheet as attached shows the fit for the 20k-100k divider, and has a feature to show enabling VBATEN.

I'll prolly download some code and look at it, but I am not prepared to compile...I assume that I need to install a fair bit of software to get to that point, and I'd rather...in the short run especially...work with someone who already does all that.

73 de Rich NE1EE
On the banks of the Piscataqua

Join [email protected] to automatically receive all group messages.