|
|
View previous topic :: View next topic |
Author |
Message |
ferkar
Joined: 14 Jul 2007 Posts: 38
|
temperature data from LM35DZ :( |
Posted: Thu Mar 06, 2008 10:01 am |
|
|
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
|
|
Posted: Thu Mar 06, 2008 10:59 am |
|
|
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
|
Temperature readings drift |
Posted: Fri Mar 07, 2008 6:56 am |
|
|
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
|
|
Posted: Fri Mar 07, 2008 8:32 am |
|
|
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
|
|
Posted: Fri Mar 07, 2008 9:00 am |
|
|
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 |
|
|
|
|
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
|