Feel free to use my photos, any part of sourcecode or schematics, but please mention me as the original author.
Room thermostat with colour LCD
Gas boilers are usually equipped with a simple sort of controlling element, but they regulate the amount of heating by measuring the water temperature inside the system. Without a proper room thermostat, that works on the principle of measuring the air temperature, is actually a waste of energy.
This project offers a very simple and cost efficient solution for that.
The heart of the unit is an 8 bit PIC16F74 microcontroller from Microchip.
It's main task is to constantly monitor the room temperature trough a 1–wire digital thermometer IC, a DS1820 from Maxim, and to switch a relay on or off, that controls the gas boiler accordingly.
The system also features a color LCD, which was removed from an old mobile phone, a few LED's, an LDR sensor for night mode and a couple of pushbuttons.
For correct operation of the LCD, a supply voltage of 2.9V is needed. I've used an LM317L voltage regulator and two resistors to achive this. For data and control lines, a few simple two resistor voltage dividers were used.
The PCD is made from testboard because the simplicity of the hardware.
The plastic case, some resistors and the LM317L voltage regulator were the only parts I payd for. The rest of the components are reused. The unit was mounted on the livingroom's wall by two screws with the right side facing towards the window, so the LDR could get enough light.
A few drops of hot glue can do miracles, especially when all the components and the front panel are made of plastic.
The two backlight LED's are connected in parallel with a piece of wire.
Software and functionality
0.5 degree Celsius precision
Backlight stays on for 30 seconds after each button press
(backlight is not switched off completely, so display visibility is good even in broad daylight)
Heating can be turnd off with a dedicated button, which also makes the red power LED to blink.
The system has a 1 degree hystheresis, which means that the boiler isn't switched on, until the measured temperature falls below the preset temperature by 1 degree. Such a large hystheresis was necessary, due to the 0,5 degree precision of the DS1820 sensor.
Night mode. The unit is equipped with a LDR, (Light Dependent Resistor) and makes measurements every 5 minutes, 6 consecutive times. (for 30 minutes) If all matches, a day/night mode transition will occur. This means, that the preset temperature will drop or rise by 2,5 degree.
Night mode is indicated by an orange LED.
(for this simple task, the Schmitt-trigger nature of the IO port was more than enough, so involving the A\D converter wasn't necessary)
The system also features a line graph, that shows the last 1 or 10 hours (switchable) of temperature history. The x axys in 1 hour mode is divided into six parts. Each represents 10 minutes of data, (1 pixel=1 minute) while in 10 hour mode there are 10 divisions, each equals one hour of data. (1 pixel=10 minutes) Vertical scaling is made in half degree steps from 15 to 25.
Measurements are made once every second and then averaged.
On the right side of te display, three icons indicate different working conditions like key presses, active heating (which is also indicated by a green LED) and settings mode. In settings mode, the temperature value is shown in red. After 5 seconds, the unit automaticaly returns to normal operating condition.