Temperature changes inside the box

12 replies [Last post]
kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010

Having put the pcb board and display inside the box - I temporarily left the temperature sensor inside (in a plastic bag to avoid possible shorts!).

The graph below shows the temperature changes - it seems to go up and down once an hour.  So presumably the hardware is

working harder and then resting (cooling).  Any ideas? - just curious.  Note the sensor works fine - and I have moved the box around to prove that it is not location.  The general rise and fall aligns with house temperature as shown on nearby currentcost meter.

My feed is at http://www.pachube.com/feeds/13194 if you wish to see the days prior to the changeover.

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
Hotspots

Kim,

Thanks for this interesting info. I can't think of any 'cron' type behaviour that would cause this effect. It would be interesting to see if the load average goes up during these periods of raised temperature.

The box does run quite warm. When designing the HAH PCB, I was initially concerned that the 5V regulator on the Livebox PCB might be overloaded. However, months of soak testing convinced me that the extra load wasn't upsetting the stability of the unit.

Good to see those pachube feeds. 

Derek.

 

brett
Offline
Providence, United States
Joined: 9 Jan 2010
That's a wild graph

I've never put a sensor inside the HAH to see what its internal temperatures is like.

Off the top of my head I can't think of anything that we are doing every hour that would induce a load sufficient to push up the CPU temp.  A very curious finding indeed.  Hay at least its working.   Love that graph!

Brett

kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010
OK - so I watched it for a

OK - so I watched it for a while and couldn't find anything to do with the load - although if you click the web reload button too often you can get the load right up!!! 

Then I had a look at the data in a bit more detail - and downloaded 12 hours worth of one minute records into excel.

Looking then at how much the temperature moved in successive minutes we get the following distribution

degrees change  count

-1.2                    3

-0.9                    7

-0.2                    4

-0.1                    35

 0.0                    615

 0.1                    37

 0.2                    4

 0.9                    7

 1.2                    4

All the other values were zero (i.e. no counts)

Clearly the small changes (-0.2 to +0.2) are possible changes.  But I suspect the 0.9 and 1.2 changes may be more to

do with the conversion code than a real result.  It seems suspicious that there are no other changes than 0.9 or 1.2 degrees.

What do you think?

This was the API I used to download the data in 6 hour blocks

http://api.pachube.com/v2/feeds/13194/datastreams/2.csv?start=2011-01-06T06:00:00Z&end=2011-01-06T11:59:59Z&interval=0&per_page=1000

Kim

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Pachube vs Realtime

Well I know the temperate sensor code in the firmware is good as if you watch the data realtime you see 0.1 degree movements.  Now do recall that the xap-pachube gateway only pushes data every minute and it only does so it the value last sent has changed.  So in a minute period its possible to swing more than 0.1 of a degree giving these larger quantum jumps in temperature.  Still that doesn't explain the irregular readings.  It would be interesting to graph the xap packet data directly, ie not via pachube, to get a better understanding.

I little bit of python code would do the trick.

http://www.dbzoo.com/livebox/hah_xap_python

Perhaps using some idea's from an RRDTOOL blog I wrote up a while back.

http://www.dbzoo.com/blog/remote_monitoring_with_rrdtools

kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010
The plot thickens

Yes you are correct about the 0.1 accuracy because I had it working happily at room temperatures for several days.

I shall have a go at the python code - new learning for me.

Meanwhile I took the sensor out and put it in my tea (!!)

The resulting graph shows the same pattern but I also had a look at xfx viewer and observed the following:

1) As the temperature fell it would jump UP from say 65.0 degrees to 65.9 degrees - always after the .0

2) At say 36.4 degrees it jumps DOWN to 35.2 degrees - always after the 0.4

So there is something funny going on.  I don't seem to be able to copy and paste the xfx messages.  Although I have also discovered while playing that the graph on my first message has updated - so it will confuse some readers!!

I am going to see what happens as the tea cools to room temperature.  Meanwhle here's what it looks like at present - hopefully

history.png (600×400)

kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010
Graphs that come to life

These graphs now seem to have gone live - don't ask me how.  It means that they are somewhat useless for 

conveying the original point.

Kim 

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
Looks suspicious

Looking at my temperature readings, as the temp rises, I never see a .4 ... goes straight from .3 to .5

Same deal for .9 ... never see this.

Might well be an issue with the AVR code that implements the .1 degree piece. I'll get to looking at this once the current rush of orders is handled. It's been so busy that I've run out of PCBs. More on the way.

kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010
Thanks

I couldn't work out a way of making steady temperature rises.

Just for information I discovered that above 50 degrees only the 0.9 and 0.8 were high.  Below 50 degrees is was the 0.9 to 0.4 as described

before. 

For what its work if you have 0.125 resolution and count up 0.125, 0.250, 0.375. 0.5, etc You don't get a 0.4 or 0.9 if you just truncate the first decimal place.  May be the DS18b20 configuration register was set to 11 bits he said blindly.  Maybe just coincidence.

Final question before moving on - is the AVR code available anywhere? - couldn't see it on the wiki source - just curious again.

Now off to see if I can make the temperature sensor work over a long cable by playing with a pull up resistor.

Keep up the great work

 

Kim 

brett
Offline
Providence, United States
Joined: 9 Jan 2010
All source code is published

All source code for the project is hosted on google projects

The firmware for the AVR is written in BASCOM.  Oh yes another language you need to learn!  You'll find it in the path userapps/hah/xap-livebox/ It is possible that by default the 18b20 isn't initialized to 12bit as I dont' do this explicitly perhaps I should be, might be an AVR firmware bug.  If so I'll fix this in the up and coming ATmega328P revision that I'm working on.

Brett

kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010
Further thoughts

Hey what fun I have been having - found out that Bascom is really just Basic - and I know a bit of that!

Thanks for pointing me towards the code - had a look.  Downloaded the free compiler/simulator and extracted

the bit of code.  Then I made it run from 0 degrees upward comparing MSB and LSB hex in with the "Imeas" variable

and the printed output.  And guess what - at 25.6 degrees it went wrong - and at 51.2 degrees it went further wrong.

So I played with the bit of code for the decimal : Bi = Imeas Mod 10

and replaced it with my mickey mouse code:

    Temp1 = Imeas / 10

    Temp2 = Temp1 * 10

    Bi = Imeas - Temp2 

And now the simulator prints out the correct temperatures.

Do you think that may be it?  Most people's houses are below 25.6 degrees so it would not become apparent unless

measuring higher temperatures - like inside the box - or my cup of tea!

Anyway I have had great fun revisiting a long forgotten programming language - and maybe a bit of contribution rather

than just leaving you with more work.

Thanks for the feedback.  

 

Kim 

p.s. the 18b20 IS initialized to 12 bits on power up - page 3 first para of data sheet.

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Now there is something unexpected

With your code in mind, and especially those two number 25.6 and 51.2, which look just like a Byte overflow, I immediately saw what the problem is.

Consider the following code fragment.

Dim Bb As Byte
Dim Bi As Word
Dim Imeas As Word

Imeas = 256
Bi = Imeas Mod 10
Imeas = Imeas / 10
Print Imeas ; "." ; Bi

Imeas = 256
Bb = Imeas Mod 10
Imeas = Imeas / 10
Print Imeas ; "." ; Bb

End

And the result from running it in the simulator.

25.6
25.0

The Problem is that BASCOM is down casting its operands before performing the action.  Not on the assignment.

(256 mod 10) = 6

But bascom is screwing up and we get

(0 mod 10) = 0

As the 256 in the WORD is 1st cast back to a Byte BEFORE applying the MODULUS operator.  This is DUMB and totally unexpected which is why I've never noticed this before.

Thanks - Great detective work.  You get a gold star and a free 328 when we get this sorted.

Brett

kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010
Great

Thank you for the clear explanation.  I can now drink my tea without a sensor stuck in it!

Regards

Kim 

Hardware Info