Pull-Up resistor stability - Page 1
Forum section: electronics / projects

author: Amper
author_rank: Frequent Contributor
timestamp: March 27, 2020, 06:53:21 pm
content: 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

author: FenTiger
author_rank: Regular Contributor
timestamp: March 27, 2020, 07:48:49 pm
content: 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.

author: Amper
author_rank: Frequent Contributor
timestamp: March 27, 2020, 07:52:15 pm
content: Yes,i could, but i would like to do it th other way if possible. Less board space and one more pin to use.

author: Chalcogenide
author_rank: Regular Contributor
timestamp: March 27, 2020, 08:18:55 pm
content: I have used this idea in one of my projectshttps://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.

author: james_s
author_rank: Super Contributor
timestamp: March 27, 2020, 08:44:46 pm
content: 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.

author: Amper
author_rank: Frequent Contributor
timestamp: March 27, 2020, 09:04:42 pm
content: 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?

author: magic
author_rank: Super Contributor
timestamp: March 27, 2020, 09:14:24 pm
content: Quote from: Amper on March 27, 2020, 06:53:21 pmThey 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.

author: james_s
author_rank: Super Contributor
timestamp: March 28, 2020, 01:17:30 am
content: Quote from: Amper on March 27, 2020, 09:04:42 pmObviously 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.

author: David Hess
author_rank: Super Contributor
timestamp: March 28, 2020, 03:27:08 am
content: 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.