I have this setup:
The problem with this setup is that when there is a 3.2 V voltage drop acriss the 160 Ω (vertical) resistor, then there's NOT a 3.2 V voltage drop across the Zener diode, in reality.
In reality, there is about 2.8 V or something like that. If I increase the 160 Ω (horizontal) resistor to e.g 10 kΩ, then the voltage drop across the Zener diode will be very low, like 1.5 V or so.
So that's the reason why I keep having a low value resistor before the Zener diode, but not too low because the resistor is protecting the Zener diode. Also there is a PTC resistor after the potentiometer in my real schematic.
I want to measure this voltage drop across the Zener diode. I have a 16-bit STM32 ADC (analog input channel) connected to the cathode of the Zener diode. When I measure the voltage, it looks like this:
The black line is the real measurement. The red line is the desired measurement.
I can write an equation for the orange line below using the sloped line equation:
$$y = mx + b$$
Question:
Is there any formula for the part where the measurement is bending? My goal is to find a correction formula that can correct its measurement. If I get, for example, 2.8 V, then the STM32 microcontroller should say it is actually 3.3 V. Like a look-up-table, but more like an equation, a formula.
This bending is caused by leakage current of the Zener diode. I need to find a formula for that, so I can curve-fit measurement data onto that formula and find its parameters.