rooster
Posts: 100
Joined: Thu Aug 02, 2012 8:09 pm

RPi controlled central heating

Tue Aug 14, 2012 12:03 pm

Hi

I've been using my RPi as a car computer and that's easy - just software! But electronics is like magic to me. I want to make my RPi control my heating system. It seems the easiest way is to take out my room thermostat (which is mechanical and just breaks the 240 V circuit when the temperature exceeds a set point) and replace with some sort of relay which is controlled by one of the output pins of the GPIO.

I know how not to electrocute myself and how to use a multimeter - and I did some soldering 20 years ago. But I need to know a) what sort of relay I would need b) how to control from GPIO c) how not to fry my RPi whilst doing it!

Thanks in advance!

R

idaadi
Posts: 7
Joined: Thu May 24, 2012 1:15 pm

Re: RPi controlled central heating

Tue Aug 14, 2012 12:12 pm

From what I know , you need an external board to interconnect and use with the Rpi because there aren't any protections on the pins and you could damage it easily...

Second , to read anything you should need an Analog-Digital-Converter(ADC) present on that board , depending on what you want to implement.
For testing you can buy a gertboard and play with it , and then get one specialized on the tasks you want.

BR

Hugh Jarse
Posts: 46
Joined: Mon Mar 05, 2012 5:03 pm

Re: RPi controlled central heating

Tue Aug 14, 2012 12:43 pm

rooster wrote:Hi

I've been using my RPi as a car computer and that's easy - just software! But electronics is like magic to me. I want to make my RPi control my heating system. It seems the easiest way is to take out my room thermostat (which is mechanical and just breaks the 240 V circuit when the temperature exceeds a set point) and replace with some sort of relay which is controlled by one of the output pins of the GPIO.

I know how not to electrocute myself and how to use a multimeter - and I did some soldering 20 years ago. But I need to know a) what sort of relay I would need b) how to control from GPIO c) how not to fry my RPi whilst doing it!

Thanks in advance!

