Raspberry PI and OneWire temperature sensors

manifold-2014
We have installed underfloor heating in our House-on-Hudson, there are 14 independent loops, of various length, and one circulation pump. Two Manifolds with individual valves connects the input and output for each loop, each have a very bad flow-meter, and possibility for a motor-valves. Hence it would be possible to control the heat delivery independently for each loop under computer control, if you so desire, I don’t (at the moment).

Normally what people do is to tune the system once, when it is installed, so that heat is distributed evenly to all loops, using the flow meters as guide. I do this by adjusting the system so that the return temperature on all the loops will be more or less the same. This has the added benefit that the temperature of the water returning to the boiler is as low as possible, on a condensing-boiler, this gives a very good economy.

I read the temperatures with 14 ds18b20, you can get them on amazon or ebay for less than $2 a piece, The brain is a Raspberry Pi $20-$35 (any A/A+/B/B+ will do), USB wifi $3 on Ebay, SD-card $5, USB-charger $5. The total is less than $60. If you want a screen on it too, a 4.3″ car dvd-lcd will set you back less than $15.

Linux and the Raspberry Pi has good support for one-wire devices, just connect them to the right pin, all in parallel, add a pullup resistor and the hardware part is done with.

For the software, I like to do most of my work on the commandline, using one-liners, It is amazing what you can do in one line. Let us play around a bit:

You see 14 sensors, the temperature on the first one is 20 degree Celcius.

I have made a little script which also does a little data-compression, in a still human-readable way. The main reason is that if there is activity on a single sensor, it is easy to spot.

Here is how the output looks like

You see that every 11-12 seconds a new set of values is ready, and not much is changing, only sensor 39e2 has changed more than half a degree Celcius.

Below decoder in awk, and the result:

This little awk-script will format it even more human readable

Print Friendly, PDF & Email
This entry was posted in Linux. Bookmark the permalink.