ADC - how many LSB is good?

Started by Phil October 21, 2003
I'm a bit of a newbie when it comes to ADC. I've got a PICF88 with
an LM34DZ temp sensor hooked up one of the AD pins (A0, if it
matters). You see this design in a number of places. I am assuming
that the LM34DZ is reasonably stable (if not accurate) in its output
voltage.

Originally, I was running off of a questionable bench power supply
(e.g., with mediocre regulation). I was seeing >4 LSB of difference
between successive samples. I was using 2.55 V as the reference so I
was seeing something like 200 mV differences. I did try using Vdd as
reference to no benefit so my reference is stable.

I then read the Nat Semi app note and applied a 499 (ok, 470) ohm
resister and .1 uF cap between the output and gnd. This helped
somewhat, dropping it to around 3 LSB. I also added a largish cap
between power and ground (200 uF) but to little effect.

Then I switched to a 9V battery and an LM7805 to get as clean power
as possible on the theory that I was seeing power supply ripple.
This knocked about 1/2 an LSB off.

Can I get better than this? In my app I am averaging successive
readings to get a stable value but it seems like the HW should work
better than I am seeing. Or is this just the facts of life with
cheap sensors and A2D components?

Phil



In a message dated 10/21/2003 3:01:37 PM Eastern Standard Time, p...@yahoo.com writes:


Can I get better than this?  In my app I am averaging successive
readings to get a stable value but it seems like the HW should work
better than I am seeing.  Or is this just the facts of life with
cheap sensors and A2D components?



You are using a 10-bit ADC with a max count ot 1023.  With a ref voltage of 5V or 5000mv, this is one bit = 5000/1023 = 4.88mv per bit.   The LM34 has a spec of 10mv/degree so a 2-bit change would be about one degree.  The LM34 is very, very sensitive so if you want to get truly stable reading for test purposes
wrap your LM in a thick towel and let it sit somewhere for about 30 minutes, then start your readings.  If you are still getting fluctuating readings put a 1.2K resistor in series with the LM sensing lead, and put a .1uf bypass cap right at the pin the sensing lead is connected to.

If you switch to a 12-bit ADC like the TLC2543 your sensitivity would increase to about 1 bit = 1.22mv.
Sid Weaver
W4EKQ
Port Richey, FL


I suggest that you in turn clear the AD interrupt flag, turn on the AD aquisition, and let the processor go to sleep. It is then woken up as the AD is ready (not actually an interrupt routine, but a wake up)

This reduces noice, as the processors itself induces noice to the analog bits and pieces.

Impotant is - basically - to draw the circuitry as to separate the analog and digital signals and supplies of course. /Sven
----- Original Message -----
From: "Phil" <>
To: <>
Sent: Tuesday, October 21, 2003 7:51 PM
Subject: [piclist] ADC - how many LSB is good? > I'm a bit of a newbie when it comes to ADC. I've got a PICF88 with
> an LM34DZ temp sensor hooked up one of the AD pins (A0, if it
> matters). You see this design in a number of places. I am assuming
> that the LM34DZ is reasonably stable (if not accurate) in its output
> voltage.
>
> Originally, I was running off of a questionable bench power supply
> (e.g., with mediocre regulation). I was seeing >4 LSB of difference
> between successive samples. I was using 2.55 V as the reference so I
> was seeing something like 200 mV differences. I did try using Vdd as
> reference to no benefit so my reference is stable.
>
> I then read the Nat Semi app note and applied a 499 (ok, 470) ohm
> resister and .1 uF cap between the output and gnd. This helped
> somewhat, dropping it to around 3 LSB. I also added a largish cap
> between power and ground (200 uF) but to little effect.
>
> Then I switched to a 9V battery and an LM7805 to get as clean power
> as possible on the theory that I was seeing power supply ripple.
> This knocked about 1/2 an LSB off.
>
> Can I get better than this? In my app I am averaging successive
> readings to get a stable value but it seems like the HW should work
> better than I am seeing. Or is this just the facts of life with
> cheap sensors and A2D components?
>
> Phil >
> to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
>
> ">http://docs.yahoo.com/info/terms/



> Can I get better than this? In my app I am averaging successive
> readings to get a stable value but it seems like the HW should work
> better than I am seeing. Or is this just the facts of life with
> cheap sensors and A2D components?

Last week I used an 18F252 to read the value from a simple trimmer
potentionmeter. I could very carefully turn the trimmer pot to change
the 10-bit reading from a setting where the last bit toggeled, over a
range where the last bit was stable, to the next higher toggle range. So
short-term stability was much better than 1 LSB.

I used very large delay times (10 milliseconds or so), 10k trimpot
(hence worst case source impedance 2.5k), Vcc as reference (and as input
to the trimmer pot), 7805/wall-wart based power supply, and ample
decoupling. Note that my input was Vref-derived, you are trying to read
an absolute voltage.

What is your reference? Is it sufficiently short-term stable? Are your
delays long enough? IIRC an LM34/35 can oscillate under capacitive
loads, check the datasheet. Have you looked at your Vref and the LM34
output with a scope to check for any anomalities?

On power supply influence: I recall a circuit-cellar article where a PIC
logged the acceleration of a model rocket during its flight. Every Nth
sample showed a relatively large error. N was equal to the page (buffer)
size of the eeprom chip that was used....

Wouter van Ooijen

-- -------
Van Ooijen Technische Informatica: www.voti.nl
consultancy, development, PICmicro products



Thanks for the ideas guys.

I'm using a simple trimpot for the reference. I've gone
over the LM34 data sheet several times and tried several
different ideas from it. My PS isn't that good so
I ran off of a battery/7805 so there should be
no noise from it. It helped some but still got about 2.5 LSB
variation. The national data sheet claims the lm34 has .4
ohm impedance at low current so I dont think its a high
impedence problem

I'll try sleep mode/interrupt to see if the PIC is
inducing the noise. I am using a breadboard for prototyping
so that may be an issue. I did try to isolate the analog
components.

Phil

--- In , "Wouter van Ooijen" <wouter@v...>
wrote:
> > Can I get better than this? In my app I am averaging successive
> > readings to get a stable value but it seems like the HW should
work
> > better than I am seeing. Or is this just the facts of life with
> > cheap sensors and A2D components?
>
> Last week I used an 18F252 to read the value from a simple trimmer
> potentionmeter. I could very carefully turn the trimmer pot to
change
> the 10-bit reading from a setting where the last bit toggeled, over
a
> range where the last bit was stable, to the next higher toggle
range. So
> short-term stability was much better than 1 LSB.
>
> I used very large delay times (10 milliseconds or so), 10k trimpot
> (hence worst case source impedance 2.5k), Vcc as reference (and as
input
> to the trimmer pot), 7805/wall-wart based power supply, and ample
> decoupling. Note that my input was Vref-derived, you are trying to
read
> an absolute voltage.
>
> What is your reference? Is it sufficiently short-term stable? Are
your
> delays long enough? IIRC an LM34/35 can oscillate under capacitive
> loads, check the datasheet. Have you looked at your Vref and the
LM34
> output with a scope to check for any anomalities?
>
> On power supply influence: I recall a circuit-cellar article where
a PIC
> logged the acceleration of a model rocket during its flight. Every
Nth
> sample showed a relatively large error. N was equal to the page
(buffer)
> size of the eeprom chip that was used....
>
> Wouter van Ooijen
>
> -- -------
> Van Ooijen Technische Informatica: www.voti.nl
> consultancy, development, PICmicro products