R
I think this means you need to be able to measure the temperature compare it with a setpoint and then turn 240v on or off. To read temperature in buildings I have used TMP36 devices in the past (usually with microcontrollers) and they are easy to setup and use, and cheap (see http://proto-pic.co.uk/tmp36-temperature-sensor/). However as idaadi points out you will need to organise some AtoD to read it. Since a relay seems like a good option to turn the power on and off (opto isolators may be another), Gertboard (having both ADC and Relays) would seem like a plan.

Note that probably the most important thing to do is determine how many amps you need to switch and then check that your switching method can cope with this. Watch those wigglies, they bite.

rooster
Posts: 100
Joined: Thu Aug 02, 2012 8:09 pm

Re: RPi controlled central heating

Tue Aug 14, 2012 10:37 pm

idaadi wrote:From what I know , you need an external board to interconnect and use with the Rpi because there aren't any protections on the pins and you could damage it easily...

Second , to read anything you should need an Analog-Digital-Converter(ADC) present on that board , depending on what you want to implement.
For testing you can buy a gertboard and play with it , and then get one specialized on the tasks you want.

BR
Thanks - 2 gertboards ordered - waiting time 2 months I think :(

rooster
Posts: 100
Joined: Thu Aug 02, 2012 8:09 pm

Re: RPi controlled central heating

Tue Aug 14, 2012 10:42 pm

I think this means you need to be able to measure the temperature compare it with a setpoint and then turn 240v on or off. To read temperature in buildings I have used TMP36 devices in the past (usually with microcontrollers) and they are easy to setup and use, and cheap (see http://proto-pic.co.uk/tmp36-temperature-sensor/). However as idaadi points out you will need to organise some AtoD to read it. Since a relay seems like a good option to turn the power on and off (opto isolators may be another), Gertboard (having both ADC and Relays) would seem like a plan.

Note that probably the most important thing to do is determine how many amps you need to switch and then check that your switching method can cope with this. Watch those wigglies, they bite.
Thanks! I have a couple of temp USBs lying around which I might try but will follow your advice on the tmp36 sensors for when my gertboards come.

In the meantime does anybody know a generallist relay that would be powered by the (3.3V?) GPIO that would turn on/off the 240V? I don't know the exact wiring diagram, I always assumed the thermostat was wired in a way that the boiler/programmer knew if the circuit was open or closed rather than in series with the pump or anything.

Cheers

R

eldiabolosk
Posts: 15
Joined: Wed Aug 15, 2012 12:27 am

Re: RPi controlled central heating

Wed Aug 15, 2012 4:12 am

Like your idea. I am a newbie and I know nothing about relays. Sorry. I am Linux savvy. What USB sensors did you use with success? I need them for the same application as you.

Thanks for help.

Ed.

fruitloaf
Posts: 84
Joined: Sun Feb 05, 2012 11:41 am

Re: RPi controlled central heating

Wed Aug 15, 2012 7:15 am

Hi,

I'm actually planning to do the same thing. It looks like you have a combi boiler or just want to control heating and not hot water though (I want to do both and have a traditional boiler). Looking at the specs of our existing programmer its rated at 2A and the thermostat is as you thought just opening the circuit to turn the heating off.

Since I want to control water I'm planning on replacing our programmer rather than the thermostat using a relay board like http://www.ebay.co.uk/itm/2-Channel-DC- ... 163wt_1045 to tap into the existing wiring. I'll keep the existing thermostat in place as its the timings we want to be able to automate not the temperature.

Hugh Jarse
Posts: 46
Joined: Mon Mar 05, 2012 5:03 pm

Re: RPi controlled central heating

Wed Aug 15, 2012 8:51 am

Probably a good idea to understand the basics of your circuit (e.g Y plan, S plan etc) but in short the roomstat is usually used to drive the motor in the valve (depending on your CH setup), see http://wiki.diyfaq.org.uk/index.php?tit ... and_Zoning.

rooster
Posts: 100
Joined: Thu Aug 02, 2012 8:09 pm

Re: RPi controlled central heating

Wed Aug 15, 2012 5:10 pm

eldiabolosk wrote:Like your idea. I am a newbie and I know nothing about relays. Sorry. I am Linux savvy. What USB sensors did you use with success? I need them for the same application as you.

Thanks for help.

Ed.
I bought a couple of USB temp sensors of amazon a few years ago. Don't know the brand and I only got them to work on windows. Will update here if I get them t work on linux.

R

chickey
Posts: 63
Joined: Thu Jan 05, 2012 11:17 am

Re: RPi controlled central heating

Sun Aug 26, 2012 8:26 pm

Hi guys, I've been thinking of replacing my Honeywell controller for my combi boiler with a Pi and wireless temp monitoring using xbee but I was hoping to interface as the Honeywell does which is via zero volt controls, that sounds like magic to nick the OP line. Anyone got experience of these?

Col

User avatar
jackokring
Posts: 816
Joined: Tue Jul 31, 2012 8:27 am
Location: London, UK
Contact: ICQ

Re: RPi controlled central heating

Sun Aug 26, 2012 8:33 pm

Look up "solid state relay" and maybe you'll find a cheap 240V/3KW box that needs 12V to switch. It may switch using less volts, and does provide mains isolation. This still needs to be wired with care, and a good understanding of the dangers that electricity presents. Including unexpected failure due to acts of god, curious children and natural disaster.

Cheers Jacko
Pi[NFA]=B256R0USB CL4SD8GB Raspbian Stock.
Pi[Work]=A+256 CL4SD8GB Raspbian Stock.
My favourite constant 1.65056745028

mehran
Posts: 2
Joined: Mon Aug 27, 2012 10:08 am

Re: RPi controlled central heating

Mon Aug 27, 2012 10:31 am

hi, i am heating engineer.

first off, its a great idea to try and replace a simple mechanical room stat with a computer controlled relay. coming from the heating side towards the electric side of things you can do much much more then just a simple on/off room stat with the pi.

i would think about how you would control the heating heat up rate and try and come up with other factors that would affect the heating.

for example. Honeywell use something called TPI (Time Proportional & Integra). basically if you break down the time in to 10 minute blocks then tpi would have heating on for 9 mins then off for 1 min. then as it gets closer to the set point(the temp you set) it would go 8on/2off, 7on/3off, 6on/4off.....1on/9off.

it would also would fire up even when it at the set point, too maintain the set point. if you could combine this with other external factors like the outside weather/ temp you could tune the heating to have a more aggressive ramp up in cold weather and a more gentle ramp up in mild weather.(or even pre-empt you feeling cold by switching the heating on even if its been set off)

there is loads and loads of stuff you could do just by being clever with the software.

replacing the a y/s plan holds even more. no guess what I will be doing with the pi ...

intelligentheating
Posts: 12
Joined: Mon Aug 27, 2012 12:29 pm
Contact: Website

Re: RPi controlled central heating

Mon Aug 27, 2012 12:43 pm

I'm currently building a home heating system using a combination of Arduinos, Postgresql database server (running on Ubuntu) and a Raspberry PI as a central controller.

If you are interested you can check my blog out here:
http://intelligentheating.wordpress.com

The Arduinos are basically going to be replacing the thermostats and controlling the baseboard heaters. They will then post data back via HTSQL (database queries over HTTP) to the Raspberry PI, which will then forward the data to a Postgresql database.

The Raspberry PI, will then be able to data mine the historical temperature data and optimize the the temperature/zoning in the house, by communicating back to the Arduinos and telling them when to shut on/off and what temperature to be set at.

Eventually I'll be able to communicate with the system over my smart phone and tablet, to manually change the temperature if I so wish.

If it helps here is some of the equipment/software I am using:

1.) Arduino Uno boards
2.) Temperature sensors
3.) TFT touch screen shields
4.) Wireless shields
5.) WI FI router
6.) PC running Ubuntu and Postgresql
7.) Raspberry PI
8.) MakerBot 3D printer, for printing out RPI and Arduino cases
9.) HTSQL
10.) Software for running the algo to optimize heat (probably will be written in C or C++)

