how to protect analog inputs ?

Thread Starter

ag-123

Joined Apr 28, 2017
276
I've seen the discussion in an old question here
https://community.st.com/s/question/0D50X00009XkbAd/how-to-protect-analog-inputs-
Accordingly, STM32 ADC inputs are not 5v tolerant in ADC mode.

I started studying some Zener diodes, in particular 1n4727 Vz 3v
https://www.epitran.it/ebayDrive/datasheet/Zener_1N47xx.pdf

What I noticed in the graphs is that instead of what we commonly assumed of a reverse Zener voltage
https://en.wikipedia.org/wiki/Zener_diode
It looks instead like a conventional forward biased diode curve
https://en.wikipedia.org/wiki/Shockley_diode_equation
with a turn on voltage around 1.5v

This is quite curious and interesting as it implies that if I use this diode as a shunt or voltage limiter to GND, below 1.5v I get a 'linear' response as the diode don't conduct. Above 1.5v, it becomes a non-linear 'square root' style response. If I'm willing to make do with the fuss about that 'non-linear-ness', it would seem I can achieve much higher 'Vin' ?

Such diodes apparently can be found on those 'eBay/AliExpress' type sites
https://www.aliexpress.com/wholesale?catId=0&SearchText=1n4727

edit:
another question though
I can't seem to find a 'Shockley' equation to represent the zener breakdown region.
Any hints about an equation representing that part? i.e. the reverse zener breakdown region.
most cases seem to assume 'vertically down', but this 'weird' case doesn't seem to fit anywhere
 
Last edited:

Deleted member 115935

Joined Dec 31, 1969
0
it all depends on the input speed you want
the standard Zener have very high capacitance,
which is generally terrible with an analog input where your trying to minimise capacitance.

Have read up here

https://www.analog.com/en/technical...bad-how-to-protect-your-analog-front-end.html

Note , this for protection, i.e. for unexpected voltages,
if you are expecting a voltage outside the range of the chip, then design a voltage divider
 

Papabravo

Joined Feb 24, 2006
21,225
Using diodes on analog inputs also adds considerable capacitance to the input point. IMHO, a better solution is to use a chicklet (cheap operational amplifier) to buffer the external environment and limit the output, with a gain of less than 1 for example, in such a way as to "protect" the A/D input from those external disturbances. You have an extremely wide array of packages and specifications for this purpose.

One more thing: I would be EXTREMELY reluctant to trust parts from EBAY, or aliexpress unless you want to spend your time doing "incoming inspection" on every part that you buy. Who has time for that?
 

Thread Starter

ag-123

Joined Apr 28, 2017
276
I've thought about op amps and simple resistor dividers. The benefit is these are linear, but I'd sacrifice some of that 'dynamic range'. e.g. If I used a resistor divider to limit the 'expected' peak voltage say at 2v, I'd get only 2/3s of the usable range of the ADC and hence less precision than if the full 3v range is accessible. Other ways I may consider could be to add schottky diodes, to simply bypass some of that higher voltages. I'm not too sure how much protection that'd add, but it seem that is the 'conventional' way to do so.

Edit:
found something, it seemed the Zener reverse breakdown region is governed by something different - tunnelling, and more complicated than that Shockley equation
https://en.wikipedia.org/wiki/Landau–Zener_formula
 
Last edited:

crutschow

Joined Mar 14, 2008
34,408
You can use a series input resistor with two small Schottky diodes, one between the V+ supply (cathode) and the input, and one between the ground (anode) and the input.
That will prevent the input from going more that about 0.4V above the supply voltage or below ground.
 

Papabravo

Joined Feb 24, 2006
21,225
You can use a series input resistor with two small Schottky diodes, one between the V+ supply (cathode) and the input, and one between the ground (anode) and the input.
That will prevent the input from going more that about 0.4V above the supply voltage or below ground.
Given the capacitance of the two Schottky Diodes in parallel, what would you estimate for an upper frequency limit on the input signal?
 

