Djaved
Posts: 6
Joined: Tue Dec 09, 2014 7:45 pm

Raspberry Pi Thermostat

Fri Dec 12, 2014 2:33 pm

Hi, I am a noob at this, but I have been researching into the raspberry pi and purchased one.

I have put Raspbian image into the Raspberry Pi and installed python using the terminal.

What I want to know is, to connect the GPIO to the thermostat, do I need to get a hardware between them two or can I connect it directly to the thermostat?

If I need a hardware component between, what would it be? I heard of things like a relay board etc? is that necessary? and if i do? how would I connect them?

I am just trying to get the thermostat respond to the Pi.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 28358
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi Thermostat

Fri Dec 12, 2014 4:42 pm

What thermostat do you mean? Link would be useful.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

gordon77
Posts: 5444
Joined: Sun Aug 05, 2012 3:12 pm

Re: Raspberry Pi Thermostat

Fri Dec 12, 2014 4:45 pm

Djaved wrote:Hi, I am a noob at this, but I have been researching into the raspberry pi and purchased one.

I have put Raspbian image into the Raspberry Pi and installed python using the terminal.

What I want to know is, to connect the GPIO to the thermostat, do I need to get a hardware between them two or can I connect it directly to the thermostat?

If I need a hardware component between, what would it be? I heard of things like a relay board etc? is that necessary? and if i do? how would I connect them?

I am just trying to get the thermostat respond to the Pi.
Why did you need to install python, raspbian comes with v2 and 3 installed?

Djaved
Posts: 6
Joined: Tue Dec 09, 2014 7:45 pm

Re: Raspberry Pi Thermostat

Fri Dec 12, 2014 4:49 pm

jamesh wrote:What thermostat do you mean? Link would be useful.
Hi Jamesh, thanks for your interest.
Basically, For my final year project, I am just trying to show that any heating thermostat controller can respond to the raspberry pi. So for example, when I give the raspberry pi an instruction to turn the thermostat controller on then it should turn on, with other instructions as turning up the temperature.

It can be any thermostat controller, digital at least.

I am just confused on seeing tutorials and projects on youtube or other forums in where you need to create a circuit using a breadboard or relay board. That is the part where I am not sure of. The programming I will learn and workout myself.

If you have any ideas, it would be grateful, thank you :)

gordon77
Posts: 5444
Joined: Sun Aug 05, 2012 3:12 pm

Re: Raspberry Pi Thermostat

Fri Dec 12, 2014 5:42 pm

What do you mean by turn the thermostat controller on? Are you turning a heat system on, ie heating a room, so you are acting as a thermostat?

Djaved
Posts: 6
Joined: Tue Dec 09, 2014 7:45 pm

Re: Raspberry Pi Thermostat

Fri Dec 12, 2014 6:25 pm

gordon77 wrote:What do you mean by turn the thermostat controller on? Are you turning a heat system on, ie heating a room, so you are acting as a thermostat?

Yes, But I am just making a prototype. All I want to do, is send an instruction using a web interface or an android application to the raspberry pi so it can use its GPIO pins to turn on the controller. If want it to turn the heating up I will use command programmed in the Pi to do so. But what I need to know is, how would the pins itself be connected to the thermostat.

BudBennett
Posts: 89
Joined: Fri May 17, 2013 2:45 pm
Location: Westcliffe, Colorado, USA

Re: Raspberry Pi Thermostat

Sun Dec 14, 2014 4:30 pm

Most people are trying to replace the thermostat with the Raspberry Pi. There would be no need to interface with the thermostat. The Pi would need to interface with the heating system "controller". Here in the U.S. the most common heating system interface uses 24VAC, so you would require the Pi GPIO to turn on/off a relay that connects to the heating system. So in this case the answer is NO you can't directly interface the PI GPIO to the "controller". Of course, you would need to add some method of sensing temperature with the Pi if you needed to replace the thermostat function.

On the other hand, are you are asking whether you can take the signal from the thermostat and then process that signal with the Raspberry Pi which would then interface with the heating system "controller"? Most thermostats use a simple switch as output which could interface directly with the GPIO of the Pi without damaging it. You would still need a relay to connect the Pi to the 24VAC of the "controller".

Do these answers make sense in the context of what you want to do?

Djaved
Posts: 6
Joined: Tue Dec 09, 2014 7:45 pm

Re: Raspberry Pi Thermostat

Mon Dec 15, 2014 1:08 pm

Hi, thank you for your reply. I do apologise for confusing people because of the way I worded it. Yes I wanted to control the controller with my raspberry Pi. Could you please expand on the relay? Because when someone in their tutorials mention a relay or relay board my brain goes blank. What does a relay do? I have a breadboard and jumper leads is that it? Thanks for your help

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Raspberry Pi Thermostat