Good luck with your project.

Nitrogen_Widget
Posts: 38
Joined: Tue Aug 28, 2012 5:52 pm

Re: RPi controlled central heating

Tue Aug 28, 2012 6:15 pm

Hello,
I'm thinking of doing something similiar for my Hot Tub & deck lights.
It's an old Tub I picked up used with a mechanical timer & old relays.
I don't know how long the old unit will last but a Pi watching temps & controlling the pumps & heater seems doable.
I'd prefer not to use any type of proprietary hardware just because of the added cost.

And a web interface to turn on the heater & LED deck lights from anywhere would be nice also.
So i'll be following this thread.

also I did find this link on using cheap ebay usb temp sensors with Linux.
It might help someone out.

http://bailey.st/blog/2012/04/12/dirt-c ... ng-system/

chickey
Posts: 63
Joined: Thu Jan 05, 2012 11:17 am

Re: RPi controlled central heating

Wed Aug 29, 2012 9:13 am

Hi Mehran, i was hoping to plan in some of these features in the server side of things. I'm planning on running a server which will have at least a 14 day timer/scheduler which fits in with my life and possibly an iPhone app to control the heating remotely. My quandry is with the the Pi/sensor/Relay placement, i have two options.

I can place the Pi and relay in the utility room which has the combi boiler in it and then use a wireless temp sensor such as the Xbee XRF wireless RF radio and measure the temp in the main lounge using that.

The other alternative is to put the pi on the wall in the lounge mounted inside a case with an LCD screen and a few buttons for up and down on the front and then use the Xbee setup but have a relay on the remote Xbee next to the boiler which can then flick the boiler on and off. I've need to do a temp sensor on the pi but i've seen a few people do that via the GPIO pins pretty cheaply.

It seems logical to me although a bit daunting of where to start first.

Col
mehran wrote:hi, i am heating engineer.

