(Yet another) Input protection question

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

I'm designing an input circuit for a mega328 ADC input to read a variety of external position sensors that use a 360 degree pot (pots range from 1k to 20k depending on vendor). They are usually configured to generate a 0-5v voltage from the pot's wiper that is read by the ADC. I'd like to just feed that sensor voltage through a current limit resistor to the ADC pin with 2 Schottky signal diode clamps to +5 and ground (already eliminated zeners and standard silicon diodes).

Since some of these sensors have a deadband where the resistance goes infinite for a few rotational degrees there usually is a high resistance up to 1M ohm pullup or pulldown on the pot wiper to keep the sensor voltage defined during the deadband (some vendors build the pullup into the sensor).

Problem is that the Schottky diodes I've tried have enough leakage current (~0.5uA max at 25C) that at elevated temps the typical pullup of 470k-1M ohm causes a large sensor voltage error. At room temp all is fine but this controller has to work at higher T's also. And then there's the AVR's own leakage current which is spec'ed at 1uA max.

So I see 2 choices: either use much lower leakage Schottky diodes (or equivalent) or resort to adding a rail-rail x1 gain op amp buffer assuming it comes with better intrinsic input protection. Would appreciate a few seasoned veteran suggestions.

Chris B.

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

Perhaps a relative big serie resistor on the ADC make the current so low that the build in clamp diodes can do the job.
And don't expect the accuracy of the ADC be better that the diode leak.
Or messure the temp. and commpensate.
It's hard to avoid offset error on a 1x buffer that is smaller that the error you have now.

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

So I did more input circuit tests. Using a 470k pullup and a pair of BAT42 Schottky clamp diodes the leakage current-induced error at T=65 degrees C was 3%. Simply using 1N4148's reduced this error to 0.63% (less than 1% is acceptable since this error only is a factor in the sensor deadband). At 38C the error was in the noise. Note that I used a small spot size thermometer (http://www.circuitspecialists.com/tn01u.html) directed right at the diode case for accurate temps.

This leaves the issue that 1N4148's don't by themselves protect the AVR inputs to within the +- 0.5v spec. So sparrow2's suggestion of adding a series R (I'll use 2.2k) between the ADC input pin and the clamp diodes junction should limit the overvoltage input pin current to the Atmel-recommended 1mA (I = .8v/2.2k = .36mA which is a descent margin). The smaller the value of this R the better in terms of induced errors.

There are a few other factors to overcome with a hi-Z input circuit like this. Rather than repeat what I learned on how to resolve these without adding an op amp buffer I'll just share an excellent article on the topic: http://www.openmusiclabs.com/learning/digital/atmega-adc/ I opted for adding a 1nF cap at the ADC input pin for a fast "dump" into the ADC's sample-hold circuit. Since all the signals I'll be measuring on this project are fairly slow this cap will not impact the measurements. Here's another very helpful Freaks thread on input protection: https://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=69346

Chris B.

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

A forum member likes the Littelfuse SCR rail clamps.
Could try a forum search on those part numbers to get his post.
TVS Diode Arrays, General Purpose ESD Protection (Littelfuse)
SP725 (Littelfuse) (20nA max leakage at 105C)

"Dare to be naïve." - Buckminster Fuller

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

microguy wrote:
And then there's the AVR's own leakage current which is spec'ed at 1uA max.
Some of the XMEGA are 100nA max at 85C.
There are automotive-rated mega328 that may have less leakage.
Could compare data sheets between automotive and industrial mega328.

"Dare to be naïve." - Buckminster Fuller

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

To get 360 deg without a deadband usually involves an expensive sin/cos double decker pot, or a linear xy double pot that outputs 2 triangle waves 90 deg staggered. I guess the idea is that the linear calc is easier in integers that sines and cosines. Howsoever, just two regular old single turn pots with no stops 180 deg out of phase will let you use each pot over 180 deg. Read the other wiper out of the range of pot 1.

Imagecraft compiler user

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

Gchapman, those SP725's look nice if not a little pricey at $2.50 ea in 25's. They look like a great option where space is limited.

Re: the 328's leakage current I may not need an auto version if I can limit the clamp diode leakages. The 1N4148's are good but there are cheap standard junction very low leakage diodes that are much better for very little more (even tho' I might not need them).

Bobg, the sensor deadbands are intentionally built in by these sensor vendors to avoid ambiguity around 0. One sensor I'm supporting directly outputs a voltage range using a Hall Effect device with zero deadband BUT it suffers from ambiguity at the zero point where it can generate a rattling the rails indeterminate voltage if the working shaft is resting exactly on zero (not very likely but it's occasionally possible). Deadbands can be good sometimes... :wink:

Chris B.

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

Keep those 1N4148s in the dark. Those pesky little photons turn them into batteries.

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

RickB wrote:
Keep those 1N4148s in the dark. Those pesky little photons turn them into batteries.

Good point, I had heard that but never verified it. So I just ran a test with the input circuit and exposed 1N4148's. At both room temp and at 65C I saw no measurable difference when shining a bright LED lab desk light or removing it. This is with a 470k pullup to +5v on the diode clamp junction. The leakage current may be changing but it's insignificant with these particular diodes in this circuit (thankfully).

Chris B.

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

Automotive mega328 has the same leakage spec as an industrial mega328 except at a greater temperature (125C).

"Dare to be naïve." - Buckminster Fuller