Control gas boiler with Arduino

In this post we will see how we can control a gas boiler with Arduino

Total Price: less than $120



Hardware Needed

otio-thermostat-universel-mobile-sans-filOtio programmable thermostat

This wireless thermostat contains 2 parts. The first is the programmer and the second one is a in-wall box to connect to the boiler.

Price: less than $80

ArduinoUno_r2_front450pxArduino Uno

Price: less than $30 (SparkFun)


And some electronics components for less than $10 :

  • A green LED (Sparkfun)
  • A 68 Ohm resistor (Buy a full kit – Sparkfun)
  • Somme connectors header connector 1′ (Sparkfun)

Take apart the Programmable thermostat

Inside you will found two electronics card soldered the one to the other. The interesting one is the little one. The little card is the wireless emitter.



The pinout of the little card is indicated on the big one after unsoldering.


  • VCC is 5V+
  • KOFF will force the boiler to OFF
  • KON will force the boiler to ON
  • GND

We can report this pinout on the interesting card.



Electronic schema


Prepare a shield for the Arduino

Test the shield: plug it to your computer



Time to Code:

int KON  = 13;
int KOFF = 12;
int incomingByte = 0;
void setup() {    
  pinMode(KON, OUTPUT);  
  pinMode(KOFF, OUTPUT);    
void loop() {
    if (Serial.available() > 0) {
            incomingByte =;
            if (incomingByte == 'o') {
              Serial.println("put in off");
              digitalWrite(KOFF, HIGH); 
              digitalWrite(KON, LOW); 
            } else if (incomingByte == 'i') {
              Serial.println("put in on");
              digitalWrite(KOFF, LOW); 
              digitalWrite(KON, HIGH); 
            } else if (incomingByte == 'a') {
              Serial.println("Automatic mode");
              digitalWrite(KOFF, LOW); 
              digitalWrite(KON, LOW);

Now ‘o’ character will power off my boileroff

‘i’ character will power it onon


And ‘a’ character lets another other programmable thermostat manage the boiler (it is the WAF part)

Capture d’écran 2013-09-11 à 21.46.38


Next step is to connect the Arduino to wifi network in order expose a Web Service to manage the boiler from anywhere…


  1. Hello Vincent,
    Thanks for this tutorial.

    I’m hoping to try this with a slightly different thermostat
    this one here:

    Is it possible to have the arduino connected in parallel with the
    original thermostat. So that the original timer could still be used,
    but the arduino could turn boiler on/off aswell?
    sort of like an override?

    Best regards,


Leave a Comment.