# Measure output voltage of a voltage regulator

I've been designing a switching voltage regulator and I need to make fairly accurate measurements of the output voltage (including the transient states etc.). I try to present my design in the following block diagrams. The regulator is set for a fixed output voltage by the resistors R1 R2, however, it is digitally adjusted using a DAC signal from a microcontroller. The ADC is 12-bit, while the DAC is only 10-bit.

Since the voltage will be read using the same microcontroller (the output voltage of DAC is known). Will the accuracy of the measurement decrease if I use the design in the first picture? If I am not mistaken, the DAC state will be needed for the calculation.

Or is it safer and will provide better results if I just implement additional voltage divider to the circuit as shown in picture 2? My thought is that it should, since the DAC is 'less accurate' than the ADC. Is there any drawbacks using a second voltage divider like that?

Circuit 1 will not work: FB voltage is fixed regardless of output voltage. Often it's 1.25V or so. You will always read the same thing on FB pin.

The regulators (both linear and buck/boost) work in such a way that they output whatever voltage they need so that feedback voltage becomes some specific value - very often it's 1.2V or 1.25V, but not necessarily - check the datasheet.

You may therefore want to reconsider your output voltage setting mechanism, since you probably assumed different math for output voltage.

Circuit 2 is therefore the only possible solution of the two provided.

• How can you say that circuit 1 will not regulate but circuit 2 will. They are the same circuit. Both circuits will regulate fine. Circuit 2 however will more accurately measure the output voltage. Feb 27, 2022 at 17:05
• The 1.25 V FB voltage you mention is between Output and FB (across R1 in the OP's drawings), not between FB and Ground. In the first drawing, the ADC is measuring the voltage from FB to Ground. Feb 27, 2022 at 17:17
• @PeterBennett you're incorrect about that. Check the datasheet of any IC. It's internal Op Amp's reference voltage
– Ilya
Feb 27, 2022 at 17:56
• @Barry I'm not saying circuit 2 does not regulate. It does regulate, but with different math than you probably imagined. But ADC will always read the same voltage whether you output 2V or 42V. Because the regulator outputs such voltage, that voltage on feedback will always be the same. That's the point of the feedback divider.
– Ilya
Feb 27, 2022 at 18:05
• Precisely said @Ilya Feb 27, 2022 at 18:46

In your first schematic, the ADC is effectively measuring the DAC output voltage, rather than the regulator output voltage.

In the second schematic, you are measuring the regulator output voltage. If the regulator does not follow the DAC setting for any reason, you will see that difference with this circuit.

• I would put it that the ADC is measuring a linear combination of the DAC output and the supply output. So to get the "true" voltage of the supply output you'd need to know the resistor ratio and the exact output voltage of the DAC. Feb 27, 2022 at 17:29
• Circuit 1 measures Vref, not the DAC. So it’s pretty much useless. -1. Feb 27, 2022 at 22:33

Circuit 1 will not work. This is because the feedback voltage will always be just the regulator reference voltage.

This is due to the action of the regulator itself: it actively tries to make FB = Vref to regulate the output. So the DAC sinking or sourcing current from FB is exactly balanced by Vout shifting up or down to cancel it.

Circuit 2 is fine, should work. Scale the divider as needed to fit within your ADCs common mode range.

That said, do you even need to measure the Vout? Read on.

Predicting Vout from Vdac

Voltage regulators that use external negative feedback (like all DCDC types and most linears, but notably not the LM317) behave much like op-amps. The (+) input comes from an internal voltage reference, while the (-) input comes from the FB pin.

So we can analyze the behavior using op-amp math.

We know that when the regulator is working (loop closed) it behaves like an op-amp - its inputs are the same voltage:

• $$\ Vref = FB \$$

So to understand the DAC influence we need to find the currents of each resistor feeding to the FB (-) input:

• $$\ I(R1) = \frac {Vout-Vref} {R1} = \frac {Vout} {R1} - \frac {Vref}{R1}\$$
• $$\ I(R2) = \frac {0V-Vref} {R2} = \frac {0V}{R2} - \frac {Vref}{R2}\$$
• $$\ I(R3) = \frac {Vdac-Vref} {R3} = \frac {Vdac}{R3} - \frac {Vref} {R3}\$$

We also know that based on Kirchhoff's Current law, the sum of all the currents to and from FB is zero:

• $$\ I(R1) + I(R2) + I(R3) = 0\$$

Substituting and solving for Vout:

• $$\ [\frac {Vout} {R1} - \frac {Vref} {R1}] + [\frac {0V} {R2} - \frac {Vref} {R2}] + [\frac {Vdac}{R3} - \frac {Vref}{R3}] = 0\$$

• $$\Vout = -[\frac {-Vref} {R1} + \frac {0V} {R2} - \frac {Vref} {R2} + \frac {Vdac} {R3} - \frac {Vref} {R3}] * R1\$$

Finally, changing signs and simplifying:

• $$\Vout = Vref [1 + \frac {R1} {R2} ] + (Vref-Vdac) \frac {R1} {R3}\$$

If you use a current DAC the math gets simpler. Example: DS4432 (datasheet here). This kind of DAC doesn't care about Vref or FB voltage, as it sinks or sources current. Very handy.

Depending on your ADC chip, it's output impedance might affect the voltage division that you are trying to achieve. In theory it might have an effect on the regulators voltage stabilization loop, depending on ADC type and specs. To keep things clean I'd have a separate voltage divider for the ADC, if there's no need to absolutely minimize component count or it would affect the power budget.

With circuit 1, depending on your regulator type you need to add the feedback voltage to the reading (somewhere around 1 volt). Some regulators might even have a constant voltage at the feedback pin, which would ruin the measurement completely, check the datasheet or put manufacturer part numbers in the question.