CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

temperature data from LM35DZ :(

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ferkar



Joined: 14 Jul 2007
Posts: 38

View user's profile Send private message

temperature data from LM35DZ :(
PostPosted: Thu Mar 06, 2008 10:01 am     Reply with quote

hi everyone..
i need to find an answer of a question. after long times i managed to read temperature data from a lm35dz . i do not know the what the scale of lm35dz. anyway it gives some meaningful data to my pic.

in my project i send the temperature data to the pc over the rs232 interface(1200,n,1,1)and i am displaying the data on LCD continuously.

here is my question:

the temperature datas are always floating. i think it is not a stable situation. for example , in room temperature say ,20'C , my readings deviates +/-2 'C at least.

how could i get more stable temperature readings?
Ttelmah
Guest







PostPosted: Thu Mar 06, 2008 10:59 am     Reply with quote

Without knowing a lot more, hard to answer.

Multiple things apply. Remember first, that even if the signal is 'perfect', the reading from the ADC, will only be as good as the Vref used. If you are simply using the supply rail, then I'm afraid this won't be helping. Then if the LM35, is any distance from the processor, you need to be very careful in how you shield, and decouple the sensor. Then look at how you take the reading, and what clock source you are using. The most accurate way, is to use the internal RC source, and put the processor to _sleep_ while you take the reading. If you are not using sleep, then you really must use one of the divided clocks from the RC oscillator, not the RC source, and results will vary wth processor activity. Then you need to look at how carefully the grounding, and supply decoupling is handled round the processor. Once you have tidied all of this, then consider damping the readings in software (several quite simple routines to do this published here).

Best Wishes
crystal_lattice



Joined: 13 Jun 2006
Posts: 164

View user's profile Send private message

Temperature readings drift
PostPosted: Fri Mar 07, 2008 6:56 am     Reply with quote

Search the forum for the words "filter" and "temperature". You should find a post by someone that had similar problems and used a filter algorithm to get results to (i think) within 0.1 deg C. The code might be in the Code LIB section of the forum.

EDIT: Here is the link: http://www.ccsinfo.com/forum/viewtopic.php?t=19509

Regards
Ttelmah
Guest







PostPosted: Fri Mar 07, 2008 8:32 am     Reply with quote

At heart, damping algorithmns (which the filter you refer to is a kind of), can give improved accuracy _beyond_ the basic sampling accuracy of the ADC, _if_ (and only if), the noise present, is random (things like thermal noise, sampling noise etc.). Unfortunately, if the noise present is being caused by (for instance) glitches on the Vref from other circuitry, it may well have a pattern, rather than being random. This is why it is vital to eliminate/reduce such problems before looking at filtering, or the results may appear great, but not really be that good....

Best Wishes
crystal_lattice



Joined: 13 Jun 2006
Posts: 164

View user's profile Send private message

PostPosted: Fri Mar 07, 2008 9:00 am     Reply with quote

Yes i agree, the solution i suggested is only for when the Vref problems have been fixed. Fix the problem, don't hide the symptoms!

Regards
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group