Home  |  Contents 

Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: (MM) wild temp sensor readings Post ReplyPost New Topic
Page of 3 Next >>
Author
Message << Prev Topic | Next Topic >>
pcaffalldavis
Senior Member
Senior Member
Avatar

Joined: 17 October 2011
Location: United States
Online Status: Offline
Posts: 187
Posted: 13 January 2012 at 11:47am | IP Logged Copy link to clipboard   Quote pcaffalldavis

(MM) Wild temp sensor readings LM335Z

Iíve been having some difficulty with wildly extreme temperature readings from LM335Z temperature sensors.

Iím doing the trial runs of the wood fired boiler and have noticed that two of the four temperature circuits fluctuate as much as 5 degrees C (10-12 degrees F) in as little as five minutes. Sometimes this fluctuation is in as little as two minutes and it is not uncommon for the first minute at MM boot to fluctuate as much as 8 degrees F or 4 degrees C.

All temp sensor pins are set using SETPIN(x),1

The MM SM1 3.3 volt circuit reads at 3.26 volts so I use 3.26 in formula. For example: OUTDOORTEMPCENT=(PIN(2)/3.3 * 3.26-2.73)*100.

Iíve swapped the outdoor temp sensor with the household hot water sensor and the fluctuation is extreme (beyond factual) regardless of which sensor I use.

All four of my sensor circuits use only the + & - legs of the LM335Z. I have them soldered to 22 gauge 2 conductor red/black insulated wires with an outer layer of gray plastic. The hot water and outdoor temperature circuit wires are both about 8 meters long. The one for the indoor house temperature is similar, but only 3 meters long. This shorter one does not fluctuate nearly as much, probably reads more accurately is my guess.

I have tested the sensors on different sensor circuits to make sure the problem was not on the circuit board. The results are that the sensors with the longer wires have the most fluctuation regardless of which sensor connection point they are plugged into.

I wondered if I had too high of a current load on the MM SM1 power regulator, which I may have since it was warm when I was running the VGA to Composite converter off the 5 volt leg. But I disconnected the VGA converter and the temperature fluctuation problem is still there. I tested the setup using two different MM SM1ís too, so it is not machine dependent.

Does anyone know what the heck is going on?

I built an earlier MM project, a temperature sensor and data logger using a 10 meter wire to a LM335Z which is still running. I use it to view and log the current, high and low daily temperatures. It does not seem to fluctuate within a single minute much at all, maybe 1 or 2 degrees F (1 degree C). But these other circuits in my Wood Fired Boiler project sure do.

Today I even tried replacing the Outdoor Temperature Sensor, one of the 8 meter 22 gauge stranded wires sensors, with a new 8 meter 20 gauge solid wire with a brand new LM335Z on the end. It has the same problem as the 22 gauge one it just replaced.

So, Iím wondering, is it possible that these sensors might be picking up transient RF voltage on these longer wires? I canít think what else it could be. The argument against that though is that my longer sensor on the other MM temperature logger does not manifest the wide range fluctuation problem.

I would have taken the long 10 meter sensor off my daily temperature logger to test on the Wood Fired Boiler project, but that one is soldered in whereas all the others are connected using 2 conductor header pin connectors off the component circuit board. I donít think those connectors could be the problem.

I do run my outdoor sensors along a place on the back corner of the house where about a dozen CCTV camera signal and power wires are running into the house. But the other earlier project sensor wire that does not fluctuate much also runs along this corner of the house near these wires.

Does anyone have any ideas on this? Has anyone else experienced wild fluctuations of temperature readings using LM335Z sensors? Should these longer runs of wire to sensors be shielded? Would this solve the problem?

Pete in Hyder

__________________
We're all here 'cause we're not all there.


Back to Top View pcaffalldavis's Profile Search for other posts by pcaffalldavis
 
TassyJim
Guru
Guru
Avatar

Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 3008
Posted: 13 January 2012 at 12:11pm | IP Logged Copy link to clipboard   Quote TassyJim

Pete,
I run 10-15 metre two wire leads to some of my LM335's without any problems.
I feed mine from 5V and pick a resistor to give 1-2mA at 'normal' temperatures.


A 1k resistor or slightly larger for R1 should do the trick.

I have also put in a voltage divider to drop the output a bit and to keep the voltage to 3.3V if the signal lead goes open circuit.
That happens when the wife goes mad with the pruning shears. I have lost a few soil temp sensors that way!

