Visit Us On FacebookVisit Us On TwitterVisit Us On Google PlusVisit Us On LinkedinVisit Us On YoutubeCheck Our Feed

Thermostat V1.0


In the need of my new homemade energy saving fireplace (which boils water for the radiator) i designed and built a digital thermostat. The idea to design my own thermostat came when i came across with the following problem.

When i first fire the fireplace the water in the boiler around the fireplace is cool. After a few minutes the fireplace warms the water enough so that the water temp exceeds the thermostat limit. The thermostat changes state and drives an electric valve to move the water from the fireplace boiler to the radiators. The electric valve is slow enough and takes a few minutes to make a full turn. While the water is moving from the fireplace boiler to the radiators, circularly cool water is coming back in the fireplace boiler from the radiators. Τhe water temp in the fireplace boiler is getting cooler and after a few minutes falls under thermostat's limit. The thermostat changes state and stops the valve from driving the water to radiators. This happens again and again until the whole amount of water in the radiators is get warm

To prevent this problem from opening and closing the electric valve in so small time spaces i designed a thermostat that can delay the sample points. It check's the fireplace boiler temp and drives the electric valve once the water temp exceeds the thermostat limit. After that it waits for a half hour or more and then checks the water temp again.

The Design:

A simple Power Supply design using LM7805 regulator and two capacitors. 


For Menu selection and device configuration a Rotary Switch is used. The selected rotary includes a push button switch as well. 


Two Relays manage to drive external electric valves


The user interface is displayed on a HD4780 LCD Character Display with configurable backlight.


The main MCU is the 8-bit AVR ATMEGA168. A Buzzer manages to indicate the user for a button press or a limit exceeded. Two LM35 temp sensors one internal and one external measure the ambient and pipe – fireplace boiler temp. You can also notice a 32.768Khz crystal. This crystal is used to impliment a real time clock which keeps real time delays.


Writing the Firmware

Writing the Firmware

All the components. The front panel is printed on a laser printer using transparent paper.

All components Front Panel

Milling notes Circuit Top view

Homemade PCB without ISP header to make faster board routing.

MCU Flashing Bottom View

The source code as well as the PCB & Schematic can be found here: