dirtydischo
Posts: 26
Joined: Mon Feb 11, 2013 6:18 pm

Thermostat controlled remote plugs project - help needed

Sun Aug 17, 2014 6:47 pm

I’m trying to set up a thermostat to work with an electric heater. The idea is that the raspberry pi turns the electric heater on or off depending on the temperature.

I’m using status remote control plugs with a 433mhz transmitter and the RPI-Control software (which in turn uses pihat) to turn the electric heater on/off.

For the temperature sensor I’m using a DS18B20 and the adafruit tutorial

I’m able to get both parts working individually, but the problem is that both use GPIO4. I’ve been trying to find a way to move one of them to another GPIO pin, but haven’t been successful yet. It seems that GPIO4 needs to be used for the temperature sensor as it’s the only one that works with 1 wire.

pihat is also set up to use GPIO4, although I’m not sure if it needs to be. Is there a way to change this?

Grateful for any help in sorting this.

Thanks.

User avatar
joan
Posts: 15122
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Thermostat controlled remote plugs project - help needed

Sun Aug 17, 2014 7:00 pm

Search the forum for DS18B20. danjperron has published some software which will let you use the DS18B20 on any spare gpio.

dirtydischo
Posts: 26
Joined: Mon Feb 11, 2013 6:18 pm

Re: Thermostat controlled remote plugs project - help needed

Sun Aug 17, 2014 8:19 pm

Thanks, I've been searching but can't find it. Does the software have a name?

User avatar
joan
Posts: 15122
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Thermostat controlled remote plugs project - help needed

Sun Aug 17, 2014 8:26 pm

Enter ds18b20 in the search box (next to new posts). In the first page of results there is a post by danjperron. The software and explanation should be in that thread.

dirtydischo
Posts: 26
Joined: Mon Feb 11, 2013 6:18 pm

Re: Thermostat controlled remote plugs project - help needed

Sun Aug 17, 2014 8:57 pm

ok, thanks. I've found it now.

I've got it reading the temp from GPIO22. I can't work out how to then use this within any of the other programmes though, i.e. how would I modify the basic code in the adafruit tutorial to make use of the temp sensor at GPIO22?

RPiWare.com
Posts: 21
Joined: Fri Aug 15, 2014 1:28 am

Re: Thermostat controlled remote plugs project - help needed

Mon Aug 18, 2014 3:05 am

Just an alternate suggestion, but use a real home thermostat and place the Raspberry Pi in between the thermostat and the heater. The Raspberry Pi will actually be in control at all times (so you can access via network, etc), and the thermostat is just making "requests for heat" to the Raspberry Pi. That way the thermostat could drive the temperature set points (to call for heat, fan, etc) and already includes the thermistor. You could check the pending weather forecast online via the RPi and preheat the room, etc. I know that's not what you asked for, but i have done something similar. A friend of mine bought a Nest thermostat and gave me his old one. I used the old thermostat for a similar setup. Thanks,

RPiWare.com - relay boards made specifically for the Raspberry Pi

jsobota
Posts: 42
Joined: Tue Jul 10, 2012 3:24 pm
Location: Plzen, Czech Republic

Re: Thermostat controlled remote plugs project - help needed

Mon Aug 18, 2014 7:35 pm

dirtydischo wrote:I’m able to get both parts working individually, but the problem is that both use GPIO4. I’ve been trying to find a way to move one of them to another GPIO pin, but haven’t been successful yet. It seems that GPIO4 needs to be used for the temperature sensor as it’s the only one that works with 1 wire.

pihat is also set up to use GPIO4, although I’m not sure if it needs to be. Is there a way to change this?
You can also modify /etc/modules so that it contains

Code: Select all

w1-therm
w1-gpio gpiopin=22
After a reboot you will have 1-Wire bus on pin 22 (change it to any other GPIO as needed).

dirtydischo
Posts: 26
Joined: Mon Feb 11, 2013 6:18 pm

Re: Thermostat controlled remote plugs project - help needed

