Hi all!

I have a circuit where the last componenent is a non-inverting summing op-amp which should produce a voltage between 0 and 1V.

I'm sending this circuit output to an analog input pin on my arduino Mega, but want to make sure that if any issues happen with the circuit (node failing, op-amp failing) that the output of this op-amp doesn't saturate and the analog input of my arduino doesn't recieve over +5V and get fried.

I'm looking into using a shunt regulator at the output to limit the output to +5V in case the above occurs. Can I just connect a zener diode at my output to ground and then connect my output to the analog input pin too?

Thanks!

A simple series resistor will provide the best protection you could need.

Each input of the processor has internal diodes connected to Vcc and other to GND. If the voltage on any pin exceeds Vcc by ~ 0.7 volts these diode start to conduct.

If you choose your resistor to limit the maximum fault current to 10 ma (somewhat less than Atmel specs) you will be find.

If you are protecting analog inputs, you might find a small capacitor 0.01µf after the resistor (i.e. just before the input pin) might help reduce conversion noise.

Good luck

I use a 10K series resistor.

Hi, Also you can use a 5 volt Zener diode at the input to protect the input from high voltage.

tauro0221: Hi, Also you can use a 5 volt Zener diode at the input to protect the input from high voltage.

No. That won't work. Not in the general case.

A Zener labelled at 5V is only exactly 5V at a specific current. That current may be quite high - hundreds of milliamps. So your input pin will never even get close to 5V and it will overload the thing trying to send the 5V.

And even if you happen to use a Zener with the right breakdown voltage, the diode will face the same problem as the AVR's internal diode: it will be blown if the spec'ed current is exceeded. So a series resistor is needed anyway

Hi, Maybe need to clarify the use of zener diode and why. Yes, I missed that if you use a zener diode you need to use a resistor in series so not to exceed the zener max. current. I use it when it is possible that the source may failed causing the voltage raise over the analog input/ digital output or digital input or the micro working voltage. Example when you are reading high voltage using a voltage divider you must take caution in case something catastrophic happen to the source. Right now he said that the it is 7 volts. How high can go if the source failed. As long you do not exceed the voltage breakdown the zener diode it will not interfere with the input. I hope this will clarified the use of the simple zener for input protection. It happened to me one time but it will not happened to me the second time.

Are you powering the opamp with more than 5v or less than 0v on the negative side? If not, you have nothing to worry about, because no opamp will produce a voltage outside it's power rails.

But yeah, the standard solution here is a series resistor.

JohnRob: If you choose your resistor to limit the maximum fault current to 10 ma (somewhat less than Atmel specs) you will be find.

Protection diodes are different to regular I/O limits. 1mA seems to be the generally stated number for protecting the protection diodes.

Statements from ATmega320 datasheet

The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less.

Voltage on any Pin except RESET with respect to Ground ....... -0.5V to VCC+0.5V

So the protection resistor for analog inputs should not be higher then 10K. Just imagine this very very very bad situation. You have an analog input that gives you a max. of 12V+ and 12V-. You could handle the over-voltage using a voltage divider. The problem is still the negative voltage. Using a voltage divider the analog input might still see minus -5V. Using a 10K protection resistor will reduce the current thru the protection diode to max. 0.5 mA. The voltage drop at the protection diodes is 0.5V. It is not specified but you can deduct this from the max. input/output voltages. (Schottky diodes?)

5V*0.4mA=2mW. This sounds like almost nothing. But do not forget that the protection diodes are extremely tiny spots on a chip with 1000s of transistors. If the chip is busy it might be quite warm already. Think of a local hotspot.

The ATmega328 datasheet has a circuit diagram of the protection unit (page 313 in version Rev. 8161D). It does NOT give you any information how many milliamperes the diodes can handle.

Protecting from a positive over-voltage is quite easy. Maybe just using a voltage divider or a zener diode with a resistor in front. Protection from negative voltages is not that easy. A regular diode in front of the analog input will will not help when you use a diode with a forwarding voltage higher then the protection diodes. So I do miss some information in the datasheet.

However, I think it can handle at least 1mA. Just a guess. So a 10K resistor will probably do the job.

Thanks everyone for the replies!

I've done some more looking into this, I'm going to power my op amp with a different set of rails, instead of my +9V and -9V rails, I'm going to use my +5V and -5V rails.

However, I'm still dealing with the possibility of negative voltage at the pin if the circuit fails and -Vcc (-5V) is shown at the analog input pin.

It sounds like people are saying if I simply put a 10k resistor between my circuit output and the analog input my problem will be solved, is this true? Will this cause any attenuation in my output signal?

An Arduino that is accidently off has +0.5volt and -0.5volt pin limits. That makes 5volt protection zeners generally useless.

4k7 or 10k in series has little or no influence, even if you have to measure fast signals. For slow (DC) signals, add a 100n cap from pin to ground. That gives the A/D a solid source to sample from. Leo..

MorganS: No. That won't work. Not in the general case.

A Zener labelled at 5V is only exactly 5V at a specific current. That current may be quite high - hundreds of milliamps. So your input pin will never even get close to 5V and it will overload the thing trying to send the 5V.

mbrawl01's signal is only 0-1.0V during normal conditions. What's being requested is protection during a fault condition. Accuracy is not necessary at that point.