ADC voltage question pertaining to input protection

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey guys...I've tried searching and have read tons of posts and the datasheet but I'm still confused...I understand that the ADC's voltage range is 0-5, but in searching for input protection circuits everyone says to use clamping diodes. But by doing this, the input voltage on the ADC pin is Vcc + diode voltage. For example...here is a circuit that was shown for input protection...

                               VCC 
                               --- 
                                | 
                                | 
                                | 
                                _ 1N4148 
                                ^ 
                                | 
                                | 
                      10K       |      10K 
EXTERNAL INPUT >----/\/\/\/\----+----/\/\/\/\-----> AVR INPUT 
                                | 
                                | 
                                | 
                                _ 1N4148 
                                ^ 
                                | 
                                | 
                                | 
                               --- 
                               GND 

When I simulate this for over/under voltage using the 1N4148's I get Vcc + diode voltage for about .6v...so when I get a spike on the input the ADC pin will actually see 5.6v or so...and during a simulated negative spike the ADC pin shows about -.6v

Using Schottky diodes helps this...about 5.2v and -.2v...but these are still outside of the 0-5v range. What am I missing??? I'm using an ATMega168...the datasheet shows:

                           Min            Max
AVCC Analog Supply Voltage VCC - 0.3      VCC + 0.3 V
VREF Reference Voltage     1.0            AVCC V
VIN Input Voltage          GND            VREF V

This suggests that with a Vcc of 5 volts the ADC should never go above that or below ground. Can anyone explain this? Thanks!

Brian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First off the protection circuit you have is valid and the results you're seeing are proper - no problems with your theory or implementation or analysis. I think the main problem is that you're looking at the wrong specification. The protection circuit is meant to protect the pin from going outside of the absolute pin voltage rating - in the ATMega168's case -0.5V to VCC+0.5V. The schottky diode should help you get in that range. I know in school our teachers told us to use the 1N4148 with an 8051 board that probably had better absolute max ratings. Don't fret - just use the schottky diode and you should be fine. You're already ahead of the game for even considering input protection :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BrianJ,

If we need to protect some i/ps from the real world, we use SP720As. They are a little expensive but they have many advantages over the standard s-diode. They even meet a mil spec. ( Me thinks ).

A

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the replies...However,

sfriederichs,
I see where the datasheet shows the pin ratings, but I still don't understand the ADC rating then...if Vcc is 5v then my ref is 5v, which means my ADC Vin should be Gnd - 5v...I don't see any room to work there...and what happens when you get a pos or neg spike? Even with the schottky's you still get 5.2v or -.2...what happens to the ADC during these times? How does the AVR interpret it?

andrew99,
I looked at the datasheet for the SP720...it looks nice, but it never gives an example of Vbe...it just says "protect to 1Vbe above V+ and -1Vbe below V-"...what does that equal?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian -

There are TWO issues, here.

The first is the linear range of the ADC. It extends from 0V to Vref. It sounds like you have set Vref = Vcc which is just fine. The data sheet tells you what the ADC reads with inputs beyond those limits Below zero, it reads 0x0000 and above 5V, it reads 0x03FF. Predictable and not surprising.

Now, the next issue is chip reliability (ie, FAILURE). This is governed by the ratings in the "Absolute Maximums" table (or some name to that effect). If you exceed those limits, the chip may fail. It might be a single pin or it might be the chip as a whole. THIS is what the input limit circuit is designed to prevent.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jim,

Ahhh, see that makes sense then. I didn't get that from just reading everything. I didn't see where it showed the ADC reads 0x0000 below GND and 0x03FF above 5v...I must've missed that. Thank you for the explanation.

Also, this is for an automotive application...and yes I know it's been discussed before, I've read all the threads, but what I failed to find was a general consensus or agreement on input protection in an automotive environment. Any suggestions beyond this? Or will this work fine (along with a cap for ESD protection)? Or maybe one chip like andrew99 suggested to take care of everything? I want something robust, reliable, production oriented.

Thanks for the help!

Brian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

***Edit*** Double post...

Last Edited: Thu. Jan 22, 2009 - 05:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would use a pair of 4.7K resistors instead of 10K. The ADC notes tell us that the ADC is optimized for a maximum source resistance of 10K and that there will be errors as the source resistance increases above 10K.

I generally like to use transient protection diodes. Here, you can use unidirectional ones as they will clamp at some positive voltage and ground. The problem with these things is that the clamp voltage is not very precise. If you get some that guarantee proper operation up to 5.0V, then the clamp voltage is higher than 5.2V.

There are several transient "regimes" to be concerned about in automotive systems. One is certainly reverse connection. Another is ESD (high voltage, substantial but limited energy, short duration). A third is the dreaded "load dump" (battery disconnect while engine is running) which can exceed 60V in a 12V system. The latter tends to be more of a problem on power inputs but can also be an issue if you are trying to measure things in a vehicle; time constant for load dump can be 10s of seconds and it has a LOT of energy available.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah, I've been researching this for a bit here...found a great resource by Maxim-IC that deals with the automotive issues as well as switch bounce, etc. For anyone interested it's found here:

http://www.maxim-ic.com/appnotes...

I've seen several devices so far that are designed specifically for this scenario - protecting uC's inputs in an automotive environment. Supposed to protect against all the things you mentioned...I'll have to do a little more reading to see what the downsides to these are, if any. Thanks again for the heads up though, you've definitely been helpful!

Brian