Mon Aug 18, 2014 8:38 pm

Thanks very much. That was much more simple than I thought it was going to be!

abqlewis
Posts: 18
Joined: Tue Sep 13, 2011 3:45 pm

Re: Thermostat controlled remote plugs project - help needed

Tue Aug 19, 2014 4:39 pm

I know it's not what you originally asked, but I'm really interested in this - Can I ask why you don't use something like an Arduino for this function? If you're not accessing the internet, or using some sort of artificial intelligence, or voice recognition, or something complex like that, an Arduino would not only be easier to setup, it would need a less complex infrastructure to support. It doesn't need an SD card, a loaded distribution, software updates, a display or serial terminal, or a login. There is plenty of existing code and schematic examples of DS18B20's or DHTXX's being used to control heater, etc. It could end up costing less, and not tying up a valuable Pi.
I'm not anit-Pi at all. If you wanted to add more functionality in the future, you could connect the Arduino to a Pi; using the Pi for the heavy thinking (controlling the rest of the house, managing home security, etc) and just use the Arduino for the low-level, real-time type of I/O.

dirtydischo
Posts: 26
Joined: Mon Feb 11, 2013 6:18 pm

Re: Thermostat controlled remote plugs project - help needed

Tue Aug 19, 2014 9:56 pm

Simple answer is that I have a raspberry pi!

I've not looked into arduino before, but will take a look.

I'm using this project to learn about using GPIO, writing simple python code etc. It needs to be connected to the internet so that I can control it remotely (the setup is for a gym in an outside building). I've got a basic setup now which seems to work.

Next step will be to set the system up to read from my Google Calendar, I can then set up an appointment in my calendar for when I am going to use the gym and have everything (including heating in winter!) set up for when I get there.

User avatar
ilovemipi
Posts: 152
Joined: Mon Dec 02, 2013 11:52 am
Location: UK + Cyprus
Contact: Website

Re: Thermostat controlled remote plugs project - help needed

Wed Oct 22, 2014 8:56 am

dirtydischo wrote:Simple answer is that I have a raspberry pi!

I've not looked into arduino before, but will take a look.

I'm using this project to learn about using GPIO, writing simple python code etc. It needs to be connected to the internet so that I can control it remotely (the setup is for a gym in an outside building). I've got a basic setup now which seems to work.

Next step will be to set the system up to read from my Google Calendar, I can then set up an appointment in my calendar for when I am going to use the gym and have everything (including heating in winter!) set up for when I get there.
Did you manage to set up your system to read Google Calendar or does anyone else have systems that are interfacing with Google Calendar like hackPump of Chris LeBlanc at http://www.youtube.com/watch?v=1RDMPptUeIQ ?

User avatar
ilovemipi
Posts: 152
Joined: Mon Dec 02, 2013 11:52 am
Location: UK + Cyprus
Contact: Website

Re: Thermostat controlled remote plugs project - help needed

Wed Oct 22, 2014 9:23 am

Looks like Domoticz at http://www.domoticz.com/wiki/Interactin ... e_Calendar might be the way to go for interaction with Google Calendar.

Anyone have experience of Domoticz i.e. will it be easy enough for me to set up with limited ability :lol:

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

Re: Thermostat controlled remote plugs project - help needed

Wed Oct 22, 2014 9:38 am

If you want a local calendar try using Roaring Penguin's Remind.

sudo apt-get install remind
man remind
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

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

User avatar
ilovemipi
Posts: 152
Joined: Mon Dec 02, 2013 11:52 am
Location: UK + Cyprus
Contact: Website

Re: Thermostat controlled remote plugs project - help needed

Wed Oct 22, 2014 9:56 am

DougieLawson wrote:If you want a local calendar try using Roaring Penguin's Remind.

sudo apt-get install remind
man remind
I have seen reference to Remind on the forum and looked at the FAQ earlier today. Think I will try Domoticz first and see how that goes.

Return to “Automation, sensing and robotics”