I am in the process of fine tuning my energy monitor and I am having an issue with the DS18B20 temperature sensors.  When ambient temperature is increasing or decreasing, the sensors appear to be working fine.  When ambient temperature stabilizes the measured value oscillates.  I have an emonGLCD and a emonTX lowpower temperature node which oscillate somewhere in the neighborhood of 1 degree F (sorry, I'm a yankee and we haven't discovered the metric system yet).  I have a DS18B20 attached to my emonTX as well, and it oscillates upward of 5 degrees F.  I added a 20 sample averaging loop to my code on the TX and it has not helped.  Any ideas?  

BTW: I am not setting the resolution in my code so I believe it defaults to 12 bit resolution. I have attached an image of the data I see on emonCMS.

Robert Wall's picture

Re: DS18B20

Do you mean regular oscillations or random fluctuations? I've never seen a problem of  "oscillations" reported - there have been problems with inadequate pull-up, however.

How are you getting to °F? The reason I ask is because the temperature out of the DS18B20 is in 1/16 °C and it would be nice to prove it's not a rounding error in the maths. (It's unlikely, and especially not for 5 ° changes, but let's make sure.)

Are the other quantities measured by your emonTx stable? I'm wondering if you have a noisy 5 V supply?

I'm not sure what the screenshot is showing - those look like ordinary heating and cooling curves to me with a bit of noise (a few tenths of a degree) thrown in.

dkeach's picture

Re: DS18B20

Fluctuations might be a better term.  I get to F by using sensors.getTempF(address_T1) in my arduino code.  I have also read data in C and I saw similar issues.  

I thought the same as you did about the measurements being a normal heating curve, but the delta T is far less than the hysteresis I have my thermostat set to. I have attached another screen shot of what I am seeing on my outdoor temperature probe which is hooked up to my emonTX.  Mother Nature just doesn't behave that way.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.