Hello everyone!
I need your help in designing the input circuitry before the ADC of the MCU. The design should meet the following requirements:
1. the allowed input voltage should be between 0 and 25 volts
2. the output voltage should be between 0 and 5 volts
3. it should be as linear as possible
4. it should protect the MCU ADC for unexpected failure (input should not get to ADC pin by any means; In my design I was using an op amp buffer)
5. it should have a reverse polarity protection (it's a must)
6. it should have an over voltage protection(it's a must). If by mistake the operator of the device inputs 30v instead of 25 maximum the circuitry should survive without issue. A value above 25V will be read as 5 volts. Also if the erroneous voltage disappear from the input, the circuit should recover by itself.
7. it should use as few components as possible
8. it should not use dedicated ICs (maybe already exists)
9. it should have a compensatory adjustment in case some components don't exactly match the specifications (plus or minus 20%) (it's a must)
10. the supply voltage for the circuit will be 5V max.
I have come with the following schematic. Please analyze it and let me know if there is anything wrong with it (except the high power consumption on the input which I already know.)
P.S. Please note that the op amp used is actually MCP6022 (but that part does not exist in my simulation tool.)