0
\$\begingroup\$

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.

schematic

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.

\$\endgroup\$
11
  • 1
    \$\begingroup\$ 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 \$\endgroup\$ – Tony Stewart EE75 Jan 14 at 15:00
  • \$\begingroup\$ "there is an IC to measure the real value of the 3.3V supply voltage accurately." What IC are you using? \$\endgroup\$ – Math Keeps Me Busy Jan 14 at 15:12
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – Spehro Pefhany Jan 14 at 15:13
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – Andy aka Jan 14 at 15:23
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – TimWescott Jan 14 at 16:09
1
\$\begingroup\$

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.

\$\endgroup\$
4
  • \$\begingroup\$ 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? \$\endgroup\$ – Stani Jan 14 at 16:04
  • \$\begingroup\$ (Current uCADC/Reference uCADC)*(reference accurate measurement voltage). That assume there is minimal offset, that most of the error is scale. \$\endgroup\$ – Spehro Pefhany Jan 14 at 16:18
  • \$\begingroup\$ 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) \$\endgroup\$ – Stani Jan 14 at 16:46
  • \$\begingroup\$ Okay, the same principle applies in any case. \$\endgroup\$ – Spehro Pefhany Jan 14 at 16:49
2
\$\begingroup\$

schematic

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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