I was given a RPi 2 model B as a gift and looking for something to do with it came across PiHome. That turned out to be a bit over ambitious – I have no knowledge of RPi or programming and it is 40 years since I experimented with simple DOS commands. This guide is intended for anyone with my lack of skills that likes the idea of using this project to control their home heating with a wired setup. My home heating is a conventional UK “S” plan system with 3 zone valves that are activated by the timers and thermostats.  When the zone valves are fully opened, they then make the 240v connection to switch on both the circulation pump and boiler at the same time.

The biggest problem I encountered was with GPIO pin numbering.  Look out for GPIO 4 being physical (BOARD) 16 and BCM 23.  The relay pins I used are GPIO 21, 22, 23, 24 which are BOARD 29, 31, 33, 35.

First download and install the PiHome SD Card image file. Connect you RPi to monitor, keyboard etc and login as root (pw pihome2019) or connect a LAN cable to the RPi, note the IP address from your router, then log in via a terminal application on your PC.

3 Zone UK S plane Heating System

3 Zone UK S plane Heating System

Thanks to Ian McDonald for sharing his knowledge and his experience for Wired PiHome setup and wiring diagram.

  1. sudo raspi-config
    1. Add your router wi-fi details
    2. Enable 1-wire interface


  1. cd /var/www
    1. sudo apt-get update
    2. sudo apt-get upgrade


  1. cd ..
    1. sudo nano /boot/config.txt
    2. dtoverlay=w1-gpio,gpiopin=23
    3. NB on my RPi gpio pin23= board pin 16


  1. lsmod to see if already loaded items 2 & 3 else 1+2+3
    1. sudo nano /etc/modules
    2. w1-gpio
    3. w1-therm


  1. cd /var/www/MySQL_Database
    1. sudo php update_db.php
    2. sudo php setup_db.php


  1. cd /var/www/cron
    1. Edit gpio_ds18b20.py
    2. Scroll down to line 38 and
    3. Insert os.chdir(“/var/www/MySQL_Database”)
    4. NB if you copy and past overwrite the quotation marks.


  1. cd /var/www
    1. Edit setup.php
    2. Uncomment run find temp sensors cron job
    3. Save file
    4. sudo php setup.php


  1. cd /var/www/cron
    1. Edit boiler.php
    2. Change on-off from 0-1 to 1-0


  1. cd /var/spool/cron/crontabs
    1. Check “root” file does not contain batches of repeated data.
    2. Else delete file and run setup.php again (item 7.4)

My Wiring Pi schematic for my own system ONLY. IMPORTANT NOTE: do no assume yours is the same in anyway. Before you make changes to your wiring, you must consult and use the qualified competent person – that is not the author. This NOT A COMPLETE wiring diagram. Use of this information is entirely at your own risk. The Author takes no responsibility and no liability for error or omission.