EcoRenovator  

Go Back   EcoRenovator > Improvements > Appliances & Gadgets
Advanced Search
 


Blog Register 60+ Home Energy Saving Tips Recent Posts Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Display Modes
Old 09-25-12, 03:55 PM   #1
opiesche
Helper EcoRenovator
 
Join Date: Jul 2012
Location: Rohnert Park, CA
Posts: 99
Thanks: 4
Thanked 14 Times in 9 Posts
Default Custom hydronic heating controller

Hi all,

I've recently installed DIY hydronic floor heating in the ground level of my house (http://ecorenovator.org/forum/renova...tallation.html), although it's not yet in operation, and am now working on the controller stage of this. Vlad suggested I put that part in a separate thread, so here it is

Generally, it's a standard PEX-under-hardwood installation. I plan on using a standard water heater and hydronic circulation pump with water somewhere around 85F. In order to figure out what pump and heater I need, and generally get a better idea of the thermal characteristics of my house, I've custom built a temperature logger.

It consists of a Raspberry Pi with two DS18B20 temperature sensors, and a few custom python scripts. One sensor is outdoors, the other indoors. The python scripts sample temperatures every 5 minutes, log them with a timestamp, and generate plots of the data:




I'm currently working on also getting heat loss information out of the data. Since I know the total volume of air in the house, and the temperature delta between samples, it's fairly simple to calculate heat loss in BTU/h.



Once I've collected a couple weeks worth of data, I should be able to use it to figure out exactly how many BTU per square foot I'll have to output, which should help me predict a needed water temperature and flow rate (leading to a choice in water heater and circulator).

I the near future, the Raspberry Pi will get a couple more interior sensors in different locations, and also turn on and off the circulation pump via a relay based on a variety of parameters. When I know the lag of the system, I should be able to predict very well when to turn on and off the pump based on interior-exterior temperature differential (which seems to be directly proportional to heat loss), to keep interior temperatures comfortable.

The Pi is web accessible through a USB WiFi adapter, and I plan on making the whole thing configurable through a web interface, so I can change parameters on the fly and get live plots of temperatures and the performance of the system. Over time, the software could even learn and adapt its parameters automatically, to end up at the most stable configuration for interior temps, as well as deal with unexpected spikes (such as opening the front door to take out the trash) without going into overdrive and also keeping efficiency of the system in mind.

I'm also putting the whole process on my blog as I go along.
Adventures in home improvement

Any suggestions as to what features would be good to have in a controller software like this? I'd like to hear some thoughts

Thanks,
Olaf


Last edited by opiesche; 09-26-12 at 12:15 AM..
opiesche is offline   Reply With Quote
The Following User Says Thank You to opiesche For This Useful Post:
philb (10-10-12)
Old 09-26-12, 11:21 AM   #2
Daox
Administrator
 
Daox's Avatar
 
Join Date: Aug 2008
Location: Germantown, WI
Posts: 5,471
Thanks: 1,110
Thanked 367 Times in 298 Posts
Default

Very neat project! I plan on doing something quite similar as I add more hydronic floors to my house.

Do you have multiple heating zones for the house or is it a single zone?
__________________
Current project -
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
&
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

Last edited by Daox; 09-26-12 at 11:48 AM..
Daox is offline   Reply With Quote
Old 09-26-12, 11:31 AM   #3
strider3700
Master EcoRenovator
 
Join Date: Dec 2008
Location: Vancouver Island BC
Posts: 745
Thanks: 23
Thanked 37 Times in 30 Posts
Default

How is the rasberry Pi to work with? My arduino project has stalled due to the clone main board not working correctly with the ethernetshield. For the price of the Pi I'm thinking I'll just get one of them and start over with wifi...
strider3700 is offline   Reply With Quote
Old 09-26-12, 03:30 PM   #4
opiesche
Helper EcoRenovator
 
Join Date: Jul 2012
Location: Rohnert Park, CA
Posts: 99
Thanks: 4
Thanked 14 Times in 9 Posts
Default

Quote:
Originally Posted by Daox View Post
Very neat project! I plan on doing something quite similar as I add more hydronic floors to my house.

Do you have multiple heating zones for the house or is it a single zone?
I've got multiple zones (4 on the ground floor) - the floor plan is open enough that I think I can get away with using manual valves to balance the system, and use the controller just for managing the total input, though.
opiesche is offline   Reply With Quote
Old 09-26-12, 03:42 PM   #5
opiesche
Helper EcoRenovator
 
Join Date: Jul 2012
Location: Rohnert Park, CA
Posts: 99
Thanks: 4
Thanked 14 Times in 9 Posts
Default

Quote:
Originally Posted by strider3700 View Post
How is the rasberry Pi to work with? My arduino project has stalled due to the clone main board not working correctly with the ethernetshield. For the price of the Pi I'm thinking I'll just get one of them and start over with wifi...
It's really neat. With a cheapo USB WiFi adapter, I can stick it into any location, have it connect to my wireless network, and do all programming and tweaking by logging into it via SSH (or choice of web based IDE on top of Apache), use a web server on it for data access and (soon) web based configuration, and generally everything else you can think of doing with a network connected computer

As for the GPIO, there's no direct W1 support (I2C works though), but there's a custom kernel with a bitbanging driver that pulls the data from W1 devices. I get a dropout of the sensor every few hours (where it just reports 0 degrees C) - not sure if that's due to the driver, the sensor, or my wiring, but it's easy enough to recognize and clean up in the software.

Being able to pick your programming language is also a blessing. I'm doing most of this in Python because it's really quick to develop this sort of thing in, and there really aren't any processing heavy, time critical tasks.

All in all, it's been very pleasant. In some ways, almost too easy
opiesche is offline   Reply With Quote
Old 10-03-12, 11:08 PM   #6
pedro
Lurking Renovator
 
Join Date: Oct 2012
Location: Indy
Posts: 12
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Just wanted to say thanks as I looked at these a couple months ago but they were out of stock. Saw your thread and decided to check again. In stock so I ordered one. The first night I just kinda played with it.

The second night I have it polling a close local weatherunderground.com weather station's xml data and using a DHT22 temp/humidty sensor for indoor data that I got with my Arduino stuff. Got it uploading outside and inside temp/humidity to a google docs spreadsheet. It really is an amazing device. Next is to get it to interface to some cheap off the shelf wireless sensors that I originally intended to do with some Arduinos. Wasn't sure how to store data with those so this thing is just amazing.

I hooked it to an HDMI TV with full mouse and keyboard and the GUI desktop isn't a bad websurfer. At 2.5 - 3 watts you really can't beat it and I am no pro at linux and never done python until last night.
pedro is offline   Reply With Quote
Old 10-04-12, 01:34 AM   #7
opiesche
Helper EcoRenovator
 
Join Date: Jul 2012
Location: Rohnert Park, CA
Posts: 99
Thanks: 4
Thanked 14 Times in 9 Posts
Default

A little progress to report: I've started on the web interface for the controller. I can now change settings such as the target temperature, various controller options, or building parameters (for the heat loss calculation) via a web site served from the Raspberry Pi directly.
The software running in the background (which, at the moment doesn't do much other than measure and log temperatures and calculate heat loss), then picks up these settings and uses them.





Next step, getting the calculations in and running a continuous measuring and adjustment loop. I'll probably run this simulated for a few days (where the controller thinks it turns on and off the pump) to tune the math and parameters. I also want to add a page to the interface and corresponding capabilities to the backend, so I can add temperature sensors and they're auto-detected and can be named.

Last edited by opiesche; 10-04-12 at 01:37 AM..
opiesche is offline   Reply With Quote
Old 10-14-12, 09:54 PM   #8
compman723
Lurking Renovator
 
Join Date: Oct 2012
Location: MSP
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
Default

opiesche you are doing some awesome work! I found your post after I thought about making my own controller myself. Let me know if you want to collaborate or maybe I can continus to help you add features to you what you have? I recently just installed the sandwhich system myself under 500 sqft of tile and am looking for a setup myself.

Thanks!
compman723 is offline   Reply With Quote
Old 10-14-12, 11:08 PM   #9
opiesche
Helper EcoRenovator
 
Join Date: Jul 2012
Location: Rohnert Park, CA
Posts: 99
Thanks: 4
Thanked 14 Times in 9 Posts
Default

Quote:
Originally Posted by compman723 View Post
opiesche you are doing some awesome work! I found your post after I thought about making my own controller myself. Let me know if you want to collaborate or maybe I can continus to help you add features to you what you have? I recently just installed the sandwhich system myself under 500 sqft of tile and am looking for a setup myself.

Thanks!
Absolutely!

So, here's what I'm currently thinking. I've got the sensors polled by a python script every 5 minutes (could make that configurable) to read temperatures and calculate heat loss. That data is then written to a file (I was considering a SQL database, but since it's just a few values, that would be overkill).

A second python script functions as a web backend. It accepts data from the forms posted above, and also writes the values to a file.

A third python script would be the actual controller software. This one will probably run in a continuous loop and read the values from the files the other two scripts write, periodically, to make decisions about turning on and off the pump or opening and closing a mixing valve. The pump and mixing valve would be controlled through a relay (see the heating system post for the type of valve actuator I'm looking at).

Aside from using the manually configured value, the controller also has the ability to learn a bit. For example, for any given system, it should be possible to correlate turning on or off the pump or increasing/decreasing the water temperature, with an increase in temperature on the different sensors. With that, we know how much delay the system has (depending on thermal mass, etc).
We can use that data and the current heat loss and interior temperatures to predict a good time to turn on the pump. For example, let's say the target temp is 70F. As long as the temperature is above that, or if it is below but we have a large heat gain (e.g. from the sun), we probably should keep pump and mixing valve off/closed.

Conversely, knowing the heat loss and the delay of the system, the controller can predict when the temperature will drop below 70, and turn on the pump early enough (taking the delay of the system into account) to compensate.

Even further, if we have one internal sensor for each zone, the controller can tell how temperatures react zone by zone, and suggest further opening or closing of the zone valves (for example when one zone reacts later or slower to turning on the heat).

I'd like to also take supply and return water temperatures into account for this, but I'm currently not completely sure what to do with those values. Primarily, the controller could use them for validation of its assumptions about the heat loss, and about what results a parameter adjustment would have.

I guess all in all, I'm looking for an algorithm and the proper equations to do the prediction, and to be able to adjust its own parameters (pump timing and supply temperature) based on the data it reads.


The final feature I was thinking about was to ignore errant heat loss spikes. If we have a sudden spike in heat loss with a corresponding drop in temperatures (especially if it only happens in one or two zones), it's likely that it's just because someone opened the door, say, to bring the trash out. In that case, we could remember the spike time, and adjust water temperature and pump cycling to balance out the loss once the spike is over. Only if the spike lasts more than, say, 5 minutes, we assume that it's regular heat loss and not an open door, and adjust parameters to get the temperature back up. My old furnace had this problem with a regular thermostat - someone opens the door, the furnace turns on and keeps going for 10 minutes even after the door has been shut, leading to it suddenly being too hot everywhere else, and a bunch of wasted energy.

Not much of the controller part is present in actual code yet, but I expect to have a bit of it running in a simulated loop within the next couple of days.
My pump has been ordered and should arrive next week, and I'm getting a water heater installed on Tuesday. Once both are installed, I can trial run the system proper and see what it does
Once I've got a small bit of the controller loop up and running, I'll post the code. Since some of the more detailed discussions might be out of the scope of this forum, send me an e-mail if you'd like (opiesche at gmail dot com) so we can discuss the nitty gritty, and we can post regular updates to this thread
opiesche is offline   Reply With Quote
Old 10-15-12, 05:02 PM   #10
pedro
Lurking Renovator
 
Join Date: Oct 2012
Location: Indy
Posts: 12
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by opiesche View Post
That data is then written to a file (I was considering a SQL database, but since it's just a few values, that would be overkill).
You might look at using RRDTool for your database. I have installed it but haven't got a chance to play with it yet. Seems perfect for the R-Pi.

oss.oetiker.ch/rrdtool/index.en.html

Can't post links yet.

pedro is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:34 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Ad Management by RedTyger
Inactive Reminders By Icora Web Design