1
\$\begingroup\$

working on a project with STM32F103 and need to measure couple of external voltages. I have a simple voltage divider setup like the attached circuit, but the output of the divider is surprisingly different that I can calculate..

I calculate the output at around 2.9 V, but on PCB this gives me only 1.9 V. Any idea, what can cause this? I have tried measuring the output of the divider by disconnecting the trace that connects to MCU, but the same result.

The resistance values are correct (measured with multi meter). What else should I look at to debug it?

The Zener datasheet is here https://evelta.com/content/datasheets/273-MM1Z3V3B.pdf

enter image description here

============ UPDATE =============

After further debugging, I see that the Zener is dropping the voltage. Zener reverse current? But datasheet says only 20 µA.

\$\endgroup\$

5 Answers 5

5
\$\begingroup\$

Zener diodes below 5 volts have soft knees as shown in the SPICE simulation shown below. The SPICE library is from ROHM's BZX84C3V3LY 3.3V zener diode.

The X-axis is the current flowing through zener diode U1, Y-axis is the voltage across the zener. The upper circuit is with your values. The current through the zener is about 65 uA which gives about 1.85 V across R1 and the zener diode.

The characteristics of the zener diode used in your circuit will be slightly different, however, this demonstrates the soft knee one would expect from a low voltage zener.

zener diode I-V curve

I'm guessing that you are trying to protect an input circuit from voltage spikes. If you don't need wide bandwidth, you can use a largish capacitor across R38 in your schematic (perhaps 1 uF). Another technique is using a biased diode as shown below. You may want to use Schottky diodes and tie D2 to the power supply of the input circuit.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
2
  • \$\begingroup\$ I don't have a 2.7V reference in the circuit and If I connect D2 to 3.3V rail, then it will clamp to (3.3+ Forward Voltage of D2) Volt. Is not it? \$\endgroup\$ Commented Nov 11 at 10:08
  • \$\begingroup\$ @RakeshMehta Correct. If you use a Schottky diode, the current will flow through the Schottky diode, and not the protection diode on the input (many devices have protection diodes, check the data sheet). The 68k resistor will most likely limit the current by its self to a safe level for an over voltage event on the input of your device. Again, check the data sheet and know what the expected over voltage event looks like. \$\endgroup\$
    – qrk
    Commented Nov 11 at 18:29
4
\$\begingroup\$

Low voltage Zeners are horrible devices. See this answer of mine from a few years ago, and the graph of device I/V curves for various types of diode.

enter image description here

If you want to protect the input from over-voltage, then the usual configuration is a standard silicon diode to the positive rail. This has the disadvantage of limiting the voltage to a little above the rail. A series resistor between diode and device will limit any current flowing into the device.

If you really must have clamping at or below the rail, then take the diode to a voltage you generate a little below the rail, rather than rail.

Note from my graph that LEDs have a much lower leakage current at low voltages than zeners, but you won't quite meet the 2.9 V threshold even with a blue or white LED.

Here is a modification using only one extra resistor. It allows you to use a higher voltage, and thus lower leakage, zener diode.

schematic

simulate this circuit – Schematic created using CircuitLab

I don't have any measurement for what the leakage current of a 5/6/7 V zener is, but it should be better, and it's easy to make the measurement.

\$\endgroup\$
2
  • \$\begingroup\$ Really clever solution.. I made some changes to the resistor values to scale 0 - 12V to 0 - 3.3V (approx). The new values are R1=68K, R2=18K, R3=33K. Which gives me the desired output. But the impedance is getting high. Equivalent Thevenin is really high.. MCU suggest max 50K impedance for ADC. Lower the impedance, faster to sample. \$\endgroup\$ Commented Nov 5 at 15:19
  • \$\begingroup\$ The thevenin equivalent of (R1=68K, R2=18K, R3=33K) is 23k, which is below your impedance limit. If you want even lower, you can add an external capacitor, which will limit your bandwidth \$\endgroup\$
    – BeB00
    Commented Nov 5 at 15:31
1
\$\begingroup\$

You should also take the maximum allowed external impedance into account (apart from the issues coming from the Zener diode.)

Using lower resistor values (let's say 6.8 kΩ and 2.2 kΩ) would instantly improve your ADC reading. However, if you aim to maintain a very low current through the voltage divider, you might want to use a voltage follower.

From the Datasheet, chapter 5.3.18 - 12-bit ADC characteristics.

Equation

Example:
Table

\$\endgroup\$
1
  • \$\begingroup\$ Going to change it to Upper => 68K, Lower => 5.6 K, Thevenin equivalent is calculating to 5.1K, which is quite good. \$\endgroup\$ Commented Nov 5 at 8:24
1
\$\begingroup\$

1μA through 1MΩ drops 1V.

Source impedance of your divider is about 20kΩ.

20E3 * 20E-6 = 0.4V

That’s not too far from the deviation you measure.

Given the relatively high impedance of the divider, there is not much need to “protect” the MCU. It would take much beyond 12V to cause any trouble. The MCU already has input protection diodes that go to 3.3V and 0V. You can put 1mA through those diodes without much harm unless the datasheet says otherwise.

\$\endgroup\$
1
\$\begingroup\$

An enabled pull-down resistors can also result in this behaviour, here a quick schematic:

voltage sense

Assuming in the following that you left RPD enabled by accident. This parallel resistive connection to R38 would decrease the lower half of the voltage divider. Let's look in the datasheet for RPD:

screenshot from datasheet

It gives a value of 40k +-10k, so let's assume 40k and calculate the combined resistance of R38 and RPD:

R38 || RPD = 22k || 40k = ~14k2

Now let's calculate the voltage of your voltage divider:

(14k2/82k2) * 12V = ~2,07 Volt

That is nearly what your voltmeter is showing, now take in account the leakage through the diode as mentioned by the other answers and the great tolerances of the internal resistors and it is plausible that you left the pull-down resistor on.

\$\endgroup\$
1
  • \$\begingroup\$ I have checked that.. the ADC pins don't have PULL UP or DOWN enabled. Actually I use mxcube to code and their Interface won't let me enable pull up or down for ADC pins. It was definitely the zener, as removing it gives me expected 2.9V. Thank you. \$\endgroup\$ Commented Nov 5 at 11:25

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.