Wook's solar heating system

In spring/summer 2008 I fitted a solar thermal system. These pages describe how that was done and discuss some of the design decisions.

The system is fairly conventional for the UK apart from the use of an external plate heat exchanger between the solar loop and the domestic hot water (DHW) tank and the use of an embedded GNU/Linux 1-wire-based control system. There are also a few other refinements from the norm in that a low-power 12V DC pump was used, no auto-air vent is fitted and the solar loop is done in 10mm copper.

Hardware

At some point I'll put up my full parts list, but in the meantime here's the main bits. The panels come from eco-nomical. The PHE (HE 110) came from Abcot, the pump is a Bosch/Davies craig model from ebay, the insulation and antifreeze came from Navitron, and most of the plumbing, including the expansion vessel came from B.E.S.. Electrics came from CPC.

Eco-nomical are a small engineering- and customer-service oriented company based in Upton-on-Severn that I enjoyed doing business with. I had a couple of parts that needed replacement and they were very helpful - it's when there are problems like that that you find out whether an outfit is any good or not. Worth collecting if you can, (as delivery on panels is expensive) which is fun in itself, to see their amazingly sheddy facility :-)

Abcot will charge you 25% extra if you don't supply a CORGI number, so I suggest making one up - they don't seem to check very hard. Cheapest place I could find to get a threaded PHE though.

Navitron supply lots of good-value renewable gear and run an excellent forum on renewable energy, particularly for DIYers. Their delivery price structure is such that delivery on small light orders is a bit steep. I later discovered that Climate Centres also stock Armaflex HT (in imperial sizes).

BES are mervallous for all plumbing stuff. Huge selection, next-day delivery, good prices, very reasonable delivery charges, and you don't have to buy 10 of everything like you do at screwfix.

CPC sell a huge range of electrical products, generally at very keen prices. Free delivery on orders over £40, and it's usually very easy to find 40 quid's worth of useful stuff. They will send you guff every week for the rest of your life if you ever buy anything though.

Online Logging

Due to advanced control system (see below), I have live-updated logging showing tank, panel and heat-exchanger temperatures for day, week, month, year.

The controller sends data every 5 minutes to the server which constructs the graphs. This can't happen unless my net connection is on, so sometimes there are gaps in the data.

For a while I generated graphs on the controller itself too, but found that the floating point in rrdtool tended to give the board a headache and the kernel out-of-memory killer was having to nuke the graphing process every few minutes. The board/OS continued to run remarkably well under these terrible conditions (it never crashed), but the owfs server did sometimes get 'stuck' giving no temp readings, which of course stopped it doing much useful. So now I'm not doing that anymore and the system is rock-solid.

What is really needed is a store-and-forward system, wheere the data is logged, and then sent online when the net connection appears so that there are not gaps in the record when the external net connection is down. I am hoping temploggerd will provide this functionality, but I haven't tested it yet.

Pictures

You can see pics of the install here, which should be referred-to alongside this text.

Design and construction details

I'll add more details on why it is designed like it is, and how it was put together here sometime...

Controller

I didn't want to pay GBP100 or so for a standard solar controller which is nothing more than a simple box to compare two temperatures and turn the pump on if one is higher than the other (with a bit of hysteresis). Clearly this is a trivial computing problem, and by using a more flexible box I could monitor a large number of temperature sensors and control over the software would let me experiment with control algorithms.

I decided to use a balloonboard with a CUED IO board, as I have them available (I work on balloons for a living), and whilst arguably overkill for this application it makes development of the system very easy. The best way to get flexible temp sensing that isn't unreasonably expensive is Dallas 1-wire bus. Each sensor is about GBP 3 and I can have up to hundreds of them.

The one-wire is interfaced to the balloon over its I2C bus, and wiring done with ethernet cable. IO (for pump switching) is done with digital IO multiplexed over I2C.

The Balloonboard uses about 2W when running flat out, and has similar performance to a desktop PC of a few years ago. It runs at 500Mhz, has 256MB of RAM, and 1GB of flash storage. There is also a CF slot and a USB slot for pluggin in more storage if needed. It runs standard Debian GNU/Linux (arm architecture) so there is a huge range of software pre-built for it.

