Author Topic: Pull-Up resistor stability  (Read 999 times)

0 Members and 1 Guest are viewing this topic.

Offline AmperTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: 00
Pull-Up resistor stability
« on: March 27, 2020, 06:53:21 pm »
Hi!

Just a short question an an idea:

For measuring the supply voltage of a microcontroller (atMega238 in this case) i would usually use a divider and the internal 1.1V reference. But at this point im working on a device with extremely low standby power consumption (nA range) so just having two resistors, even very high value ones like 22M in tests is no option. One idea i had that would also get rid of one of the external Resistors is to just connect one 100k Resistor from an adc pin to ground. Set just as an input this will consume no current, enabling the pull-up resistor will complete the divider, i can take a quick measurement and then turn it off again. This basically works with no problem except that i have no idea what to expect accuracy/ stability wise.
The datasheet only states a range of 20-50kOhm for the pull ups, this can be countered by a quick calibration but if it will change greatly over time or temperature it will render this useless.

Does anyone know more? Is there better ways to measure sytem Voltage? I dont need insane accuracy, just have to turn the power back on before the controller shuts down for having no power.

cheers
 

Offline FenTiger

  • Regular Contributor
  • *
  • Posts: 88
  • Country: gb
Re: Pull-Up resistor stability
« Reply #1 on: March 27, 2020, 07:48:49 pm »
Do you have a spare digital output? You could use it in the same way. Stick with two resistors, but connect one of them to the output, and drive it high impedance for the low current state.
 

Offline AmperTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: 00
Re: Pull-Up resistor stability
« Reply #2 on: March 27, 2020, 07:52:15 pm »
Yes,i could, but i would like to do it th other way if possible. Less board space and one more pin to use.
 

Offline Chalcogenide

  • Regular Contributor
  • *
  • Posts: 178
  • Country: it
Re: Pull-Up resistor stability
« Reply #3 on: March 27, 2020, 08:18:55 pm »
I have used this idea in one of my projects https://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/
Essentially, you switch the ADC reference input to the power supply, then choose the ADC MUX input corresponding to the internal 1.1 V reference. You are thus measuring the reference against the power supply, instead of the opposite way around. Neat and it works, with no DC current and no extra pins or parts needed.
 
The following users thanked this post: MK14

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Pull-Up resistor stability
« Reply #4 on: March 27, 2020, 08:44:46 pm »
That's exactly what I was going to suggest, I've used that in a number of projects and it works pretty well. Obviously it will only work if the AVR is powered directly from the battery though, if you have a regulator then you will be measuring the output of the regulator, which is still probably fine for indicating that the battery is low but it won't get you the true battery voltage.
 

Offline AmperTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: 00
Re: Pull-Up resistor stability
« Reply #5 on: March 27, 2020, 09:04:42 pm »
Wheyy, thats the sort of solution i was looking for, i didnt know you could configure the mux this way ^^

well, if i hada regulator i wouldnt want to measure the input voltage, would i? :P
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7454
  • Country: pl
Re: Pull-Up resistor stability
« Reply #6 on: March 27, 2020, 09:14:24 pm »
The datasheet only states a range of 20-50kOhm for the pull ups, this can be countered by a quick calibration but if it will change greatly over time or temperature it will render this useless.
They are probably made of a strip of doped silicon, that's how it works in old bipolar chips at least.
Thermal coefficient is not as good as in purpose-made resistive materials, but I really don't remember if it's supposed to be bad enough to preclude a few % accuracy (or whatever you want).
The spread quoted in the datasheet is caused by random production variation, which may be quite significant. This I do remember.

That being said, if there is a better way, use it.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Pull-Up resistor stability
« Reply #7 on: March 28, 2020, 01:17:30 am »
Wheyy, thats the sort of solution i was looking for, i didnt know you could configure the mux this way ^^

well, if i hada regulator i wouldnt want to measure the input voltage, would i? :P


Obviously that would be preferable but that wouldn't work with this trick since it measures the voltage of Vcc of the AVR. If you wanted to measure the input to the regulator you'd need a more conventional arrangement with a resistive divider.
 

Online David Hess

  • Super Contributor
  • ***
  • Posts: 17428
  • Country: us
  • DavidH
Re: Pull-Up resistor stability
« Reply #8 on: March 28, 2020, 03:27:08 am »
They do not want to waste any more area on the resistor than necessary so it is probably a pinch resistor or equivalent in a CMOS process which is consistent with that range of tolerance.  They are commonly used for startup circuits where only a tiny current is required.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf