# Input circuit for MCP3004

I am designing an ADC board for Raspberry Pi using the MCP3004 ADC chip. Please see my circuit below.

This circuit is intended to measure voltages form 0 to 10V, to have overvoltage protection (Vin<=24V), and reverse polarity protection.

According to datasheet BAT54 diode has a voltage drop of 240mV @ If 100uA. When 10V will be applied (Vin) the voltage divider will scale it to ~3V. At this time D2 is blocked (except for leakage current). As Vin will rise D2 will open and the input of op amp will stay close to 3.2V. To supply power to D2, a small 3V LDO will be used. When polarity will be reversed, the non-inverting input will see around -240mV, which is more than Vss-0.3V that is specified in LM358 datasheet, so it should be fine.

Everything went fine in simulation, but will this work in real life? When the polarity will be reversed, will the output of op-amp be stable close to 0V?

I read that op-amps are not happy with capacitive load. MCP3004 is a SAR ADC so it can be approximate as an capacitive load (20pF). For that reason Rx Cx are recommended to be used. My question is: Are they really needed? If yes, based on your experience/knowledge, what will be the optimum values?

• The LM358N reads Large Output Voltage Swing, which means you should carefully inspect the datasheet. 0v may not not produce exactly 0v out, as $V_{OL}$ states a max of 20mV error. This is quite small for an op-amp so is very good. $V_{OH}$ (high output voltage) is another thing however, stated as 26v from a 30v supply, so -4v. Behavior is not given at a supply of 5v. I'd try it at 5v and see if it does what it should, otherwise expect to power it from a higher voltage such as +12v to ensure reliable operation. – rdtsc Sep 17 '19 at 21:16