Mon Dec 15, 2014 1:25 pm

The raspberry PI can switch a few milliamps at 3.3 volts. This won't switch whatever is providing the heating or cooling in your project , so you need some form of relay to suit both the Pi and the heater/cooler so the Pi can turn it on and off.

Something like this would probably suit most things you would want to switch :

http://www.ebay.co.uk/itm/5V-SINGLE-CHA ... 20f253dc84
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: Raspberry Pi Thermostat

Mon Dec 15, 2014 1:26 pm

The relay isn't what you need to control your controller, so don't worry about it. (It's just a physical switch, that is thrown by an electromagnet. So your raspberry pi could drive a transistor to send 12V to the relay, and that could switch anything, even mains power if necessary.)

But you really do need to know first what controller you are using. You need to know how it receives its temperature command, and how it is activated or put into standby. (I don't even know if any domestic units work this way.)

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Raspberry Pi Thermostat

Mon Dec 15, 2014 6:59 pm

From experience most domestic (and industrial) heating and cooling units will work with old school thermostats based on the bimetallic strip principal which means they will work with a plain old relay. I installed a brand new CH boiler earlier this year which had lots of electronic bells and whistles but it would still work with a 1960's thermostat. Some use low voltage DC switching and some use mains switching (or mine was both, selectable with jumpers) but the switch can be the same. If its mains switching there are lethal voltages running through the relay, so work should not be undertaken lightly. I have an arduino maintaining a temperature in the house, but the Pi tells the arduino what temperature I'd like. It could equally well be done directly with the Pi. The Arduinio predates the Pi by about 3 years, and some of the other stuff it does requires analogue inputs, which the Pi would need help with.

Take a look :

http://www.pluggy.me.uk/homeserver
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

User avatar
SteveDee
Posts: 343
Joined: Thu Dec 29, 2011 2:18 pm
Location: Sunny Southern England
Contact: Website

Re: Raspberry Pi Thermostat

Tue Dec 16, 2014 9:03 am

It worries me Djaved that we are discussing heating controllers with you, when you appear to know nothing about the subject (I'm not being unkind to you. We all have things/subject we understand, and very many we do not understand).

It worries me because here in England, the thermostat on most existing central heating systems switches 240V ac to the controller to "call for heat". This voltage is high enough to kill you, or members of your family, if something goes badly wrong!

I don't know what country you live in, or what supply voltage you may be dealing with. I also don't know your age (final year could mean 16, 18, 20 or something else).

If you really intend to connect your system to a heating controller, you need to start by researching heating control systems and have a clear understanding of (and a healthy respect for) mains electricity. You won't get that information from this forum.


However, you did say in an earlier post that "...you need to show..." that your system could control a heating system. If it is just a final year project to demonstrate the principle, then your system just needs to operate low voltage lights (LEDs) to show operation.

I strongly suggest you make your intentions absolutely clear before anyone offers further advice on this subject.

User avatar
BAStumm
Posts: 134
Joined: Fri Aug 23, 2013 3:37 pm
Location: Loon Lake, WA USA
Contact: Website

Re: Raspberry Pi Thermostat

Tue Dec 16, 2014 9:39 pm

A solid state relay (SSR) can be switched directly from the Pi's 3v3 GPIO pins. By adding a temperature measuring device (for example a thermocouple or thermistor via i2c bus) you can turn the RPi into a thermostat and control a furnace (on/off) via the GPIO pins and the SSR. Many SSR's have an LED to indicate on/off so to test your project no high voltage power need to be connected to the SSR. The LED will indicate heating/not-heating as controlled by the RPi, your temperature setpoint and temperature actual read from your temperature measuring device.

Djaved
Posts: 6
Joined: Tue Dec 09, 2014 7:45 pm

Re: Raspberry Pi Thermostat

Thu Dec 18, 2014 7:55 pm

Hi, apologies for being unclear, Yes I live in the UK, Currently what I want to prove is, that the controller can be turn on and off from the raspberry pi, so it can be responded and be instructed. So the LED lights or any sort of notification on the controller screen can be turned on or off by be writing a program. I am specialising in software and pogramming, so that area is more important to me. That will then sort my prototype. Later on, I can then worry about real time central heating controlling.

Sorry if its really hard to understand, but I may be having trouble explaining it. Yes Im 20 years old. Hopefully I will get to learn more and do advanced projects.
SteveDee wrote:It worries me Djaved that we are discussing heating controllers with you, when you appear to know nothing about the subject (I'm not being unkind to you. We all have things/subject we understand, and very many we do not understand).

It worries me because here in England, the thermostat on most existing central heating systems switches 240V ac to the controller to "call for heat". This voltage is high enough to kill you, or members of your family, if something goes badly wrong!

I don't know what country you live in, or what supply voltage you may be dealing with. I also don't know your age (final year could mean 16, 18, 20 or something else).

If you really intend to connect your system to a heating controller, you need to start by researching heating control systems and have a clear understanding of (and a healthy respect for) mains electricity. You won't get that information from this forum.


However, you did say in an earlier post that "...you need to show..." that your system could control a heating system. If it is just a final year project to demonstrate the principle, then your system just needs to operate low voltage lights (LEDs) to show operation.

I strongly suggest you make your intentions absolutely clear before anyone offers further advice on this subject.

Djaved
Posts: 6
Joined: Tue Dec 09, 2014 7:45 pm

Re: Raspberry Pi Thermostat

Thu Dec 18, 2014 7:56 pm

BAStumm wrote:A solid state relay (SSR) can be switched directly from the Pi's 3v3 GPIO pins. By adding a temperature measuring device (for example a thermocouple or thermistor via i2c bus) you can turn the RPi into a thermostat and control a furnace (on/off) via the GPIO pins and the SSR. Many SSR's have an LED to indicate on/off so to test your project no high voltage power need to be connected to the SSR. The LED will indicate heating/not-heating as controlled by the RPi, your temperature setpoint and temperature actual read from your temperature measuring device.
Could you please expand on that? by direct...

User avatar
DougieLawson
Posts: 40781
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspberry Pi Thermostat

Thu Dec 18, 2014 8:17 pm

In the UK unless you are Gas Safe registered you are NOT ALLOWED to play with your heating system, it is illegal. You are also NOT ALLOWED to play with mains wiring systems unless you are a competent person under Part P of the Building Regulations, it is also illegal.

So forget any ideas of playing with solid state relays and wiring those to your central heating system.

Go simple, get a solderless breadboard, a temp sensor (DS18B20) [or two], four resistors and four LEDs.

You now have everything you need to tell the time of day, sense the ambient temperature and when it drops below a preset value you'll light the LED (to show that if this were connected to a boiler/pump that your house would be getting warmer).

The second LED will show whether the pump is running.

The third and fourth LEDs will show the state of your three way valve (which controls whether the hot water circulates through the radiators or just through the hot water cylinder).

You may need a second temp sensor (which would sense the water cylinder temperature when heating to the house isn't needed but your sister has just run the shower for twenty minutes and the hot water needs heating).
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

User avatar
BAStumm
Posts: 134
Joined: Fri Aug 23, 2013 3:37 pm
Location: Loon Lake, WA USA
Contact: Website

Re: Raspberry Pi Thermostat

Thu Dec 18, 2014 10:26 pm

Man, you Brits can't have any fun can you... :lol:

For what it is worth... I did state that no high voltage need connected in my example to demonstrate the switching of the SSR assuming the SSR chosen has a status LED to indicate on/off. I build industrial ovens for a living so I get to play with the big power in a very similar application. And believe me, a jolt of 480VAC is nothing you want to fool with.

Also, it is possible to get all the items needed to put this (per my previous post) together "off the shelf" with out the need to bread board up a design.

User avatar
DougieLawson
Posts: 40781
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspberry Pi Thermostat

Thu Dec 18, 2014 10:41 pm

BAStumm wrote:Man, you Brits can't have any fun can you... :lol:
Because most folks use mains methane gas for domestic heating we do have a lot of houses that are destroyed in gas explosions. Not sure how much fun that is. The poor but lucky saps who went through this one walked away

http://www.bbc.co.uk/news/uk-england-hampshire-30105352
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

User avatar
BAStumm
Posts: 134
Joined: Fri Aug 23, 2013 3:37 pm
Location: Loon Lake, WA USA
Contact: Website

Re: Raspberry Pi Thermostat

Thu Dec 18, 2014 10:48 pm

electric is cheap in the part of Merka Land where I live so gas heating is not very common.

User avatar
SteveDee
Posts: 343
Joined: Thu Dec 29, 2011 2:18 pm
Location: Sunny Southern England
Contact: Website

Re: Raspberry Pi Thermostat

Fri Dec 19, 2014 9:10 am

BAStumm wrote:Man, you Brits can't have any fun can you... :lol:

.
Well we don't have as much fun as we used to have, before the Europeans started to impose the Health & Safety Directive on us, and then tried to get us to lower our mains voltage to 220V (isn't the 230V spec a hoot?).

But you'd be surprised at some of the shocking things we get up to!

Return to “Automation, sensing and robotics”