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.
Thanks to Ian McDonald for sharing his knowledge and his experience for Wired PiHome setup and wiring diagram.
- sudo raspi-config
- Add your router wi-fi details
- Enable 1-wire interface
- cd /var/www
- sudo apt-get update
- sudo apt-get upgrade
- cd ..
- sudo nano /boot/config.txt
- dtoverlay=w1-gpio,gpiopin=23
- NB on my RPi gpio pin23= board pin 16
- lsmod to see if already loaded items 2 & 3 else 1+2+3
- sudo nano /etc/modules
- w1-gpio
- w1-therm
- cd /var/www/MySQL_Database
- sudo php update_db.php
- sudo php setup_db.php
- cd /var/www/cron
- Edit gpio_ds18b20.py
- Scroll down to line 38 and
- Insert os.chdir(“/var/www/MySQL_Database”)
- NB if you copy and past overwrite the quotation marks.
- cd /var/www
- Edit setup.php
- Uncomment run find temp sensors cron job
- Save file
- sudo php setup.php
- cd /var/www/cron
- Edit boiler.php
- Change on-off from 0-1 to 1-0
- cd /var/spool/cron/crontabs
- Check “root” file does not contain batches of repeated data.
- 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.
5 comments
Hi, I followed this step by step all ok thankyou. Except I could not find step 7.B above. Also when I go to log back into the web interface it will not accept “admin” and “pihome” ?? Any suggestions about this welcome please. Is there a way of manually editing the username and password and if so where would I find that? Thankyou.
Hi Morgan,
If you download img file, it has all you need, if you have wired ds18b20 sensors to your rpi you just need to follow these steps http://www.pihome.eu/2017/10/11/ds18b20-temperature-sensor-with-raspberry-pi/. there is python script for you in cronjob commented you need to un-comment it.
# If you have Temperature Sensors Wired to Raspberry pi GPIO un-comment
# following line to read temperature sensors data.
# */1 * * * * python /var/www/cron/gpio_ds18b20.py >/dev/null 2>&1
you can comment out wireless gateway line if you are not using it
# If you are using Wireless setup with Smart Home Gateway then you need following crong job
# to check and start Smart Home Gateway python script if its not running.
*/1 * * * * php /var/www/cron/check_gw.php >/dev/null 2>&1
#*/1 * * * * php /var/www/cron/check_gw.php >>/var/www/cron/logs/check_gw.log 2>&1
Hi Morgan,
I have updated img file and now all you have to do is connect your ds18b20 temperature sensors to raspberry pi and un-comment python script to run cron job every minute to take temperature reading for you. You can connect relay to your rpi gpio and when creating zone you need to select gpio as controller and select physical pin number where your relay is connected.
Hope this will help you and others.
Hi ,
I use the stock PiHome image. I have followed the steps posted by Admin on May 9 . I use a ds18b20 hardwired to pin 37 . I have uncommented the Temp sensors wired part of cron jobs and commented Smart Home Gateway as I dont use wireless. When this is completed python processes kick off each taking 98 % CPU and CPU temp starts to getting alarmingly hot ( i have seen it go to 80 C before I killed the proccesses). Any suggestions ?
Hi Ian,
sorry i thought i replied you, wired sensors are give this issue. i had same issue, unfortunately there is nothing you can do, it could be capacitance in the wire that is killing pi. try different resister value