====== Heating Control System with Webinterface ====== 31.10.2014 ===== Starting Situation ===== In my new office I have to add a simple heating controller to the central heating system. \\ Therefore I have to switch 2 realys, which tell the central heating to heat with high or low power, and if any heating is required. My main competence is in electronics hardware development, embedded programming and application programming on a PC. But until now, I never got to deep into webdevelopment. So here you can read about my progress of understanding the techniqes, which I can use to implement the heating control system with webinterface. ===== Project Goal ===== * The overall goal is to keep the temperature in my office at a nice temperature when I'm there, and to save energy, when I'm not there. * Control the central heating system with the circulation pump for the radiators. * A local userinterface, which does not relay on a working internet connection. * Webinterface, where I can set the temperature set point for now and for the future. \\ Perhaps a plot of the temperature curve would be nice. Encrypted data transfer and user identification is mandatory. * The regulator-algorithm should be local in the office. So it will work without any internet connection. But the system will have to relay on a working WiFi connection. ===== Hardware Overview ===== All the communication between the different hardware parts will be established via WiFi, so I do not need a long cable between the office-room and the central heating system. ==== Sensor Box ==== Arduino Nano Board with a digital temperature sensor DS18B20 and a [[ESP8266 WiFi Modules|WiFi module]]. It will have an LCD and some buttons for a local user interface. If we use the heating controller without a internet conntection we will need a local time. Therefore a real-time-clock is needed. It will be the DS1307. Due to the high current consumtion of the WiFi module batteries will not last very long, so a mains power supply is needed. ==== Relay Box ==== Here I will use a Arduino Nano board with a relay module with 2 relays on it and the [[ESP8266 WiFi Modules|WiFi module]]. A separate power supply is also needed here. ==== ADSL Modem with WiFi Router ==== This will be a normal router from my internet service provider. I think it's a Thomson device, I will get it next week. Important here is, that I can set port forwarding to the temperature sensor and the relay box. ==== Webhosting Server ==== I'm renting a webhosting-server (http://www.world4you.com) where I want to host the webpage for the online user interface. Here should run a PHP website, which can do encrypted communication with the Sensor Box. ===== Communication ===== ==== HTTP ==== For the communication simple HTTP messages will be used, to tranfer data between the different nodes in the network. Please have a look to [[networking#http_get_vs_post|HTTP GET vs. POST]], where I explained the two different message-types. ===== First Implementation - WiFi-Relay-Board ===== 16.12.2014 {{ ::wifi-heating:soldered-board.jpg?direct&300|}} {{ :wifi-heating:wifi-relay-board.png?direct&300|}} The first version, which has the most important feature - remotly turning on the heating system - has been implemented the last days. \\ I built the Wifi-Relay-Board. The firmware is very simple. It fetches every 30 seconds a text-file from my webserver, which tells the relay-board, when the heating system has to be enabled and disabled. Here is a link to the text-file: [[http://www.zeilhofer.co.at/lackergraben-heating/simple-config.txt|text file]]\\ This file I can edit with the online text editor, written in PHP. Many thanks to Simon Thorpe, which has written this nice web-application. [[https://github.com/simon-thorpe/editor|Github]]\\ Here you can download the software and documentation: [[http://www.zeilhofer.co.at/lackergraben-heating/2014-12-16-relay-board.tar.gz|tar.gz-file]] {{tag>english project wifi arduino remote_control kicad technical}}