Input protection

Having had customer send near 15 volts through the input pins of the device, I was on the search for proper input pin protection for such scenarios.

i started off with this circuit (multisim file attached)

and ended up with the SP721 used alongside it.

the Sp721 is good for protection of spikes, and even negative polarity (i think…)

But I’m not sure if it would protect against a 5V input on a pin while the device itself is off.

Thoughts?

input protection.PNG

Using just a TVS is a brute force method and will not make the inputs safe for steady state overvoltages that comes from a power supply with.... say a 5A capability.

The key is to use the low current required by the Arduino inputs to your advantage.

As they say there is more than one way to skin a cat....

My suggestion is below. It will withstand 15V input for an unlimited time, as well as input spikes and reverse voltage. The resistor values are not critical and the Zener doesn't have to be a TVS, it can be just a regular zener diode.

yes, i had been using something very similar, but my problem was with the knee of the Zener diode.

Not clear , but if this is digital input an opto isolator is a simple and reliable option or even a relay .

JohnRob:
Using just a TVS is a brute force method and will not make the inputs safe for steady state overvoltages that comes from a power supply with.... say a 5A capability.

The key is to use the low current required by the Arduino inputs to your advantage.

As they say there is more than one way to skin a cat....

My suggestion is below. It will withstand 15V input for an unlimited time, as well as input spikes and reverse voltage. The resistor values are not critical and the Zener doesn't have to be a TVS, it can be just a regular zener diode.

The standard clamp circuit is series resistor into schottky diodes that bolster/take over from the
internal diodes. This will protect whether or not the Arduino is powered, the zener circuit
cannot protect at all if powered down and doesn't protect against undervoltage either.

The circuit here is an example, just ignore the "zener or schottky" labels, definitely only schottky diodes
work.

The circuit here is an example, just ignore the "zener or schottky" labels, definitely only schottky diodes

I respectfully disagree with the deletion of the of the bottom zener. I agree the top diode might be needed for some application.

In the OP's case, the application of 15V to the circuit you suggest could easily overvoltage the board (depending on other loads on the 3.3V rail).

In my proposal, the series resistor to the board will deal with voltage applied to the input when the board is not powered.

All our automotive designs were required to be capable of 18V on any pin for an unlimited period of time. We found the zener works best.

JohnRob:
I respectfully disagree with the deletion of the of the bottom zener. I agree the top diode might be needed for some application.

In the OP's case, the application of 15V to the circuit you suggest could easily overvoltage the board (depending on other loads on the 3.3V rail).

In my proposal, the series resistor to the board will deal with voltage applied to the input when the board is not powered.

All our automotive designs were required to be capable of 18V on any pin for an unlimited period of time. We found the zener works best.

Thanks for your participation,JohnRob

You mentioned your design will protect even if the MCU is off? Can you elaborate how? IF 2.5V is applied wouldn't it still run into the MCU?

I know the resistor can limit current, is it that the current protection alone and not necessarily a voltage protection would be sufficient? Or is it that the current would be limited enough so the internal diodes won't be over burdened?

With that resistor can it accurately read a 0-5V input?

MarkT:
The standard clamp circuit is series resistor into schottky diodes that bolster/take over from the
internal diodes. This will protect whether or not the Arduino is powered, the zener circuit
cannot protect at all if powered down and doesn't protect against undervoltage either.

The circuit here is an example, just ignore the "zener or schottky" labels, definitely only schottky diodes
work.
adc - How to make clamping circuit to clamp exactly at 3.3 volts - Electrical Engineering Stack Exchange

Hey MarkT, thanks for dropping in.

So the extra schottky diodes would take over from the weaker internal ones. If the devices is powered off the 5V VDD rail would be 0V, and the current would flow through the zener towards the VDD.

I have one problem, wouldn't it be better to put the resistor AFTER the diodes assuming current would take path of least resistance

hammy:
Not clear , but if this is digital input an opto isolator is a simple and reliable option or even a relay .

