Overview
This project has come about from my desire to control my home heating from work.Β As I have a VPN between work and home a straightforward relay controlled from a PC would seem the easiest solution.Β However I also wanted a control unit that I could operate in the house without resorting to the computer.Β For example, I get up late and the heating is off, I just want to hit a button and turn it on.Β In fact the programmer shown on this page is now next to my bed so I can turn the heating on before IΒ get up late, and also switch it off if I turn in early, which helps save on the fuel bills J
Features
-
Independent control for heating and hot water.
-
10 flexible program entries.
-
Programs can be set to operate Mon-Fri / Sat-Sun / Mon-Sun.
-
Manual advanceΒ for water and heating
-
Water and heating can be independently set to manual or programmed control.
-
Operation and setup from front panel or remote serial CLI
-
Battery backup for Real Time Clock (RTC), program settings and manual control.
-
Programmer can be located remotely from boiler using low voltage signals over CAT5 or 6-core alarm cable.
-
RS232 serial interface with command line interface allows full control and setting from any computer.
-
Front panel control can be locked-out from serial CLI
-
Based on Microchip PIC 16F628A microcontroller
This programmer has been designed for use with a domestic heating boiler.Β It provides outputs via two relays to control the supply of Hot Water and Heating.Β There are 10 program entries available and each one can control the heating and water independently. The programmer allows manual advance of the heating and water andΒ disabling of program control, useful if youβre going away for a few days and want to leave the heating and water off. As well as providing normal front panel switch control of the heating and water, the programmer also features a serial terminal interface that allows it to be operated remotely from a PC running a Terminal Emulator.
The program entries can be set to switch weekdays only, weekends only or everyday but not individual days.Β I believe a programmer that can switch weekdays or weekends is a 5/2-day programmer so I would call mine a 5/2/7 day programmer since it can do the whole week as well.Β However, a 7-day programmer is one that can do individual days so Iβve settled on calling mine an Enhanced 5/2-day programmer.
The programmer and boiler control relays are contained in separate units so that the relays can be located close to the boiler while the programmer itself can be located anywhere in the house using low voltage connections back to the relay unit.Β Β The connection between the programmer and relay unit requires six wires for power, serial data and relay controls making it possible to use 6-core alarm cable or, as I have done, operate it over the CAT5 UTP cabling installed throughout my house.Β Of course itβs quite simple to build it as a single unit if that suits the application.Β There is also no reason why you canβt make the serial interface connection local to the programmer in which case you only need 4 wires for power and relay controls.
If you donβt require the remote computer CLI the programmer is fully functional using just the front panel and likewise, if the front panel isnβt required, it can be fully controlled from the serial interface and the LCD and switches omitted from the hardware.
Software
The latest version of the programmer ready .HEX file is provided here.
Firmware Version 2.0.2 28 May 2005
|
Developed using MPLAB V7.10 and Oshonsoft PIC Simulator IDE. Assembled with MPASM v04.00
The software is fully functional and the system as described on this web page is currently working with my domestic heating system.Β Iβve been using prototypes since March 2005.Β The latest code, Version 2.0.2, has been running since 28 May 2005.Β As of 17 January 2011 itβs still working and has proved to be 100% reliable.
This is the final version of the code. Iβm not going to develop it any further since the programmer now implements all the features I want and works as I intended.Β I will do maintenance code releases to fix any software related bugs / issues reported to me.
Known issues
-
no known critical issues.
-
Some CLI commands allow superfluous text on the line after the command. The command executes correctly and any superfluous text is ignored.
- Please send any bug reports to Contact us:
Functionality as designed
-
The current relay output and manual mode settings are stored in NVRAM. In the event of a power failure these are restored when the power resumes. If a programmed setting should have applied at a time during the power outage, it will not get applied when the power is restored. The saved settings that were active at the time of the power failure will be reapplied.Β
-
When in front panel setup mode, no programmed outputs will be activated. If a programmed setting should have applied while the programmer was in setup mode, it will not get applied on exit.Β
-
On power up the programmer sends a VT100 [ESC] c command to the terminal to reset it. This may cause extraneous characters to be displayed or other issues on a non VT100 emulator.Β Β
-
Time is displayed / entered in 24 hour format only.Β
-
Serial interface operates at 9600bps, 8 bits, 1 stop, No parity.Β Baud rate is not configurable
-
When in front panel setup mode the serial CLI is disabled.
Code Revisions
V2.0.3
-
As version 2.0.2 code but without the CLI diagnostic commands. These commands where implemented from an include file which has simply been omitted during assembly for V2.0.3.Β
V2.0.2
-
Enabled the PIC Watch Dog Time (WDT) and added supporting code.
-
New command βdwβ shows number of Watch Dog timeouts that have occurred since power-up. These should not occur if the programmer is functioning correctly, if they do this alerts you to a potential problem.
-
Implemented front panel setup functions. Allows time to be set. Program entries to be viewed, cleared, entered and edited.
-
Changed handling of serial CLI input buffer overflow. The behavior is now consistent with handling of unknown commands.Β
-
The CLI βpβ command now shows output control for Hot Water followed by Central Heating. This is the opposite way round to firmware before V2.0.0Β
V1.9.1
-
Added CLI command to enable / disable front panel control. This has been added to allow the front panel to be locked out when using automated control of the unit from the CLI.Β It also provides a way to stop my girlfriend from turning the heating on all the time:-)
-
CLI relay control command letter has been changed from βtβ to βuβ.Β
-
The relay control and manual mode CLI commands worked by inverting the current setting.Β This has now changed so that the setting for on/off or manual/programmed is explicitly specified on the command line.Β
-
Moved the on/off text for heating and water on the LCD to the extreme ends of the display. This is to allow the display of the text βLockedβ when the front panel is disabled.
V1.9
-
Prior to FW V1.9 the LCD display had the text CH- and -HW on the second line but as the programmer is now cased and the front panel artwork has legends on it, this text has been removed from the V1.9 code.
-
The manual mode status was indicated with the characters βmβ and βpβ. This has now been replaced by the text βManβ and βPrgβ
-
Added CLI function to send a VT100 [ESC] c command to the terminal to reset it.Β
-
Send VT100 [ESC] c command to the terminal at power-up.
-
Added command to return an ASCII hex byte with the current status of the relay outputs and manual mode settings. For use with automated control of the CLI.
-
Improved the CLI βpβ command entry format and parsing.
-
Made program control for CH and HW outputs fully independent by adding a no-change flag and enabling this feature within all related functions.
Hardware
The hardware for the programmer comprises two units.Β The first contains the two relays that switch the mains power to control the boiler.Β This also has an RJ45 socket to allow connection into a CAT5 cabling system that takes power, serial data and relay control input signals to the second unit, an intelligent programmer.Β There is also a 2.1mm DC power socket that is used to connect an external 9~12V DC power adapter. This supplies power to the relay board and the programmer controller. A 9-pin βDβ socket provides connectivity to a PC serial interface.
For more detail: Enhanced 5/2-dayΒ Central Heating Programmer with serial computer interface using PIC16F628A