Author Topic: Circuit for protecting the analog input pin of an MCU from overvoltage  (Read 2969 times)

0 Members and 1 Guest are viewing this topic.

Offline abhishekkumar1902Topic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: in
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?
« Last Edit: June 13, 2017, 05:41:52 pm by abhishekkumar1902 »
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
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.
Safety devices hinder evolution
 
The following users thanked this post: abhishekkumar1902, MK14

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1272
  • Country: gb
    • bitdynamics
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.
 
The following users thanked this post: abhishekkumar1902, JPortici

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Hi
I 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
« Last Edit: June 13, 2017, 09:59:35 pm by MosherIV »
 
The following users thanked this post: abhishekkumar1902

Offline shteii01

  • Frequent Contributor
  • **
  • Posts: 266
  • Country: us
Hi
I 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
^ 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.
 

Offline abhishekkumar1902Topic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: in
But how about if I want it for a professional design. How do multimeters achieve this protection at the inputs?
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Quote
How do multimeters achieve this protection at the inputs?
Dave 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.
 
The following users thanked this post: abhishekkumar1902


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf