Reading a lithium battery with a pro mini

Good afternoon all.
I am trying to get an accurate reading of the same lithium battery that my pro mini 3.3 is running on (via a MT306 boost converter). Ive connected the battery through a voltage divider to step it down to acceptable range of the 3.3v arduino. the readings are adequate but a bit noisy and im wondering what could be causing the noise. i tried connecting a potentiometer to the circuit to see whether it was the switching converter which was creating the noise but this produces a reading which is steady a s a rock. ive included a schematic. Many thanks, Dan.

gonadgranny:
the readings are adequate but a bit noisy

The boost converter is probably quite noisy. Your 10k pot. in the diagram is referenced to the 3.3V supply regulated on the 'mini so it should be quieter.

Add a 0.1uF capacitor across your 33k (i.e. capacitor from A2 input to GND), that should filter out some of the noise.

Yours,
TonyWilk

Thanks Tony this seems to have had a marked improvement. Might i ask how you decided on the value of the capacitor? Dan.

gonadgranny:
Thanks Tony this seems to have had a marked improvement. Might i ask how you decided on the value of the capacitor? Dan.

Pure guess. 0.1uF is a very common value to use for decoupling and 'light smoothing' of signals.

To be more scientific about it, you'd work out the time over which you want the input filtered and pick suitable resistance and capacitance. In this case there's roughly 10k before the 0.1uf, giving a time constant of 1mS so it should smooth out fast spikey stuff but not slow down the response.

In this case you could add another 10uF which will smooth it a lot more (time constant now c. 0.1seconds) because the voltage level on a battery isn't exactly a fast-changing signal.

Yours,
TonyWilk