I'm designing a precision voltage reference for an ADC.

The aim is to sample a 230 Vrms AC signal using the STM32F411 built-in ADC. An opamp-based differential amplifier is used to convert a 325 V peak-to-peak waveform to a 1.5 V peak-to-peak waveform. A positive bias of 1.66 V needs to be provided to the differential amplifier, since I don't want to incorporate a negative supply just for the ADC.

To generate a 1.66 V reference, I'm using the following circuit.

TL431 based 1.6V reference generator

I would like to know if that following circuit is reliable enough to use as a voltage sensing element for a high-voltage inverter system?

(I could've used a TLV431 instead of a TL431. But availability and cost of TLV431 constrain me to stay with the TL431.)


2 Answers 2


The ADC is only as accurate as its reference voltage, which you can supply on the AREF pin. According to the datasheet, it should be between 1.8V and VDDA which is usually 3.3V.

So, first things first, you need a reference for your ADC. You can use any suitable reference chip to make a 3V3 reference, but that requires a supply voltage a bit higher than 3V3. Otherwise, if your reference chip is supplied from 3V3, you'll have to use a lower voltage, like 3V or 2V5. It is possible to use a TL431 for this purpose, or any other chip, if they meet your accuracy requirements.

Note the PSRR of TL431 depends on the resistor used to supply it with current. Since TL431 output impedance is about 0.1 ohm, with a 1k resistor, it will have a PSRR close to the ratio of the two impedances (1k/0.1, or 10000, or 80dB which is pretty nice. TL431 has wide bandwidth so it doesn't suck too much at HF rejection like some of the micropower references do, and you can always use a bypass cap (read fineprint in datasheet about stability, ESR, etc).

If you want a lower noise TL431, I recommend drop in replacement SPX2431.

After you have your ADC reference you can divide it in half with a resistor divider, to get the center voltage for your amplifier. If you already use an opamp, the other one in the package can be used to buffer this half reference voltage.

Variable current should never be drawn from a reference as this will change the voltage ; however the usual substractor opamp circuit draws constant and negligible current from the voltage divider on the "+" input of the opamp. In this case, no need for a buffer, unless you also want to filter the reference with a very low cutoff RC filter to reduce its 1/f noise.

Using the same reference for the ADC and the center voltage means it will always end up on the same sample value (plus noise) no matter what the reference drift is, which can be useful. It is of course dependent on precision/drift of resistors and offset voltage of the opamp, but it's only a 12 bit ADC so it doesn't require super low offset opamp... and you're measuring AC, so you will get rid of any DC offset using digital filtering anyway.

If you use a filter on your reference, both AREF and the voltage divider feeding the "+" input of the substractor opamp should get the same filtered voltage as input: the divided voltage will track the low frequency noise of the reference, so it kinda cancels out (reference noise still modulates the signal, but does not add to it in this case).

  • \$\begingroup\$ Thanks for the clear answer. I'm planning to follow the method you mentioned above without any significant filter(just few small capacitors at input). Will update the results. \$\endgroup\$ Commented Jan 21, 2023 at 16:47

The baseline voltage is not critical as long as it doesn’t drift so far that the input signal is clipped. After all, you’ll be removing the DC offset to measure the RMS AC value (for example). What you need to focus on then is the ADC voltage reference, since you want accurate results in absolute terms - it’s not a ratiometric measurement.

But you can also invert the problem a bit: instead of providing an accurate ADC reference, provide an accurate baseline and use it to calibrate the ADC. Say the baseline is precisely set at 1.5V and the ADC has no zero offset. The time average of the signal, in counts (LSBs), represents 1.5V absolute. So you now know the scaling factor and can convert the ADC readings to absolute volts. Then multiply by the inverse of the attenuation of the scaling resistor network and you got the absolute volts on the high voltage side.

This second method requires that the ADC reference voltage changes only slowly relative to the input frequency, so you’d want to use the ADC’s built-in reference if there’s one, or a dedicated cheap 3.3V regulator just to feed the reference input so it doesn’t change much as the load on the general 3.3V supply changes.

Do note that typical “three op-amp” instrumentation amplifiers require low impedance on the reference input - it directly affects and degrades CMRR when the impedance is sufficiently “non-zero” - relative to the CMRR the amp is capable of if the reference were zero.

You could also use a temperature stabilized and buffered Zener as a reference if you got a bit of power to spare and are willing to run a calibration cycle during manufacturing. A low cost low drift op amp could buffer it. To stabilize the Zener, put it on a thermally isolated section of the PCB (milled slots), and heat up a couple resistors there to warm it up. Any temperature sensor will do to provide temperature feedback, and the MCU can regulate it. This may end up being more expensive than a voltage reference, but is a funky thing to do in “old-school” circuits (think early 70s).

I had a design in the early 90s where I used the 32kHz realtime clock chip’s crystal frequency as a temperature sensor, referenced to the high frequency TCXO providing the CPU clock. This thermally stabilized both the Zener reference and the RTC when the mains power was on. The CPU ran an NMI service routine, triggered periodically by the RTC chip, to run the temperature control PID loop. It worked well enough for the application this was used in (data acquisition). Thermally non-compensated crystal resonators are excellent temperature sensors, especially considering their relatively low cost and stock abundance. That’s an aside though.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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