0
\$\begingroup\$

I've designed a PCB that should contain as few components as possible but it should have a simple way for measuring the battery voltage using an ADC channel and a simple voltage divider. My current design with 100k-220k division:

Used Voltage divider

Consumes around 12µA, which is still a bit much for my project constraints.

I'd like to use resistances with 10x that value so around 1MOhm-2MOhm. The readings don't have to be accurate, I just want to have a rough estimate of the LiPo voltage to know when it is empty. I guess if there's too little current drawn over the voltage divider, the noise will be a problem for the ADC.

Is there a best practice for my application or some reference on estimating the noise caused by such high resistances?

EDIT: I am using an ATMEGA1284p AVR MCU, which has an input impedance of 100MOhm

\$\endgroup\$
8
  • 2
    \$\begingroup\$ This 100% depends on the input impedance of your ADC (including it's resistive and capacitive load), together with the acceptable error. I'm guessing you're basically reading this once a minute, so it feels desirable to thing about noise, and directly add an RC anti-aliasing filter to this. \$\endgroup\$ Mar 14, 2021 at 9:40
  • \$\begingroup\$ @MarcusMüller I've edited my question with more information, I am using an ATMEGA1284p, the input impedance of the ADC should be 100MOhm, I am currently searching for ressources on RC anti-aliasing filters, can you please provide one? Found this here: ti.com/lit/an/sbaa282a/… \$\endgroup\$ Mar 14, 2021 at 9:54
  • 1
    \$\begingroup\$ first hint: don't use secondary sources if the primary sources are available: the ATMEGA1285P has a datasheet with an ADC section, certainly! \$\endgroup\$ Mar 14, 2021 at 9:57
  • 1
    \$\begingroup\$ So, look at the figure on page 251 of the current datasheet from microchip's website. You'll see that you need to charge a ca 14 pF sample-and-hold capacitor through your resistors, plus an internal 100 kΩ resistor. (the 100 MΩ is more about what you leak to ground or from VDD if you connected just a DC voltage that literally never changes). You can select the conversion time within bounds – so, pick a conversion time that's long enough, and you can use the biggest resistors in front of the ADC input that still allow charging of the capacitor within a conversion cycle! \$\endgroup\$ Mar 14, 2021 at 10:10
  • 1
    \$\begingroup\$ Thus, the choice of resistors here depends on the conversion speed you want to do. You'll really want to read section 23.7, ADC Noise Canceller; I've got this feeling "going to sleep and waking up when a loooong conversion is complete" is very much what you want. \$\endgroup\$ Mar 14, 2021 at 10:11

1 Answer 1

3
\$\begingroup\$

By itself the impedance is too high. The AVR needs the impedance to be 10k or lower, otherwise the sampling capacitor does not have enough time to charge to the measured voltage and conversion result will be inaccurate.

If you put a capacitor at the ADC input pin, that is large enough (e.g. 100nF), it can provide the necessary AC impedance to the ADC input. However it will not affect the DC impedance so the conversion must not happen too often to let the capacitor voltage charge enough via the high impedance resistor divider.

\$\endgroup\$
4
  • \$\begingroup\$ I am a bit surprised that the AVR needs input impedances below 10k because I have previously used resistances in the 100k range. I don't need continueous conversion, I want to power up the ATMEGA1284p every 1-2min from deep sleep using the rocketscream lowpower library and then perform a couple of ADC readings (maybe 100? for some statistics) with some ms of delay. The Capacitor to the ADC input pin should be connected to GND? \$\endgroup\$ Mar 14, 2021 at 10:43
  • 1
    \$\begingroup\$ @MarcoBobinger as discussed above: your conversion cycles are limited in duration, and you need to charge the internal sample and hold capacitor in that time. Get calculating, stop relying on secondary sources, and strange libraries nobody knows which can't know how you design your hardware (being software libraries!), and calculate, with pen and paper, how long your conversion time is, how much time you thus have to charge your capacitor, and what the maximum series resistance then can be. I told you all this in my comment above. Still,you're running circles around doing this very basic task. \$\endgroup\$ Mar 14, 2021 at 10:48
  • 1
    \$\begingroup\$ Well the 10k is what the manufacturer lists in the datasheet. With that value, the ADC works with the given parameters, over the given voltage, temperature, and clock speed ranges. So you can use any impedance you want, if it works for you. Most likely the megaohm range will be too high to directly work without the added capacitor between ADC input and GND. But it also depends on your ADC clock speed, low speed allows for longer sampling period, but too low can cause other problems in the conversion. \$\endgroup\$
    – Justme
    Mar 14, 2021 at 10:57
  • \$\begingroup\$ @MarcusMüller and Justme thank you. \$\endgroup\$ Mar 14, 2021 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.