Circuit for protecting the analog input pin of an MCU from overvoltage - Page 1
Forum section: electronics / beginners

author: abhishekkumar1902
author_rank: Regular Contributor
timestamp: June 13, 2017, 05:33:31 pm
content: I wanted to interface the analog input of a microcontroller to a potential divider based voltage sensing circuit How can I design the interface circuitry so that the analog input pin of the microcontroller does not go above the rated max voltage (Eg: 5v)?Will there be some signal loss due to leakage issues if I just tie a 5v/5.2v zener diode from the analog pin to the ground? Any better circuit?

author: capt bullshot
author_rank: Super Contributor
timestamp: June 13, 2017, 06:27:16 pm
content: The usual way to do this would be two diodes from the signal pin to the converters VCC and GND.Leakage depends on the diode type, will be large if you use schottky diodes, low with normal silicon diodes and extra low with the B-C junction of a 2N3904 type transistor or a JFET used as a diode. Most common are 1N4148 type silicon diodes here.This limits the voltage to one diode drop above VCC and below GND, that is OK for most ADC inputs, but not in general because there will be still current flowing into the ADC pin (through its protection network to VCC or GND). Often the datasheet allows a maximum of 0.3V below GND / above VCC, if you exceed this, the ADC won't die instantly, but current starts flowing into the pin. You'll have to limit this current to less than 10mA (this is a quite common value here) to prevent the input pin from beeing damaged. 10mA flowing into a pin most probably will leak into other pins, disturbing other ADC inputs, usually not a big issue with digital inputs.The next better but still simple solution would be to use the diodes, but place a resistor between the ADC input and the diodes, this limits the current into the ADC - the resistor value needed depends on the ADC specs, often it isn't specified how much current into its protection diodes is allowed without disturbing other ADC inputs. In many cases you'll be on the safe side if you limit the current into the ADC pin to 0.5 ... 1mA, sometimes 5mA are still OK. Other ADC may insist on no current flowing, then you'll need another approach.

author: max_torque
author_rank: Super Contributor
timestamp: June 13, 2017, 09:15:09 pm
content: The million dollar question is "how fast are your ADC channels being sampled" because this makes a BIG difference to how you do the protection. if it's only slowly (say <10KHz or around those sorts of frequencies) then a simple resistive current limitation will work. Above that, any resistance in the input is likely to attenuate the high frequency content of the signal excessively and you'll have to look so a suitable op-amp buffer or similar solution.

author: MosherIV
author_rank: Super Contributor
timestamp: June 13, 2017, 09:57:35 pm
content: HiI am not dissagreeing with the other posts. I would like to say that the diode solution is a cost effective solution. As a hobbiest, you may not need to worry about components costs as much.I would suggest bufferiing the ADC input with an op-amp. Let the op-amp input take the abuse and possibly be damaged. It is easier to replace the op-amp than it is the ADC. This is not cost effective for commercial designs but hobby electronics can afford the odd op-amp. You should be able to apply the diode protection to the op-amp inputs.The op-amp inputs can also provide better input impedance than a voltage divider.The op-amp gain can also be below 1 (for inverting) so you can use fractional gain instead of using a voltage divider.If the op-amp runs off the same power rails as the ADC then it should be impossible to over volt the ADC from the op-amp

author: shteii01
author_rank: Frequent Contributor
timestamp: June 13, 2017, 11:22:30 pm
content: Quote from: MosherIV on June 13, 2017, 09:57:35 pm^ what they said.When you setup the op amp as buffer, you, the designer, choose the voltage to power the op amp. Op amp can not exceed voltage that powers it. So right then and there is the hard limit for the signal you trying to digitize.

author: abhishekkumar1902
author_rank: Regular Contributor
timestamp: June 14, 2017, 06:51:18 am
content: But how about if I want it for a professional design. How do multimeters achieve this protection at the inputs?

author: MosherIV
author_rank: Super Contributor
timestamp: June 14, 2017, 07:01:27 am
content: QuoteDave has done a very good vlog about multimeters and input protection, better to let him explain it in deatil.In short : current limiting resistor, fuses, spark gaps or MOVs, transistor in similar arrangement as diode clamping mentioned above and finally huge resistor divider networks.I do not think commercial designs normally use that much proection for ADC inputs.