LM34 / capacitor / PIC ADC interaction? Aaaaarrrgh!

Dec 28, 2007 3 Replies

I'm running a couple of LM34 temp sensors into a PIC16F687. When running the ADC result is noisy.



Here's what I've got:


1) On the LM34 temperature output pin is a sawtooth of about 200mVpp and
150uS period: |\\|\\|\\|\\|\\ The 150us period seems unrelated to the ADC sampling rate - this which is sampled "on demand".


2) The ADC is set up for external reference (2.5V) which is clean and stable.


3) The LM34 supply and grounds are also clean and stable. I've tried powering them from both 5V & 9V (battery).


4) A couple of 5k pots set up on the input work perfectly, the wiper voltages & ADC results are stable & smooth.


5) The LM34 outputs are coupled via a 10 ohm series resistor followed by a
10nF cap to ground as follows:

LM34 --/\\/\\/\\---------> ANx on PIC 10R | | --- --- 10nF | | AGND


6) Stuffing around with the code, reducing it to the bare minimum does not change anything.


_However_
I've found that removing the 10nF capacitor _fixes_ the noisy operation of the LM34's. With the cap in it oscillates - with no cap it is stable. I can't see anything in the LM34 data sheet about capacitive loading the LM34 output. Zout is low 0.4R @ 1mA.



Am I missing something obvious here? Any suggestions greatfully received!



TIA r.


The LM34 probably has an op-amp at its output (or the equivalent), and op- amps are notorious for not liking to work into a capacitive load. Increasing your resistance into the cap would probably also make the thing happy, if it didn't cause problems elsewhere in the circuit.

Tim Wescott Control systems and communications consulting http://www.wescottdesign.com Need to learn how to apply control theory in your embedded system? "Applied Control Theory for Embedded Systems" by Tim Wescott Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html

Thanks Tim - I told myself I'd read that data sheet a dozens of times - until I hit the send button! Right under my nose is this big section subtly titled CAPACITIVE LOADING. Apologies.......

"Like most micropower circuits, the LM34 has a limited ability to drive heavy capacitive loads. The LM34 by itself is able to drive 50 pF without special precautions"

Taken directly from a National LM34 datasheet.......

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required