first off, its a great idea to try and replace a simple mechanical room stat with a computer controlled relay. coming from the heating side towards the electric side of things you can do much much more then just a simple on/off room stat with the pi.

i would think about how you would control the heating heat up rate and try and come up with other factors that would affect the heating.

for example. Honeywell use something called TPI (Time Proportional & Integra). basically if you break down the time in to 10 minute blocks then tpi would have heating on for 9 mins then off for 1 min. then as it gets closer to the set point(the temp you set) it would go 8on/2off, 7on/3off, 6on/4off.....1on/9off.

it would also would fire up even when it at the set point, too maintain the set point. if you could combine this with other external factors like the outside weather/ temp you could tune the heating to have a more aggressive ramp up in cold weather and a more gentle ramp up in mild weather.(or even pre-empt you feeling cold by switching the heating on even if its been set off)

there is loads and loads of stuff you could do just by being clever with the software.

replacing the a y/s plan holds even more. no guess what I will be doing with the pi ...

fruitloaf
Posts: 84
Joined: Sun Feb 05, 2012 11:41 am

Re: RPi controlled central heating

Wed Aug 29, 2012 9:24 am

I've finally got my Pi ready to control my heating. I've got the software written, the backend has been working fine for the past three days and the front end works well enough on my phone/laptop and tablet though it needs a few bits of polish.

The hardware consists of my Pi, a 16x2 LCD just for instant display feedback, a couple of switches so I can boost the heating manually if needed and a relay board.

I'm planning on simply replacing the existing controls at the boiler (well leaving them in place and off as a backup but tapping into their wiring). For now I'm just leaving the existing wired thermostat in place as its timings I'm more interested in controlling than temperatures. We have TRVs on all our radiators anyway to set the room temperatures but I may use an Xbee in future as the main thermostat is in a bit of an annoying place currently.

Hopefully I'll get a chance to upload all the software to git later today/tomorrow and will post a few pics of what I have running.

chickey
Posts: 63
Joined: Thu Jan 05, 2012 11:17 am

Re: RPi controlled central heating

Wed Aug 29, 2012 9:31 am

Hi Fruitloaf, is it a combi boiler your interfacing with, that is the bit which i'm very unsure about. I have a ferrolli model which mentions zero volt controls which just sounds like magic to me.

fruitloaf
Posts: 84
Joined: Sun Feb 05, 2012 11:41 am

Re: RPi controlled central heating

Wed Aug 29, 2012 9:39 am

No its a conventional boiler with a water tank using 240V controls. If it was a combi boiler I'd probably just replace the thermostat and set the boiler to be on always at the controls and use the thermo to set on and off times.

Don't know anything about 0 volts I'm afraid.

chickey
Posts: 63
Joined: Thu Jan 05, 2012 11:17 am

Re: RPi controlled central heating

Wed Aug 29, 2012 10:03 am

I'm going to do some digging as i've got the manual for the boiler in a drawer. I'll be replacing the thermostat and using the temp from that combined with timings to dictate the on/off times but it's the actual interfacing which puzzles me. I'll post back here with some details and maybe a printout of the page to see if anyone else may be able to shed some light on it. Ta for the quick reply :)
fruitloaf wrote:No its a conventional boiler with a water tank using 240V controls. If it was a combi boiler I'd probably just replace the thermostat and set the boiler to be on always at the controls and use the thermo to set on and off times.

Don't know anything about 0 volts I'm afraid.

mehran
Posts: 2
Joined: Mon Aug 27, 2012 10:08 am

Re: RPi controlled central heating

Sat Sep 01, 2012 9:45 am

what model of ferrolli you have and i will be able to dig out the manual my self.

if it is a modern boiler(past 4 years ish) it could have have an opentherm interface which is would be much more interesting to deal with then on/off 240v or volt free contacts
http://en.wikipedia.org/wiki/OpenTherm

if you only ever plan on having one zone then place it in the room you are controlling(if you can get it to look ok) but if you ever plan on having multiple zones then beside the boiler would be a better bet.