I do usually put a small capacitor at the Maximite inputs and ferrite beads around the cables but I do play with radios as well so it's second nature for me.

Jim

My CGMMSTICK's arrived today so time to warm up the soldering iron...

Edited by TassyJim on 13 January 2012 at 12:15pm


__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
pcaffalldavis
Senior Member
Senior Member
Avatar

Joined: 17 October 2011
Location: United States
Online Status: Offline
Posts: 187
Posted: 13 January 2012 at 1:23pm | IP Logged Copy link to clipboard   Quote pcaffalldavis

Thanks Tassyjim,

So how do you determine the voltage for the basic program? Do you just read across the downline side of the resistor and ground with the LM335 disconnected? And then use this voltage in the basic formula?

Pete in Hyder

__________________
We're all here 'cause we're not all there.
Back to Top View pcaffalldavis's Profile Search for other posts by pcaffalldavis
 
centrex
Guru
Guru
Avatar

Joined: 13 November 2011
Location: Australia
Online Status: Offline
Posts: 320
Posted: 13 January 2012 at 2:32pm | IP Logged Copy link to clipboard   Quote centrex

Hi Pete
Your formulae is correct but are you running the temp sensors from the 5Volt supply as TassyJim has shown, GeoffG suggested using a 1.8K resistor but also cautions that the max temperature that can be read is 57degC, if want to read a higher temp you have to use a voltage divider into the input pin and then scale the reading in software.
Also a .001 cap on the input pin to gnd may get rid of some induced voltage.

To TassyJim now that you have had at least 5min to play with the CGMMSTICK what do you think of it.

regards
Cliff
Back to Top View centrex's Profile Search for other posts by centrex Visit centrex's Homepage
 
TassyJim
Guru
Guru
Avatar

Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 3008
Posted: 13 January 2012 at 3:53pm | IP Logged Copy link to clipboard   Quote TassyJim

Pete

This is my circuit


I have put a 0.01uF capacitor from point A to ground on some of the long leads.

To get the scaling factors, I measured the Maximite voltage at a known temperature and calculated it from there.
With 4 sensors my program looks like:
scaled(3)=av(3)*168.5-273
scaled(4)=av(4)*168-273
scaled(5)=av(5)*168.3-273
scaled(6)=av(6)*169.5-273

I take readings every 10 seconds and average them over 5 minutes.
The variations between sensors is not worth worrying about in my situation.
The location of the sensor causes the biggest errors and within one degree C is more than enough.

Cliff,
No chance to play with the CGMMSTICK yet, the wife cam out of hospital yesterday. I think I had more time when I was spending all the day driving to and from the hospital visiting.
Just waiting for her to go back to sleep....

Jim



__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
pcaffalldavis
Senior Member
Senior Member
Avatar

Joined: 17 October 2011
Location: United States
Online Status: Offline
Posts: 187
Posted: 13 January 2012 at 5:13pm | IP Logged Copy link to clipboard   Quote pcaffalldavis

Tassyjim

I like the way you got your circuits set up for each LM335. Is the av(3), av(4) the average of the pin(x), etc voltages you collect directly from the Maxmimite pins that the sensors are located on? This looks great.

So you average the pin voltage readings for five minutes for each individual pin, putting the results into av(x), av(y), etc, and then at five minute intervals you use scaled(x), scaled(y), etc to convert the averaged voltages collected to display the results?

I like that if I understand correctly. Could you share a couple lines of code showing how you collect and average the pin voltages on each program loop?

I am new to circuit board building and have never learned about or understood capacitors before. I do have a box of capacitors, mostly disc types with a few cans. Wikipedia tells me the small disc types are rated in pF. So if I need to use a .01 uF isnít that the same as 10 nF or 1000pF? Iím trying to see if I have what I need to jump these four sensors pins to ground. Iím not sure I understand how to read their markings. Guess I need to order up a collection of capacitors. Do you suggest cans, disc, or ceramic? Do I need all three for amateur work like this? Are the .01uF caps that I need most likely to be disc type?

Pete in Hyder


__________________
We're all here 'cause we're not all there.
Back to Top View pcaffalldavis's Profile Search for other posts by pcaffalldavis
 
Olimex
Senior Member
Senior Member


Joined: 02 October 2011
Location: Bulgaria
Online Status: Offline
Posts: 226
Posted: 13 January 2012 at 5:34pm | IP Logged Copy link to clipboard   Quote Olimex

for industrial environment with lot of noise and long cable I would modify TassyJim schematic to this:



I've seen hundreds of volts induced picups on long cables going near motors and relays
Back to Top View Olimex's Profile Search for other posts by Olimex
 
Olimex
Senior Member
Senior Member


Joined: 02 October 2011
Location: Bulgaria
Online Status: Offline
Posts: 226
Posted: 14 January 2012 at 2:21am | IP Logged Copy link to clipboard   Quote Olimex

Pete, I just post atricle on this in my blog and explained how to calculate your coefficients
TEMPERATURE MEASUREMENT WITH LM335Z

Back to Top View Olimex's Profile Search for other posts by Olimex
 
jwettroth
Newbie
Newbie
Avatar

Joined: 02 August 2011
Online Status: Offline
Posts: 29
Posted: 14 January 2012 at 3:34am | IP Logged Copy link to clipboard   Quote jwettroth

A couple of things.

If you don't need much speed- you can bypass your cable with a capacitor or an RC if the load has trouble driving capacitive loads.

I am just starting to play with the Analog Inputs on an SM1 and am getting pretty poor results. The first reading that I get will be pretty good. If I run in a tight loop, the next reading will be down and the readings will settle out to about 70% of the initial reading. I'm using a 2.5v buffered reference as my voltage source and FW 3.0A.

Do you all get repeatable readings at semi fast rates. I'd like to read about 10 readings per second- not really very fast...

Thanks,
John


__________________
John Wettroth
Back to Top View jwettroth's Profile Search for other posts by jwettroth
 
Olimex
Senior Member
Senior Member


Joined: 02 October 2011
Location: Bulgaria
Online Status: Offline
Posts: 226
Posted: 14 January 2012 at 3:57am | IP Logged Copy link to clipboard   Quote Olimex

I did single measurements then ran 1000 samplings and averaged them, the result was same, so I didn't want in this example to bloat the code as the precision stays same no matter if you sample 1 or 1000 times
Jwettroth can you post your schematic how do you wire the sensor, you should do something wrong, or can you check with oscilloscope what is your voltage on the input pin and if it fluctoates by some way like modulated with 50Hz noise?
investigate your PIC32 power supply for noise too, in DM special care was made when the power supply was layout and the Analog part must be properly de-coupled form the digital part


Edited by Olimex on 14 January 2012 at 3:58am
Back to Top View Olimex's Profile Search for other posts by Olimex
 
pcaffalldavis
Senior Member
Senior Member
Avatar

Joined: 17 October 2011
Location: United States
Online Status: Offline
Posts: 187
Posted: 14 January 2012 at 8:40am | IP Logged Copy link to clipboard   Quote pcaffalldavis

Okay, I will add resistors R2 & R3 and recalculate based on the resistors true resistance as measured using a meter.

I'm currently using 1.8K resistors for R1. Do I need to change them for 1.5K resistors or can I leave them as 1.8K? Will these 1.8K resistors affect the voltage divider formula? I don't see how they would, but I am not schooled in these matters.

The formula I will use to calculate the Pin(1) multiplyer is: 100/(R3/(R2+R3))

If R2 is 18K and R3 is 27K the result should be about 166.7, but should be adjusted for the actual values of the resistors. If I understand correctly then the degree Celsius reading would be Pin(1)*166.7-273.

Some of this was taken from Olimex's blog and repeated here for the benefit of those who didn't follow the link. Thank you Olimex

So folks, do I need to swap the R1 1.8K resistors for 1.5K resistors?

Pete in Hyder

__________________
We're all here 'cause we're not all there.
Back to Top View pcaffalldavis's Profile Search for other posts by pcaffalldavis
 
JohnS
Guru
Guru


Joined: 18 November 2011
Location: United Kingdom
Online Status: Offline
Posts: 1843
Posted: 14 January 2012 at 9:30am | IP Logged Copy link to clipboard   Quote JohnS

The ratio of R2 & R3 will only move the readings a little if you measure the resistors carefully. Worth doing, but it's not going to fix the problem where the temp jumps.

I can't see changing R1 by a little being a fix, either.

You have noise spikes or something (by way of example, a heat source you've not realised is there).

The filters & noise suppression shown in the above circuit and mentioned in various posts are to get rid of (suppress) the noise - if it's noise, and likely it is.

John
Back to Top View JohnS's Profile Search for other posts by JohnS
 


Page of 3 Next >>
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1250 seconds.
Privacy Policy     Process times : 0, 0, 0, 0.12