I have one design requirement where I have to acquire an Analog signal and read the same via a micro-controller.
I am using a normal resistor based voltage divider with values of 47K & 10K followed by a R-C Low Pass Filter.
It works fine but as the micro-controller can withstand a maximum of 4V at its input (Using a STM32 uC), I need to protect the pin in case the input to the divider is above 23V.
I connected a series resistor and 4V zener diode circuit at the output of the resistor divider to do so but it affects the linearity of the circuit.
For example, if input to uC is Vout and input to resistor divider is Vin then for case when resistor + zener circuit is not connected, the ratio (Vin/Vout) for entire range of Vin remains constant. So ideally Vin can be calculated with the formula of Vin = 5.7*Vout
However, when zener is connected, the ratio doesn't remain constant and keeps fluctuating throughout the range of Vin and thus Vout data cannot be used to calculate Vin accurately.
I need to protect the pin from continuous over-voltage and transient spikes.
Can anyone suggest what should I do exactly to achieve required protection and linearity in circuit performance?