chickey
Posts: 63
Joined: Thu Jan 05, 2012 11:17 am

Re: RPi controlled central heating

Sat Sep 01, 2012 1:01 pm

Hi Mehran,
It's a Modena 80, the manual is available here

http://www.ferroli.co.uk/wp-content/upl ... Manual.pdf

I think i'm going to have to use the zero volt controls so i've went for the Xbee kit with the remote relay option so i'll put the Pi in the living room and the the xbee connected relay board next to the boiler. I then just need to look at how to measure the temp where the pi is situated, not sure if i'll go for the USB based option as i've seen then for about £10 on ebay or to go for the GPIO option which will be cheaper although a more steep learning curve for myself. Another Xbee with the thermostat option could be a possiblity but that is £20 and would mean i've got to power 3 things as well so probably go for the direct attached temp monitoring.

Col

harvy
Posts: 98
Joined: Mon Nov 26, 2012 1:49 pm
Location: London - UK

Re: RPi controlled central heating

Mon Nov 26, 2012 1:58 pm

Hi rooster,

Did you get anywhere with this?

I'm looking to do something similar (i guess everyone is but in their own way!)

For me i'm looking to have 1 or 2 temp sensors per room, and a solenoid/valve of some description for the radiator/underfloor heating.

Allowing control of each room independently and on its own timer (eg if i know that a particular room is only used between certain times, it only heats around those times),

With scope to expand to hot water cylinder in the future - using a combination of solar heater and gas boiler to heat water most efficiently...

Getting the boiler on/off i don't have a problem with, I've had enough fun and games with thermostats/programmers to know what i need to do to get the boiler to fire and to open zone valves etc (though looking to get rid of the zone valves and route water by use of solenoid at the point of heating may be easier) but not sure on the temperature sensor and solenoid control...

Just wandered if you had any joy with any specific combos of breakout boards and sensors which would help me aim in the right direction? Haven't even purchased the pi or breakout boards as yet, wanted to do a bit more research before spending ££ on boards which i later find arn't useful for my needs!

Will Smith
Posts: 2
Joined: Wed Nov 28, 2012 10:20 am

Re: RPi controlled central heating

Wed Nov 28, 2012 10:23 am

Very interested to hear that other people are having similar ideas to me. As a simple starting point, I was thinking of using the frost stat connections on my Worcester system boiler as a simple way of turning the heating on. I don't have a frost stat at the moment so these connections are unused. My understanding is that the frost stat overrides the timer and thermostat so can be used as a guaranteed way to turn on the heating. Does anyone know if this is correct? Obviously I would need to do something else to control hot water but this would be a start.

Will Smith
Posts: 2
Joined: Wed Nov 28, 2012 10:20 am

Re: RPi controlled central heating

Wed Nov 28, 2012 3:38 pm

Hmmm, it seems the frost stat connection isn't the answer. Taken from the electrical installation manual:

"If external frost thermostat is calling, i.e. temperature within frost thermostat below the set point, but the primary temperature of the boiler is above 5°C, the pump will run until the temperature within the frost thermostat rises above the set point. If external frost thermostat is calling and the primary temperature is below 5°C, a central heating demand is activated until primary temperature is above 12 °C. If the frost thermostat is still calling the pump will run until the temperature within the frost thermostat location rises above the set point."

So, shorting the frost stat connection will only cause the pump to run (unless the house happens to be very cold!) I'll have to take a look at how the programmer is wired into the boiler...

harvy
Posts: 98
Joined: Mon Nov 26, 2012 1:49 pm
Location: London - UK

Re: RPi controlled central heating

Fri Nov 30, 2012 8:03 am

Will,

Looking around at other peoples comments on various and numerous other websites, i think the way forward may be to use the thermostat connections and relays to handle 240v...

As a fail safe, use a thermostat in parallel, so that if the pi fails, you can use the thermostat to carry on while you resolve.

Return to “Automation, sensing and robotics”