Control System for Heat Cable


In a horse stable, water pipes were installed for horse drinking troughs, which used to be exposed uninsulated to temperatures in winter. To protect those pipes against bursting caused by frozen water, they used to get emptied and turned off. The horses had to be supplied with water by carrying water buckets during the winter season by hand.


We installed along those water pipes a self regulating Heat Cable. When connected to 230V, it heats evenly up. The water pipe and the Heat Cable are covered with insulating tubes. Caused by the fact that the bacteria count (especially legionella) is rising drastically at temperatures above 30°C, the water temperature must be limited and controlled automatically. Also the current and the temperature plausability should be supervised aswell as a push message, which should be sent when a failure appears. For those tasks, i conctructed a switchbox and developed a program for the ESP8266-12 Microcontroller.



Function description

If a temperature is getting lower then the adjusted minTemp, the heating pipes are getting switched on until they reach the maxTemp. If the environment temperature sensor is still under minTemp, the heating control will hold the waterpipe temp between the maximum and the midpoint of minTemp and maxTemp so the warming process doesn’t go all the way from min to max all the time. If a relay wears out, which is quite normal after thousands of switching operations, the smart control will send a pushmessage to inform you about that problem.



Following safety issues are covered by this system:

Electrical Part

  • Manual meassurement of the isolation resistance of the Heat Cable
  • Overcurrent on a heat Cable-Line (all three lines, each secured by 5 amp fuses)
  • Earth fault (30mA RCD mounted in the switchbox)
  • Detection of “non-plausible state” e.g.:
    – relays should be off but current is above zero amps / relays are on but there is 0 amps measured
    – measured temperatures are unrealistic or way to high/lowIf detected, the system will turn off and lock the relays until you reset the generated failure-mode over the web interface. Also, you get a push message alert with detailed information about the fault via the free messenger Pushbullet.

Controlling security

  • To edit settings in the heat Cable control system web interface, you need to know the username and password to access the control sites. The main page is visible for everyone.
  • Because the ESP8266 is, in my case, not accessible from the internet, I don’t need any more security like TLS or an HTTPS connection.
  • The manufacturer ESP provided quickly for a firmware-update which protects against the “Krack Attack”.



LCD-Display and rotary switch

Standing infront of the switchbox, you can choose between different information screens. The 4 x 20 LCD shows at this time four screen options:

    • Strom & Leistun(current and power consumption)
      – shows the current of all three lines
      – shows the current power consumption
    • Regeltemp (control temperature)
      – shows the adjusted minTemp, maxTemp and the hysteresis middle temp
    • Temperaturen (temperatures)
      – shows the temperatures inside the switchbox, the pony stable, environment and the main stable.
    • WLAN (Wi-Fi)
      – displays the current SSID
      – the Wi-Fi connection status
      – the connection quality ( in an approximately dBm value)


Web browser controll

Controlling Page after a successfully authorization

The integrated web browser controll menu, which is sent right from the ESP8266, can be displayed by any browser. After a successfully authorization, it offers following options:

  • all variables can be shown live in the web browser. This can be important for programming, update developments etc.
  • min and max heating temperature can be adjusted from remote
  • the flash-mode for uploading the compiled code over Wi-Fi can be enabled with an automatic 2-minute countdown. After that, the program and the LCD return to their normal status again. While the flash mode is active, the LCD and the website will inform about the flash mode status.
  • all values stored in the EEPROM can be reset
  • Wi-Fi Connection can be reconnected to switch the access point in a homogenous namend SSID area.
  • An I2C-Scanner scans for adresses from responding I2C- slave devices
  • the ESP8266 µC can be restarted
  • a Pushbullet notification can be sent from the ESP8266 for testing purposes


Maria DB ( SQL Database)

All intresting values are saved in a local database. This can be helpful when searching for failures or just get a closer look how hot or cold the pipes get. All data is beeing sent every two hours. If the heating process is active, it will be sent every 15 minutes. So it is possible to take a closer look at the heating periodes.

The data of the temperatures, current, power consumption and wireless signal can be viewed in a normal web browser.

All Data is stored in the local network on a Linux Server, so that the system is not dependent on external Internet services. But, of course, an external SQL-Server can be an option.


4 Relay Module

To switch the 230 volts, i use a 4 Relay Module, which is connected to the controll system. Transistors and optocouplers on that board protect against any dangerous currents, drawn by the µC.


DS18B20 unencapsulated

The temperatures are measured by DS18B20 sensors. Those can be bought encapsulated and watertight. They can be read reliable (digital) and got at a meassureing range of -55 °C to +125°C a tolerance of +/- 0.5 °C. Since these run on an Onewire bus system, it is possible to read a very large number of these sensors with only one pin of the μC (excluding VCC and GND).


Current Sensor ACS-712 20A

To measure the current of the individual heating strands, I choosed the ACS-712 20A chip. These convert the measured alternating current into a DC signal.

ADS 1015 I2C analog/digital expansion board

To capture the analog values of the current sensors and the potentiometer (for menu selection), an analog expansion board had to be integrated. This provides up to four analog inputs, which can measure from 0-5V in a resolution of 3mV (with this module more accurate measurement with multiple inputs is also possible).

Logic Level Converter (back)

Since the ESP8266 operates on a 3.3V base, a logic level converter was used to drive the relay board. This converts 3.3V to 5V signals bidirectional. In addition, the onewirebus of the temperature sensors is also read out via this.


One Reply to “Control System for Heat Cable”

Leave a Reply

Your email address will not be published. Required fields are marked *