# How to improve the accuracy of measured ADC voltage in a circuit connected to Vcc

The question is based on the following setup.

As depicted there is an IC to measure the real value of the 3.3V supply voltage accurately. The measured value of the 3.3V source is transferred via SPI to the microcontroller. This microcontroller is measuring the voltage divider between 3.3V and GND and has a reference voltage for its ADC. simulate this circuit – Schematic created using CircuitLab

Problem: If the 3.3V supply voltage is changing the ADC measurement from the microcontroller is influenced.

Question: Can I compensate a changing 3.3V source with the measurement of the IC if the accuracy if this chip is within my limits.

• The ADC ought to have an internal lower reference V and acceptable tolerance. If you need error correction, pls. Define specs e.g. temp vs error Jan 14 at 15:00
• "there is an IC to measure the real value of the 3.3V supply voltage accurately." What IC are you using? Jan 14 at 15:12
• Seems like you have two things measuring the same voltage. Why don't you just pick the more accurate one? And if there is some reason, explain what you expect to be compensating against and how you intend to measure the variable for compensation. Jan 14 at 15:13
• I'm not making any sense out of this proposal. If the IC on the left measures the 3.3 volt accurately then use its digital output. Jan 14 at 15:23
• Is this voltage divider a sensor? I think most of us see you trying to measure 3.3V twice, not measure the value of a sensor and correct it with a 3.3V measurement. Jan 14 at 16:09

If you can get occasional more accurate measurements of the 3.3V you can correct the measurement via the voltage divider, which can be made more frequently. The details, such as filtering, would depend on how the 3.3V changes (how rapidly, and how much). It could be difficult if the changes are relatively large and spikey

Maybe you could even do a one-time self-calibration and store the factor in an EEPROM. What makes sense depends very much on the details of what you are trying to do. For example, for one application we added monitoring of all supply rail voltages and currents because the instrument was going to be very much inaccessible during operation.

I suggest making the maximum allowable correction factor modest, yet large enough to counter changes due to ADC reference tolerance, drift, temperature drift, and resistor tolerance. And consider what has to happen if the accurate measurement is late or is never received, or is clearly out of whack- system-level issues.

• So in software with additional limitations in the way I commented: ((3.3V measured from left IC)/3.3V)*ADC measurement from microcontroller on the right)=compensated ADC-measurement? Jan 14 at 16:04
• (Current uCADC/Reference uCADC)*(reference accurate measurement voltage). That assume there is minimal offset, that most of the error is scale. Jan 14 at 16:18
• Sorry for expressing it in a confusing way. @TimWescott gave me the correct hint that the votage divider is a bit missleading the lower part is a sensot that changes its resistance. I tried to depict it with the potensiometer symbol. To clarify it I added a notice to the drawing in my question. (The 3,3V is not measured twice) Jan 14 at 16:46
• Okay, the same principle applies in any case. Jan 14 at 16:49 simulate this circuit – Schematic created using CircuitLab

You can use an opamp to buffer the internal Vref of your MCU, and it becomes a ratiometric ADC. Example for 12 bit ADC:

$$Code=\frac{4095}{V_{ref}}\cdot V_{ADC}=\frac{4095}{V_{ref}}\cdot V_{ref}\frac{R_2}{R_1+R_2} = 4095\frac{R_2}{R_1+R_2}$$

As you see, the V_ref cancels out.