There will be 8 analog signals read by a microcontroller (STM32). I want to design a protection circuit for the analog inputs.
The input can be 0-10 V or 4-20 mA controlled by the MCU using an inverter based on an NPN transistor.
When the pin is high (v2 = 3.3 V and v3 = 0V) the input is 4-20 mA. The op_amp sees the voltage across R2//R3.
When the pin is low (v2 = 0 and v3 = 3.3 V) the input is 0-10 V the output voltage is reduced to 0-3 V with the voltage divider (R6, R8).
R1 is used to limit the input current.
R2//R3 instead of one resistor to reduce the power rating.
I searched for a solution and I found this Over voltage and reverse voltage protection of multiplexed ADC with voltage follower.
I tried to use Matthew's suggestion but in the simulation I get 12.5 V with overvoltage input and -0.5 V in the case of reverse voltage. The problem here is that my op-amp allows only VSS-0.2 V to VDD+0.2 V.
I am looking for an explanation to how the back-to-back diodes work and any suggestion to fix this, or any other solution to protect my circuit instead of using 32 diodes or 12 two diodes in series.