Electronic – How to protect microcontroler analogue 0-5V input pins from high/negative voltage

microcontrollervoltage

Just a little background info, I'm designing a small standalone battery powered unit to be developed that will allow the output of a sensor to be displayed on an LCD screen and that the input to the unit will have a 0-5V range from the sensors.

My question is how could I protect the analogue input pins of my microcontroller from high/negative voltages while also being able to display values from sensors that do not have this output range?

EDIT: I am designing this device for others to use and will not know what kind of sensor they would be using, all I'm told is to expect a range of 0-5V and include protection from anything else.

Best Answer

Use clamping diodes to limit the input signal voltage. You can either connect external clamping diodes from input to the +5V line and ground, or use internal clamping diodes that are already built into your microcontroller. Make sure to use Schottky diodes, not regular ones.

How does it work: when Vin is higher than Val+, the top limit diode starts conducting, clamping the Vin to Val+ + 0.3V. When Vin is lower than Val-, the lower diode clamps. Current flowing through the diode is limited by the input resistor. 0.3V is the forward drop voltage of Schottky diode.

enter image description here

If you decide to use internal diodes, make sure the current through them would not exceed 1mA. This is achieved by increasing the input resistor to about 10㏀, which could degrade you ADC performance, so it would be a good idea to use external clamping diodes that could handle 200mA, and lower resistor value (200Ω to 1㏀).

Related Topic