# Scaling battery voltage to 3.3V ADC input

I came across a circuit similar to that depicted below which scales a battery voltage which can range from 11-22Vdc to 0-3.3Vdc for a MCU ADC input. In the circuit I came across, the diode used is a ST Micro BAT30KFILM Schottky Diode. I am struggling to understand the circuit theory behind this. Ignoring the right hand side of this circuit you have a simple voltage divider between R1 and R2. In this example the voltage across R2 should be ~2.117Vdc; however when the right hand portion of the circuit is added, the voltage is actually higher, in this simulation it is 2.164Vdc. Could someone explain what is happening here? Why is the diode there?

simulate this circuit – Schematic created using CircuitLab

I would call it a rookie error. In theory if C1 was present before the ADC uC was turned on with sufficient current to exceed 5mA or 0.3V above the supply rail, CMOS latchup may occur. But CMOS ESD internal protection has 10k current limiting resistors cascaded with 2 diodes to each rail to prevent this, so the circuit offers no protection or correction, just an offset error.

simulate this circuit – Schematic created using CircuitLab

If you wanted full scale to 3.3V the R ratios are not appropriate.

Furthermore, it appears to an inaccurate 10:1 divider, ideally with 2.10 V / 22.0 Vin.

• I'll take a look at the documentation for the MCU...which by the way is a STM32F303CB. The voltage range the application can run on can exceed 22V and go up to 30ish volts. I don't intend to go beyond the 22.
– mike
Commented Oct 9, 2021 at 21:17
• So to reiterate, if I understand you correctly, of the MCU has the depicted internal circuitry, the external clamping diode is not necessary and just adds an offset error. Am I understanding you correctly?
– mike
Commented Oct 9, 2021 at 21:19
• Yes you got it. Tony from Richmond Hill..... you may wish to convert 22V to Vref if = 3.3V then 22/3.3 ratio, but it is also possible to change ratio and offset to convert 11:22 to 0 : 3.3 with a Vref for offset to the reference input of an Op Amp. Then the ratio is (Vmax-Vmin=11) so 11:3.3 and the offset is Vmin/3.3= 3.333V Commented Oct 9, 2021 at 22:59

Look at the specs for the Schottky diode - it can leak up to 1 mA at room temperature. This leakage current pulls up the resistor divider.

Your Schottky may leak less, but why is it there ?

• That's my question...why is it there? I ran this circuit in Multisim and Vout varies based on the selected diode. My only guess is that it clamps the maximum voltage to the ADC input to 3.3V... but I am seeking expert opinion on this.
– mike
Commented Oct 9, 2021 at 18:37
• Yes, it will clamp the max. voltage. Is that necessary ? Can the input exceed about 30 V ? Even if it does, the ADC itself likely has an internal diode to VDD which will clamp also. Commented Oct 9, 2021 at 18:44
• There was no explanation for the design choice. I am just trying to interpret something someone else did. This is a battery driven application, and it is possible that someone could use a battery larger than intended. This could have been placed there to prevent layer 8 issues.
– mike
Commented Oct 9, 2021 at 18:49
• The Schottky is there to protect the ADC input from over-voltage damage. Commented Oct 9, 2021 at 19:12
• If "why is the diode there" part of your question, please edit your question to clarify that point. Commented Oct 9, 2021 at 19:40