I'm creating a circuit which included a voltage divider. The divided voltage is connected to an ESP32 to read out the height of this voltage.

Currently I get wrong readouts: after some examination the cause of this problem is the voltage divider, not the readout itself.

By example: I connected a 24V DC adapter to my PCB. When I check with a multimeter the source of this voltage it tells me it is 24.3V. When I measure the voltage on the intersection of R1 and R2, it reads 2.2V. For R1 and R2 I use 20K and 2.2K resistors, therefore the correct readout should be 2.408V.

After connecting some batteries I have, I made the following table:

It appears the offset is not linear and depends on the height of the source voltage. What could be the problem?

I use the following resistors:

AECR0603F2K20K9 ±1% 100mW Thick Film Resistors 50V ±100ppm/℃ -55℃~+125℃ 2.2kΩ 0603 Chip Resistor - Surface Mount ROHS

AR03BTDX2002A ±0.1% 1/16W Thin Film Resistor 50V ±50ppm/℃ -55℃~+155℃ 20kΩ 0603 Chip Resistor - Surface Mount ROHS

This is the layout of my voltage divider:

Where to start to fix this problem?

  • 2
    \$\begingroup\$ have you tried without zener? \$\endgroup\$
    – asim
    Mar 13, 2022 at 15:59
  • \$\begingroup\$ Indeed this appears to be the cause of the wrong readouts I get. Thanks! \$\endgroup\$
    – Vincentvw
    Mar 13, 2022 at 16:17
  • \$\begingroup\$ At low voltages like this, an LED is a much better low voltage shunt diode than a zener, blue or white LEDs especially for around 3 V (once upon a time, only zeners were available, I don't know why low voltage ones are still used!) However, a reverse biassed diode to rail will be better than those for protection. \$\endgroup\$
    – Neil_UK
    Mar 13, 2022 at 18:30

2 Answers 2


You must be very careful when selecting a zener diode for an application like this, as its current will be really low. The specified zener voltage is usually in the order of a few mA (this specific diode is specified at 5 mA).

Check the following figure from the BZT52CxVyS datasheet:

Typical Zener Breakdown Characteristics

Now, the 3V6 model is not in this figure, but it will be somewhere between the 3V3 and 3V9, so its breakdown voltage will start somewhere between like 1.8 V and 2.8 V. This corresponds very well with your result, as the measured voltage starts differing significantly from what you are expecting somewhere between 1.6 and 2.4 V.

Thus, when increasing the voltage, the zener diode will start drawing current, which will lower the voltage from the voltage divider.

You should use a zener diode with a sharper knee, or with a higher rated voltage.

  • \$\begingroup\$ Thanks!!! I didn't know I had to consider this... I'm going to use a different diode. \$\endgroup\$
    – Vincentvw
    Mar 13, 2022 at 16:19
  • \$\begingroup\$ @Vincentvw - You should consider not using a zener at all. Instead, use a Schottky signal diode such an a 2n5711 connected from the input to Vcc. Reverse-biased, of course. Leakage will be much less than a zener. \$\endgroup\$ Mar 13, 2022 at 16:42

The zener diode is not an on-off device and is most likely the largest source of the problem.

The zener diode will start conducting long before the rated voltage of 3.6, as it will only have 3.6V over it when there is 5mA of current flowing through it. With less current, it will have less voltage, and with more current, it will have more voltage. Please find the curves in the part data sheet.

You should also check at what accuracy and linearity the ESP32 can even perform. There are various settings that may affect the readings to be more or less inaccurate.


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.