ETHERNET based CHRONOTHERMOSTAT


The device is a chronothermostat for the control of the heating system and the control of an optional hot water boiler at home with the possibility to visualize and modify all settings through the Internet.
The project requires an Arduino board with Ethernet shield, a digital temperature sensor DS18B20, a 4.7kOhm pull up resistor and one or two electromechanical relays.
Information on the Arduino hardware and its programming IDE (Integrated Development Environment) is widely available on Internet and it is out of the scope of this page.
Connections among the components can be realized as per the picture below, using a digital pin for the temperature sensor and an additional pin for each of the electromechanical relays.



Implemented code allows the automatic switching off and on of the heating system according to following modes:

- Always on
- Always off
- Keep fixed temperature
- Keep target temperature according to a daily and weekly calendar
- Keep fixed temperature until specified date and time and subsequent switch to calendar
- Keep target temperature according to a prescribed week day until specified date and time and subsequent switch to calendar

You can set up to 6 target temperatures over arbitrary time slots along the day. All days of the week can be managed independently from each other. It's also possible to turn on and off an hot water boiler according to following modes:

- Always on
- Always off
- turn off and on according to a daily and weekly calendar

Two independent time slots per day can be managed.
System time and date are continuously updated through the Internet thanks to a connection to an NTP server.
The chronothermostat settings are saved and updated on a text file that must be loaded on a webserver on the network.
An example of the settings file is shown here below:

myheatingSETTINGS.txt:


In case network connection is lost, the chronothermostat goes on working regularly even if changes to settings are not possible.
On the other side, the network connection is mandatory during the chronothermostat boot in order to allow the first loading of settings.

The code for Arduino realizes a very simple web server. When directly connecting to the Arduino board with his IP address and an optional TCP port (http://arduino_address[:port]) you get an answer with a simple text summarizing data on status and current settings.
When typing in the URL the command to reload the settings file (http://arduino_address[:porta]/?SETTINGS=RELOAD), the Arduino board creates a connection to the webserver on the network and downloads it.
Status or settings changes for the chronothermostat must be implemented by directly modifying the text of the settings file on the webserver before connecting to the Arduino board and giving the reload command.
This mode of operation is shown in the picture below.



In order to have a simpler user interface to the chronothermostat, I also realized a web application. Once loaded on the webserver on the network, it allows to visualize the system status and to change all settings with a graphical interface. All changes to the settings file and commands sent to the Arduino board are managed in a fully automatic way not visible to the user.
The webserver on the network must be enabled to run ASP.NET applications.
This mode of operation is shown in the picture below.



The source code for the Arduino board is shown here below.
Local network settings should of course be changed according to the LAN the Arduino will be connected to.
Before compiling with Arduino IDE, you've to upload OneWire, DallasTemperature and Time libraries with the Library Manager.

Arduino_Riscaldamento_e_Boiler.ino:


The text area below is showing the code of the ASP.NET page to be installed on the webserver in the same directory where the settings text file is. In addition to the English version, a file with all menus in Italian is also available. All text variables used in the graphic interface are collected in the same zone of the code to simplify their translation to a different language.
The file must be modified by setting the variable "Indirizzo" to the Arduino IP address or URL.

myheatingeng.aspx:


All files needed to realize this system can be downloaded at this link.

Special thanks to my son Giulio who supported me in programming the ASP.NET web application.

"Arduino", "DS18B20" and other brands mentioned in these pages are trademarks of their respective owners.