Home
Various Maps
Web Cam
Solar Power Stats
Power Monitor
Temperature Mon
Live Temperature

Rasp Pi 1

Rasp Pi 3

Rasp Pi 4



Amend

LS
EL
PB
CP
LB
16
17

0
331.99
15.00
0.00
265.00
752.00
765.00

0
41.50
0.00
0.00
0.00






Experimenting with Temperature Sensors


So, it's Jan 2015 and having spent years unsuccessfully trying to do this with PIC microprocessors et el, the whole idea is now made a lot easier by the Raspberry Pi platform. And where I was looking at analogue sensors and doing AD conversions, you can (now) use a digital temperature sensor, so removing that extra bit of fiddling/processing.

The Raspberry Pi costs about 30, and you also need an SD card and powersupply, so call it nearer 50. The sensor is a DS18B20 and can be purchased in the UK for about 9 for 5. There is an article in the MagPI Magazine that covers most of the topic quite well.

I have a few monitoring idea's in mind and purchased 5 sensors to prove the package works. It was surprisingly easy, connected up one sensor, ran the software and hey presto, got a temperature reading. Connected all 5, and got 5 readings.

Some Gotha's
Everything when swimmingly while I did some experimenting. OK - I'm lying. During the initial testing with 5 sensors, I was occassionally getting a weird value, namely t=-62. It took a bit of browsing but eventually I found that this is a response when the sensor hasn't completed a conversion. Writing a loop got me out of this, but obviously adds overheads, and we all know that the Raspberry Pi isn't designed to crunch numbers, so any saving of processing cycles is beneficial, not to mention good programming skills. I was getting the about 2.6% readings failing with the -62 (5 sensors every 5 minutes, a total of 3510 readings / 94 failed).
Writing the loop stopped this and for a test I wrote a loop count to see how often the loop was invoked and whether it was needed more than once). The answer was that when the reading failed, a second read was usually sufficient, but I did see the very occassional 3rd attempt.

2nd Gotha, was adding additional sensors. Having got 5 working nicely and capturing data (see lower down), I ordered a further 10 sensors, a total of 15. 2nd GOTHA, the Raspberry Pi software appears to have a limitation of 10 sensors. This isn't a sensor/one wire limit so it must be in the debian modules. There appears to be a work around, but I need to do a bit more surfing before trying that.

3rd Gotha, was getting a reading of t=85000. This was a bit of a fools errand on my part. Because the Pi had knowledge of all 15 sensors, when I tried to get the reading from a disconnected sensor, it for some reason returned the value 85000.

Testing
Now that we have a working installation, we need to validate the information we are being given. There are a number of things that can be done. How accurate are they is the first question. I don't have a calibrated thermometer, so proving exactly that they are absolutly spot on is not that straight forward. The specification of the sensor is supposed to be 0.5 of a degree. So if they are all giving the same reading then we have a base line for any readings that we work with moving forward.
To confirm this, I put all ten in a jiffy bag, sitting on my work bench and monitored the temperature over a few hours. Took the results and put them through a spreadsheet, the difference between the ten sensors over 470 sets of readings was from 0.375 to 0.625 degrees, so well within the tolerence they are supposed to have.

Another test was how long a cable could be used. Using a drum of cable, I found the system failed, but changing the 3.3V supply to 5V resolved this problem. So, somewhere between a short distance and a long distance, I would need to use the higher voltage. I suspect more on this later.


Having got the fundamentals sorted out, and before I end up with my finished product (whatever that might be). The next phase is to see what it can do and how I can do it. Obviously having a hundred or so temperature sensors on a single 'one-wire' circuit isn't going to work as it stands, and that's without even trying to work out how to run the necessary cables. So, while I mule over those two conundrums, do some further testing. I had a few idea's in mind before I started and I expect a few more to present themselves as this project progresses.

The first test was not one I had originally thought or planned on, but was quite a good first test. Although the link below goes to another page, I haven't got it all tied together yet. The second test was a variation of something I was thinking about as part of the finished product, namely temperature sensors in all rooms perhaps with the radiator sensor as an extra.

Other idea's I want to try is monitoring the hot water tank, have a 3 or 4 sensors on the tank, a sensor on the boiler flow in and one on the out flow. I was going to do this in conjunction with another test, but the limit of ten sensors has caused me to break this up a little.

The test currently underway is the loft test using 4 sensors. This test came about due to the ever increasing loft insulation being done/required. The normal (old way) of fitting the header tanks in the loft is to put them vaguely over the airing cupboard where the hot water tank is. Under the old ideas, hot water tanks weren't lagged and heated the airing cupboard. That in turn escaped through the ceiling into the loft directly under the header tanks and thereby stop them from freezing.
So, with the ever more increasing insulation on both the loft and the hot water tank, less heat is 'escaping' to the loft, and therefore possibly making header tanks more susceptible to freezing. My test is to monitor the temperature 'up there'. The DS18B20 as purchased are water proof, so I have placed one in the hot water header tank, one in the boiler water header tank, one in the loft near the header tanks and the fourth one sitting on the floor of the loft over the airing cupboard and under the header tank. At this time of year (Jan 2015), the outside temperature is expected to get below freezing a few times, so I just hope that the weather holds and a real test is done. That would be a few days, where the temperature doesn't get above freezing, not an uncommon situation for most of the UK at some point in the winter.

Another test I want to try is monitoring the boiler temperature itself (flow in and out of the boiler), and somehow combine it with a radiator and hot water tank set as well. This will require more than ten sensors (gotha number 1) and wiring between the locations.







Test number 1 - Conservatory underfloor electric heating
Test number 2 - Central heating radiator
Test number 3 - Loft Monitoring