pihome
Posts: 11
Joined: Tue Aug 09, 2016 1:35 pm
Contact: Website

DIY Open Source PiHome Smart Heating Control

Wed Nov 15, 2017 11:06 pm

Hi Guys,
Its my first project base on Raspberry pi so i thought i can share here and if you want you can download it from my site at PiHome site .

Background: i have two story house with basic heating system installed in around 2007 when house was built with three zone i.e ground floor, first floor and hot water. ground floor thermostat located in hallway which isn't ideal and its always colder then other parts of the house and same goes for first floor where thermostat was installed in master bed and no way of controlling heating in kids room. and hot water was even disaster in itself as thermostat was on water tank and not so easy to access and it was left on 79C all the time.

Home Page
Image

OnTouch Options i.e Boost, Override, Night Climate, Away etc...
Image

Boiler Graph in Hours for last one Year
Image

Schedule List
Image

Saving Made by PiHome for me
Image

Boiler Logs
Image

Boiler Logs
Image

Total Code for PiHome
Image

More Images Link

What is required:
  • Raspberry Pi with WiFi(any version would do) RPI3 is faster hence web page loading time is less.
  • One Wire DS18B20 Temperature Sensor
  • 5v 4 Channel Relay Module with optocoupler (Number of relays depend on your number of zone)
  • 5v 2 Channel Relay Module with with optocoupler
  • nRF24L01+/2.4GHz RF Wireless Module
  • nRF24L01+ 2.4GHz with PA+LNA Wireless Module
  • Bi-Directional Logic Level Converter (if you want to use Serial Gateway)
  • Node Mcu Lua ESP8266 Development Board (if you want to use WiFi Gateway)
  • Arduino Pro/Pro Mini 3.3v (number depend on your zone as each zone will have its own temperature sensor)
  • Arduino Pro/Pro Mini 5v (you need two one for zone controller rely and second for controlling boiler relay)
Step 1
OS (Raspbian Jessie) Installation and WiFi Configuration

Step 2
Install Apache, PHP and MySQL on a Raspberry Pi (LAMP)

Step 3
MySQL Access From Remote Computer

Step 4
Download pihome and Import MySQL database from /MySQL Database folder and add all view tables.

Step 5
Change Database Settings in st_inc/_config.inc.php

Step 6
Change database and MySensors WiFi gatway settings in cron/wifigw.py

Step 7
Make All Cron job folder scripts executable and Setup Cron Jobs as per cronjob cron/CronJobs List

Step 8
Build MySensors WiFi Gateway

Step 9

Build 18650 Battery Powered Temperature Sensors

Step 10 (Optional)
If you like to control your heating while you are away you can install OpenVPN on raspberry pi and connect to your pi remotely.

all sources available at pihome site for you to abuse ;)

Cost of this project
Temperature Sensors Node
NRF24L01+ 2.4GHz Wireless Transceiver 0.66€
Pro Mini 328 Mini 3.3V/8M 1.35€
DS18B20 Thermometer Temperature Sensor 0.53€
Temperature and humidity sensor plastic box 3.48€
18650 Battery 3.7V Li-ion Rechargeable Battery 1.56€

MySensors Gateway
Wireless module CH340 NodeMcu V3 Lua 2.39€
NRF24L01 PA LNA 20dBm 2500m Long Distance SPI 2.4GHz 3.87€

Multi Zone Controller Relay
4 Channel relay module with optocoupler 1.74€
NRF24L01+ 2.4GHz Wireless Transceiver 0.66€

Boiler Controller Relay
2 Channel relay module with optocoupler 0.84€
NRF24L01+ 2.4GHz Wireless Transceiver 0.66€

Raspberry Pi for PiHome
Raspberry Pi 3 or 2 or B+ which ever you want to use. 35€
Raspberry pi Casing 1€
Raspberry Power Supply 6€
SD Card for Raspberry Pi 5€

General Items used in project
Double Side Copper Prototype PCB Universal Board 6.66€
Metal Film Resistor Kit Pack Mix 4.92€
Single Female Pin Header Case For Arduino 2.20€
0.1 uF 104 50V Mono Monolithic Capacitors 0.78€
4Pin Double Row Straight Pin Female Header 0.87€
values 0.22UF-470UF Aluminum electrolytic capacitor assortment kit 1.35€

Total Cost for this project is 80.02€
Raspberry Pi - PiHome Smart Heating Control

hunty1980
Posts: 36
Joined: Mon May 22, 2017 3:25 pm

Re: DIY Open Source PiHome Smart Heating Control

Mon Dec 18, 2017 10:14 am

This looks like an interesting project and keen to give it a try. However, my hardware setup is slightly different and wondering if this will work with what I'm running?

I have a Raspberry Pi 3 connected to two relays - 1 relay controlling the Heating and the other relay controlling the Hot Water. I use a DS18B20 temp sensor, connected to a Raspberry Pi Zero W, to send the current room temperature back to the Raspberry Pi 3. I'm currently using Node-Red to communicate between the RPi Zero and RPi 3, using MQTT.

Advice and guidance appreciated on whether PiHome will work with this setup and how to achieve it.

pihome
Posts: 11
Joined: Tue Aug 09, 2016 1:35 pm
Contact: Website

Re: DIY Open Source PiHome Smart Heating Control

Mon Dec 18, 2017 1:14 pm

@hunty1980
how you are controlling your gas boiler (heat source)? pihome project works with mysensors library.

temperature sensors and relay to control each zone and second relay to control gas boiler are wireless using nRF24L01.
temperature sensors are battery powered.

i have wired systems where temperature sensors and boiler/zone relays wired to same raspberry pi but i stopped development on that project about year ago but i can give you copy of that.

pihome
Raspberry Pi - PiHome Smart Heating Control

hunty1980
Posts: 36
Joined: Mon May 22, 2017 3:25 pm

Re: DIY Open Source PiHome Smart Heating Control

Mon Dec 18, 2017 1:22 pm

pihome wrote:
Mon Dec 18, 2017 1:14 pm
@hunty1980
how you are controlling your gas boiler (heat source)? pihome project works with mysensors library.
I have a Raspberry Pi 3 connected to a relay, which is controlling my boiler - on and off. I then have a Raspberry Pi Zero W, with temp sensor (DS18B20) sending the temperature to the Raspberry Pi 3 (connected to the bolier via relay)

pihome
Posts: 11
Joined: Tue Aug 09, 2016 1:35 pm
Contact: Website

Re: DIY Open Source PiHome Smart Heating Control

Tue Jan 02, 2018 11:49 pm

@hunty1980
sorry for late reply, i have added comments in cron/boiler.php file in case if you have boiler/zone valve connected on RPI GPIO. rest of the project stay same. let me know if you this does not work for you.
PiHome
Raspberry Pi - PiHome Smart Heating Control

pihome
Posts: 11
Joined: Tue Aug 09, 2016 1:35 pm
Contact: Website

Re: DIY Open Source PiHome Smart Heating Control

Tue Feb 13, 2018 5:56 pm

Hi All,
i have added support for Zone controller relay & boiler relay directly connected to raspberry pi GPIO.
as of today. you need to uncomment following lines.

205, 206 for Zone Relay
247, 248 for Boiler Relay ON status
285, 286 for Boiler Relay Off status
Raspberry Pi - PiHome Smart Heating Control

pihome
Posts: 11
Joined: Tue Aug 09, 2016 1:35 pm
Contact: Website

Re: DIY Open Source PiHome Smart Heating Control

Fri Mar 02, 2018 10:03 pm

Hi All
i have added option for nRF24L01 wireless and wired to rpi GPIO. check out how to build link and for all wiring connections etc.. let me know what you guys think.

Wired Heating System Connected to Raspberry Pi GPIO
  • 1-Wire DS18b20 Temperature Sensor
  • Multi Zone Heating Control System Relay
  • Raspberry pi Heating Boiler Control System Relay
nRF24L01 Wireless Heating System Based on MySensors Library
  • Battery Powered Arduino DS18B20 Temperature Sensor
  • Wireless Arduino Boiler Controller Relay with nRF24L01
  • Wireless Arduino Multi Zone Controller Relay with nRF24L01
  • MySensors Serial/WiFi/Ethernet Gateway to communicate all nRF24L01 radio
Raspberry Pi - PiHome Smart Heating Control

Return to “Automation, sensing and robotics”