• Forums
• Posts
Latest Posts
Active Posts
Recently Visited
Search Results
• Page Extras
• Menu
• Forum Themes

### negative input to ADC makes problems

Author
GeorgeLewis
Senior Member
• Total Posts : 178
• Reward points : 0
• Joined: 2006/02/25 08:19:16
• Location: Alexandria, Egypt
• Status: offline
2008/10/20 12:55:59 (permalink)
0

# negative input to ADC makes problems

Hi everybody,

I am using 16f877A/876. I use 3 ADC channels AN0,1,3 with ref voltage from Vdd, Vss
I change the channels carefully (leaving enough time for recharging the sample capacitor) and no interference appears between the 3 channels input

BUT when one channel goes below zero (it is the output of an op amp) it affects the other channels as a negative offset
i.e. if there is 2 volts on AN0 and -1 volts on AN1, the ADC reads AN0 as 1 volts and sure reads AN1 as 0

Is there any way to avoid that other than rectifying the inputs to the ADC
And why does this happens in case of -ve input specifically

thanks

### 6 Replies Related Threads

Stefan Uhlemayr
Super Member
• Total Posts : 4292
• Reward points : 0
• Joined: 2005/05/12 12:25:46
• Location: Germany
• Status: offline
RE: negative input to ADC makes problems 2008/10/20 13:06:43 (permalink)
0
ORIGINAL: GeorgeLewis

BUT when one channel goes below zero (it is the output of an op amp) it affects the other channels as a negative offset
i.e. if there is 2 volts on AN0 and -1 volts on AN1, the ADC reads AN0 as 1 volts and sure reads AN1 as 0
If you put a voltage below Vss to any pin, you are outside the specification (ok, 0.3V tolerance, but this doesn't matter here).
ORIGINAL: GeorgeLewis

Is there any way to avoid that other than rectifying the inputs to the ADC
A quick and maybe dirty method is to use two resistors in series on the output of the opamps. One end of both resistors is connected to Vdd, the other end to the op-output. And the middle is going to the PIC-input. Both might be 1k for example. So if your opamp is giving out a +5V, you have 5V on the a/d-input. If your output is 0V, you have 2.5V on the a/d-input. And if the opamp is giving out -5V, you have 0V on the a/d-input. Placing two schottky-diodes on the a/d-input should protect your PIC from voltages over 5V and below -5V.

Hope this helps,
Stefan
jpopelish
Super Member
• Total Posts : 314
• Reward points : 0
• Joined: 2003/11/07 12:39:20
• Status: offline
RE: negative input to ADC makes problems 2008/10/20 14:02:50 (permalink)
0
Sorry to say, you absolutely have to keep all pin voltages within the specified ranges, or the chip will malfunction.  Many thousands of circuit components are issolated from each other by reverse biaseed diode junctions beneath those components of the chip.  Any time any pin voltage exceeds the specified range (usually Vdd+0.3 to Vss -0.3 volts) minority charge carriers are injected into the substrate and diffuse across those reverse biased isolation junctions.  The since those diode junctions (called isolation wells) perform the function of the insulating material between circuit components a circuit board is made of, the effect of these injected minority carriers is a lot like dunking a circuit board under water.  Everything connects to everything else through those leakage paths.

You must alter your external circuit so that you can be absolutely sure that all pin voltages remain within the specified ranges, or you will face this problem and possibly others.

John Popelish
GeorgeLewis
Senior Member
• Total Posts : 178
• Reward points : 0
• Joined: 2006/02/25 08:19:16
• Location: Alexandria, Egypt
• Status: offline
RE: negative input to ADC makes problems 2008/10/20 14:04:46 (permalink)
0
thank you

it is a good idea
but in my case I don't care for the negative output and I need to see the positive range on the ADC full scale
I used a precision rectifier by adding 2 diodes to the inverting amp but I don't know why it makes the output range less than the normal range without the 2 diodes

thank you
DSchabel
Super Member
• Total Posts : 1714
• Reward points : 0
• Joined: 2005/05/24 14:00:34
• Location: Western NY State
• Status: offline
RE: negative input to ADC makes problems 2008/10/20 14:09:45 (permalink)
0
ORIGINAL: GeorgeLewis

Hi everybody,

I am using 16f877A/876. I use 3 ADC channels AN0,1,3 with ref voltage from Vdd, Vss
I change the channels carefully (leaving enough time for recharging the sample capacitor) and no interference appears between the 3 channels input

BUT when one channel goes below zero (it is the output of an op amp) it affects the other channels as a negative offset
i.e. if there is 2 volts on AN0 and -1 volts on AN1, the ADC reads AN0 as 1 volts and sure reads AN1 as 0

Is there any way to avoid that other than rectifying the inputs to the ADC
And why does this happens in case of -ve input specifically

thanks

Try this site
Choose Case = 7.
post edited by DSchabel - 2008/10/20 14:12:23
jpopelish
Super Member
• Total Posts : 314
• Reward points : 0
• Joined: 2003/11/07 12:39:20
• Status: offline
RE: negative input to ADC makes problems 2008/10/20 14:27:22 (permalink)
0
ORIGINAL: GeorgeLewis
(snip)
but in my case I don't care for the negative output and I need to see the positive range on the ADC full scale
I used a precision rectifier by adding 2 diodes to the inverting amp but I don't know why it makes the output range less than the normal range without the 2 diodes

One of the diodes wastes a junction drop in series with the opamp output, so the most positive possible signal voltage is lower.  You might use small signal schottky diodes to reduce this effect by half, or so, but the only way to eliminate it is to change to a rectifier that does not put a diode in series with the opamp output.

Consider using only a series resistor between the opamp output and the analog input, and clamp the analog input with a schottky diode between Vss and the input.  If you can come up with a resistor diode combination that keeps the signal source resistance for tha A/D low enough for your required accuracy, and clamps the negative swings to the allowaboe range, you may get by.

Breaking that resistance into two resistors in series, with an additional schottky diode (or even junction diode) in the middle to Vss reduces the negative voltage even more (almost no forward current through the diode at the A/D input).

These kinds of rectifier have a lot more impedance than your cersion, but for a high impedance load like the A/D input pin, this may not matter much.

John Popelish
GeorgeLewis
Senior Member
• Total Posts : 178
• Reward points : 0
• Joined: 2006/02/25 08:19:16
• Location: Alexandria, Egypt
• Status: offline
RE: negative input to ADC makes problems 2008/10/20 16:37:57 (permalink)
0
Thank you John
I tried the diode clamp and it is working perfectly very good idea and simple

thank you DSchabel for the site
Jump to:
© 2018 APG vNext Trial Version 4.5