When the Z-diode starts to clamp, say a 4.90V may read as only 4.85 volts, depending on the knee curve of the Z diode.

Schottky diodes are right at the pin, resistor between pin and input. So current from the input gets limited by that resistor, and then any over (or under) voltage is syphoned off by the Schottky diodes.

That 5.2V zener in #1 is simply redundant and serves no function, the 0.1µF cap is also better removed as it slows the reaction of the pin (with a 5k cap the reaction time is down to about 0.5 ms) which may be an issue for fast changing signals.

If higher voltage spikes are possible (>100V) an optocoupler may be the proper solution.

donperry:
When the Z-diode starts to clamp, say a 4.90V may read as only 4.85 volts, depending on the knee curve of the Z diode.

Irrelevant for a digital input. Anything over 2.7V or so (have to check data sheet for the exact number) reads as HIGH.

wvmarle:
Irrelevant for a digital input. Anything over 2.7V or so (have to check data sheet for the exact number) reads as HIGH.

Yeah, this thread is about analog input.

wvmarle:
Schottky diodes are right at the pin, resistor between pin and input. So current from the input gets limited by that resistor, and then any over (or under) voltage is syphoned off by the Schottky diodes.

That 5.2V zener in #1 is simply redundant and serves no function, the 0.1µF cap is also better removed as it slows the reaction of the pin (with a 5k cap the reaction time is down to about 0.5 ms) which may be an issue for fast changing signals.

If higher voltage spikes are possible (>100V) an optocoupler may be the proper solution.

OK. I understand.

Image referenced to in #3:

That's the proper clamping circuit, and it will not affect an ADC reading.
No zener indeed, that should be Schottky diodes.
The 470Ω resistor may be larger - up to about 10k - and the reading of the ADC is still not affected. Reaction time is also not slowed down.
The 3.3V is the Vcc of the controller, so this circuit will ALSO protect when it's not powered up and Vcc is at ground potential. The zener solution does NOT protect when not powered up as the pin can still be lifted to 5.2V over Vcc in that situation, which is damaging.

donperry:
Yeah, this thread is about analog input.

Only now you mention this...

You mentioned your design will protect even if the MCU is off? Can you elaborate how? IF 2.5V is applied wouldn't it still run into the MCU?

I know the resistor can limit current, is it that the current protection alone and not necessarily a voltage protection would be sufficient? Or is it that the current would be limited enough so the internal diodes won't be over burdened?

Here it is best to know the your processor board loads. The input "clamping diodes" have some current capability. The current specification of these diodes is not in the Atmel specification. I've read current capabilities from 1 ma to 10 ma. If your board takes less than this, then you don't need the upper diode MarkT suggested. If you board takes more current then the upper diode is recommended.
With this diode in place, the processor board will be powered through this upper diode and not the internal clamping diode.

Note: If you have a 3.3v board the zener should be lowered accordingly.

With that resistor can it accurately read a 0-5V input?

From the Atmel Specification:

The ADC is optimized for analog signals with an output impedance of approximately 10 k or less. If such a
source is used, the sampling time will be negligible. If a source with higher impedance is used, the sampling
time will depend on how long time the source needs to charge the S/H capacitor, with can vary widely. The user
is recommended to only use low impedance sources with slowly varying signals, since this minimizes the
required charge transfer to the S/H capacitor.

UPDATE (didn't catch the above posts as I was in the process of writing this one).
So we see there is no one "ideal" solution. A 10k in place of the 470 ohm resistor and the addition of two diodes will work fine. However I strongly recommend some resistance between the diodes and the processor input and the addition of a capacitor at the diodes. The capacitor of course is not for static voltages but spikes and noise, in general it is a good practice to add it to your circuit.

Thanks.

Yeah, i've learned through experience that even when you want to omit those little 100nf caps, they are best left in place. I generally have them on every input. Most cases a 47nf works too.

Now, it would seem, after reading the SP721 datasheet that it's current handling abilities are farther than near to what would be ideal.

I might have to just go back to the BAS 40-04 schottky

JohnRob:
The capacitor of course is not for static voltages but spikes and noise, in general it is a good practice to add it to your circuit.

The problem is when those spikes ARE your signal… as is often the case with digital signals, sometimes also with analog signals (a 1 kHz signal will be very much affected by a 100 nF capacitor). That’s why adding capacitors to an input is generally not a good idea.

donperry:
Thanks for your participation,JohnRob

You mentioned your design will protect even if the MCU is off? Can you elaborate how? IF 2.5V is applied wouldn't it still run into the MCU?

Schottky diodes conduct at 0.3V or so, they take all the current away from the internal protection diodes.
The supply rail may get lifted by such a fault current, but it won't burn up the tiny internal protection
diode doing so. If the supply rail doesn't get above the brown-out voltage the microcontroller is
completely inert in reset state. With a suitably large series resistor the supply rail is unlikely to rise
much. Schottky diodes are pretty fast to conduct too.

I know the resistor can limit current, is it that the current protection alone and not necessarily a voltage protection would be sufficient? Or is it that the current would be limited enough so the internal diodes won't be over burdened?

Yes, protect the protection diodes as they typically only handle a mA or so continuous. Adding schottkys allows
a lower resistor value (meaning faster signals can be handled, large resistors form a low-pass filter with the
input capacitance of the chip.

With that resistor can it accurately read a 0-5V input?
[/quote]

JohnRob:

Can someone explain the need for the second 5k resistor -- the one on the "to Arduino" side? Also, wouldn't it be safer to use something more like a 4.5V Zener, given the tolerance range, and non-ideal Zener knee? And, ultimately, isn't the method, offered by, wvmarle, in post #11 -- except with a larger resistance -- more like 10k:

the superior way to do this, since it doesn't suffer from the ambiguities mentioned above?

ReverseEMF:
And, ultimately, isn’t the method, offered by, wvmarle, in post #11 – except with a larger resistance – more like 10k:
the superior way to do this, since it doesn’t suffer from the ambiguities mentioned above?

Of course :slight_smile:

This is basically the same circuit as is used internally in the Arduino. That one uses regular diodes (about 0.5V drop), and the limit is about 1 mA continuous. The external version can handle as much current as the diodes you choose can take, and it being Schottky diodes their voltage drop is lower so the internal diodes won’t conduct at all. Well, if you push too much current into the Vcc or GND lines you may start to have other effects, unstable voltages there, so don’t overdo it. If you know you have to rely on them (and that’s OK - you can use 12V or higher as digital input signal relying on the protection diodes) make sure the resistor is of high enough value to limit the current to <1 mA or so, maybe 10 mA peak.

Can someone explain the need for the second 5k resistor -- the one on the "to Arduino" side? Also, wouldn't it be safer to use something more like a 4.5V Zener, given the tolerance range, and non-ideal Zener knee? And, ultimately, isn't the method, offered by, wvmarle, in post #11 -- except with a larger resistance -- more like 10k:

First you should know that I personally do not like to clamp potentially destructive voltages to the Arduino rail (power supply). This is a design choice that not everyone chooses.

To answer your question regarding the resistor near the arduino input (I should have assigned component numbers) I will explain the way it operates. Also know that the original post mentioned 15V from one customer but asked how to protect the input. I assumed the potential for > 15V was a possibility.

  1. the zener is 5.2 or perhaps should be slightly larger depending on the diode, so it does not conduct in the expect signal range being measured.
  2. The resistor near the arduino is there to limit the current of the voltage that could be generated across the zener; lets assume the zener goes to 6.2 V. The current into the arduino would be:

(6.2V - 5V )/ 5k = 250µA , clearly not enough to damage the Arduino, even if the µP was off.

The issue I have with the clamping protection (as it was stated) is at 15 Volts input the possible current could be:

(15-5)/470 = 21 ma. Not sure what other loads are on the processor voltage input but 21ma could bring the processor board to well greater than 5V. This could be remedied by increasing the 470 ohm resistor to some value that is known not to damage the processor.