Author Topic: voltage divider doesn't add up  (Read 1242 times)

0 Members and 1 Guest are viewing this topic.

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 9219
  • Country: fi
Re: voltage divider doesn't add up
« Reply #25 on: November 19, 2024, 11:37:03 am »
if you want best power efficiency then use only 1 resistor and the the MCU internal resistance of the ADC as the other divider. This will not be repeatable for if you make multiple units (they will differ from one to the other) but then there is the least load on the power.

What do you mean by "MCU internal resistance of the ADC"? Internal pulldown resistor which would have like +100/-50% tolerance? I'm aware in some rare cases actual configurable resistors are available, e.g. in nRF52 series ADCs have those, but I doubt ATSAM21E18 has anything like that?

I know that is why I stated that tis is not repeatable (because you probably need to tinker the resistance per installation) and only when you need absolutely minimal power consumption.

I'm afraid internal pulldown is so heavily temperature-dependent that tuning for unit-to-unit variance is not enough, you would need to add temperature compensation. I don't believe this would be a viable solution, unless it's a really crude indication like "now it's closer to 4 than 2 volts".

There are other better solutions involving switching off the divider: simply connecting the bottom leg to GPIO pin instead of GND leg allows easy switch-off of the divider, but when Vbat > Vcc then some current will still flow through the upper resistor, through pin protection diodes into Vcc, but at least this would contribute to Vcc (and reduce the regulator current by same amount); just need to make sure that under no circumstances (worst case minimum low sleep current) it leaks more than the MCU consumes, raising the Vcc rail.

EDIT: now that I think about it, your solution will consume more current, because it forces one to select lower value upper resistor (because the lower one is fixed in design, like 50k). Thus the current from input, through your single resistor, through IO protection diode, to Vcc, would be also higher. And probably high enough preventing usage of sleep modes (or, causing the MCU to blow up, unless you add a clamp on Vcc net)
« Last Edit: November 19, 2024, 11:41:13 am by Siwastaja »
 

Offline mclienTopic starter

  • Contributor
  • Posts: 21
  • Country: de
Re: voltage divider doesn't add up
« Reply #26 on: November 20, 2024, 11:12:30 am »
Thanks for all the background information.
For my specific project with limited space and GPIOs and the fact that the MCU is only powered up for about 10 time a day for 15sec max., I think for me the simplest solution is the 2 resistor divider with the largest values that give me an accurate enough reading. (that would be 10 steps of 0.1V, which cover the voltage range from 4.2 to 3.2V (which are the values covered by the LiPoly protection circuit).
From my testing that would be a sum of ~ 440k (2x220k).

Thanks a lot to all of you
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf