0

DS18B20 Temp Fluctuations
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

DS18B20 Temp Fluctuations

by veames on Wed Sep 24, 2014 12:16 pm

Hi all,
I have the DS1820B (outdoor) which I have hooked up to my RPi. as per the diagrams and software referenced here;

https://learn.adafruit.com/adafruits-ra ... g/software

The script is run every two minutes and seems to work well, however at some point in the early morning the readings fluctuate wildly going up or down 3-5 degrees. Has anyone experienced this. The connections seem fine.
thanks
veames
 
Posts: 5
Joined: Sun Aug 29, 2010 6:47 pm

Re: DS18B20 Temp Fluctuations

by primexandy on Fri Sep 26, 2014 12:53 pm

is moisture / high humidity affecting it, ie, the pins being connected via moisture?

I have had issues with communicating with sensors when the pi is a bit cpu stressed, ie the sensor reading is fine, then I get the pi to do something else and for a few seconds I get bad readings. Is your Pi too busy when the bad readings happen?

I ran a ds18b20 sensor, logging the temp, every minute for a few days with no problems but if I ran a second program (such as compiling) it would through up a few bad readings. I also make my data logging software sleep for 90% of the time between readings because if I constantly poll the sensor it also causes the odd issue.

....if i leave the Pi taking a reading 1 per minute and it doesn't do anything else then I never get bad readings so I would look toward moisture, a dodgy connection or the software polling too often, or the pi being busy (ie, cron jobs happening or other programs running at the same time as bad readings)

primexandy
 
Posts: 89
Joined: Sat Sep 06, 2014 11:09 am

Re: DS18B20 Temp Fluctuations

by veames on Fri Sep 26, 2014 1:00 pm

Those are some good ideas.
I currently am running it as a camera as well. It should have less to do in the evenings though. Your moisture comment got me thinking though. The pi is indoors, but the sensor is hanging out the window, there is a lot of condensation.
I might test it a few evenings with more shelter. I'll also check the load average.
veames
 
Posts: 5
Joined: Sun Aug 29, 2010 6:47 pm

Re: DS18B20 Temp Fluctuations

by adafruit_support_bill on Fri Sep 26, 2014 1:03 pm

at some point in the early morning the readings fluctuate wildly going up or down 3-5 degrees.

Over what time-frame do these fluctuation occur? How and where is the sensor mounted?

I have an outdoor temperature sensor on the East side of my house. It fluctuates a bit in the morning as the rising sun filters through the trees.

adafruit_support_bill
 
Posts: 74951
Joined: Sat Feb 07, 2009 10:11 am

Re: DS18B20 Temp Fluctuations

by veames on Fri Sep 26, 2014 1:09 pm

Hi,
It tends to happen around 4am through till about 9am.
I am taking a reading using crontab every 2 minutes.
The side of the house its on doesnt get direct sunlight.
veames
 
Posts: 5
Joined: Sun Aug 29, 2010 6:47 pm

Re: DS18B20 Temp Fluctuations

by primexandy on Fri Sep 26, 2014 1:23 pm

you haven't got a boiler flue or other exhaust on that wall have you? probably not if there's a window but just a thought. But along the same lines it's nothing daft like your heating coming on and off and heat escaping out of the window onto your sensor? If you have it dangling out of a window some heat will leave the window and presumably have some effect? Often radiators are below windows and it may be coming off an on because of the opened window?

Just thoughts.

primexandy
 
Posts: 89
Joined: Sat Sep 06, 2014 11:09 am

Re: DS18B20 Temp Fluctuations

by adafruit_support_bill on Fri Sep 26, 2014 1:25 pm

Given that the fluctuations are only 3-5 degrees, I don't think it is an electrical problem. That would just give you read errors. But condensation on the sensor itself could affect the readings. Other sources of temperature fluctuations could originate from heating or cooling systems in your house.

adafruit_support_bill
 
Posts: 74951
Joined: Sat Feb 07, 2009 10:11 am

Re: DS18B20 Temp Fluctuations

by veames on Fri Sep 26, 2014 1:28 pm

Those are a few good things to look into. I'm pretty confident it's one of these issues. I'm going to move it around and see if it's something with the location. Since it happens at a particular time of evening, likely its environmental.

thanks all!
veames
 
Posts: 5
Joined: Sun Aug 29, 2010 6:47 pm

Please be positive and constructive with your questions and comments.