Controller Hardware

A DS2482-800 chip multiplexes 8 1-wire busses onto I2C and deals with all the tight timing requirements. Having several busses (wires) like this makes for flexible wiring round the house. I was suprised to find that 1-wire doesn't have a wiring standard of any sort - people use various things. I chose cat-5 network cable as it is cheap, its twistedness should help keep the 1-wire reliable, and it contains spare cores for such things as 12 or 24V control supply.

External access and logging is over ethernet. This is done with a USb-to-ethernet adaptor plugged into the Balloonboard's USB port. These can be had for as little as 3 quid, although spending over a tenner gets you a more reliable one.

The digital IO could be done over 1-wire like the temp sensing, but as the CUED IO board has an 8-channel digital IO driver on its I2C bus (a pcf8574a) it makes sense to use that. This device can drive 45mA and pulls a pin low for 'on'. It's IO pins can serve as inputs as well as ouputs without specific configuration. 45mA is nothing like enough to drive a pump (mine draws 0.9A at 12V) so some suitable circuity is needed. A TIP32 and a small relay does the trick, although isnot the lowest-power solution.

The DS2482 1-wire multiplexer and the pump-switching hardware is laid out on a veroboard. A real PCB may get made when the design settles down.

The solar loop inlcudes an electronic flowmeter (swissflow 800). This is yet to be wired up (I haven't yet got the socket needed). Once this is done we will know more about the energy transfer rates. The meter generates 6100 pulses per litre. At the 24l/minute max rate of the pump that is about 2,5Khz pulse rate. This could either go directly into one of the digital IO lines for counting or a 1-wire counter chip. I supect neither of these can count reliably at 2.5Khz so some dividers will probably also be needed.

Controller Software

There are various parts to this - basic control, 1-wire access, IO access, logging, user feedback. Things are currently in a working, but very preliminary state. I have not yet decided wether the board should run it's own web-server for displaying data, or if that function should be given to another machine somewhere. In the interests of reliability I am inclined to minimise the number of functions running directly on the balloon. HAving your central heating controller networked is also something of a double-edged sword. It allows remote control, but it also exposes the box to the dangers of the net.

Basic control is currently implemented with a shell script which interrogates the temp sensors, decides what the pump state should be andlogs the results, to both the screen and the logging database. This is a lot simpler than it sounds, and whilst it works fine is not very flexible in terms of allowing run-time paramter changes or doing sums. The shell script is run in a screen session so that it continues to run after I log off. For reliability there should be a load of monitoring going on to ensure that this process gets restarted if it ever dies.

1-wire access uses OWFS (one-wire filesystem) which is very nice software. You tell it what device it will find the bus(es) on (I2C, serial, USB) and then can read the bus using shell commands, perl, tcl, python (anything supported by SWIG in fact).

IO access is done directly via the pcf8574 kernel module. This presents a file in the /sys filesystem to which a bit pattern can be written whichwill set the output states. Low tech, but it works.

Logging is done with rrdtool (Round Robin Database tool). This is a marvellous bit of software that lets you set up a database containing a number of readings as specified resolutions for a given period. The readings wrap round so the database always has a fixed size. Currently Panel temp, top-of-tank temp, bottom-of-tank temp and pump on/off are logged with 40-second resolution, for a week which takes about 200K. The Balloon has about 700MB free so could store over 60 years data at this rate.

Currently graphs are generated by rrdtool and uploaded over ssh to my public web-server. The ablloonboard could run it's own web-server displaying these directly but I'm not convinced that is actually a good idea. Another script with slightly different graphing paramters generates daily graphs from 5am to 5pm which is the period of interest. Again this all needs properly automating so that these readings are kept for posterity and analysis.

Munin is a very good tool for logging and I may move to that rather than a custom RRDtool configuration in due course. It also makes it very easy for the data to be stored elsewhere (e.g. on the web-server)

The User Feedback part of this is currently not designed at all. The Baloonboard can have a VGA LCD display plugged in to display current status in a user-friendly form, but I haven't done any of this yet. It would be nice to be able to find out the tank temp without having to ssh into the box so something here is definately due to happen.