Thread Starter

ag-123

Joined Apr 28, 2017
276
Oh well, just to give a little more input on the application, the MCU is feeding in from a current sense amplifier
https://www.ti.com/product/INA199
This has 50x as amplification and I choose a shunt resistor that gives about 2 amp full range, the danger is if it goes above 2 amps, quite likely it'd go above the rated Vin for the ADC and that port is not 5v tolerant, so it'd fry the MCU at the ADC I'd suppose. Hence, I looked at Zener 'clamping', but these findings is quite a surprise, as the reverse voltage doesn't look like a 'conventional' straight down, but some sort of 'power curve' (e.g. x^2), at least at the 'knee' region.
Below 1.5V it is a 'straight line' the diode doesn't conduct. Above that is where it gets funky. I'm thinking if i 'limit' the currents, say place a 1k ohm in front of that, would that 'small breakdown' part look like the Shockley equation or such. If it does, I can fit the values there to determine the parameters / coefficients, and I've a 'linear' + 'non-linear' ADC and I can go above the linear 'dynamic' range
 
Last edited:

Deleted member 115935

Joined Dec 31, 1969
0
Put an op amp in front, with a Vcc of the MCU, and gain of one,
then input to MCU can never be outside its limits.

Put one of the ESD diodes from Vcc to ground as mentioned a few times above, do NOT use a zener

select an amplifier and ESD diode depending upon the frequency of the input you want.
Where is the Nyquest filter situated ?
 

Ian0

Joined Aug 7, 2020
9,803
the danger is if it goes above 2 amp, quite likely it'd go above the rated Vin for the adc and that port is not 5v tolerant, so it'd fry the mcu at the adc i'd suppose
Not if you run the INA199 from the same supply rails as the micro!
Generally the inputs to that type of shunt amplifier are quite robust, but what they don't like is if their board loses its 0V connection, and it ends up being powered via the INA199 inputs. That kills them, but if you put a diode between V- and the inputs they are reasonably protected.
If your shunt has a resistance of <1mΩ, who gives a damn about capacitance? The -3dB point is above 100kHz for any capacitor less than 1500μF

When it comes to protecting ordinary analogue inputs I use this circuit:
Untitled 1.pngThe zener is a similar voltage to the MCU voltage - use a 3W rated device, and V1 is a convenient higher voltage, and R1 is large, just passing enough current to keep the zener biassed. Use the zener instead of just connecting the diodes to the positive supply just in cases a large voltage gets connected and it overwhelms the regulator on the supply.
The zener keeps the four diodes reverse biassed, and every diode is a varactor, so that minimises its capacitance.
The four diodes can be a small bridge rectifier. The higher voltage ones tend to have less capacitance. That type of diode can stand 10x its rated current for at least 20ms.

For really serious protection against overvoltage (e.g. when used by DJs who also make their own leads) R2 and R3 can be mains-rated PTC thermistors
https://uk.farnell.com/vishay/ptccl05h390hbe/thermistor-ptc-260r-20-radial/dp/1187080
They add some resistance, and hence some noise, but we might not be operating in the lowest background noise environment, and some types might even be a bit piezoelectric.
A microphone input protected this way will withstand connection directly to 230V mains.
 

crutschow

Joined Mar 14, 2008
34,408
Given the capacitance of the two Schottky Diodes in parallel, what would you estimate for an upper frequency limit on the input signal?
The BAT54 Schottky, as an example, has 10pF max capacitance at 1V reverse bias so, with a 10kΩ series resistor, that would give a RC risetime of 200ns for a -3dB rolloff of about 800kHz.
That's my estimate.
 
Last edited:

Papabravo

Joined Feb 24, 2006
21,225
The BAT54 Schottky, as an example, has 10pF max capacitance at 1V reverse bias so, with a 10kΩ series resistor, that would give a RC risetime of 200ns or for a -3dB rolloff of about 800kHz.
That's my estimate.
That's actually not too bad for garden variety work.
 
Top