Space Heater Control

Space Heater Control

I’ve got two wall mounted space heaters made by King Electric.  They are the Pick-O-Watt series and have a built in thermostat for control.  They are easy to install and the option to set the load is useful.  Setting the output wattage to match the room they are installed in saves energy.  However, they were not centrally controlled.  If one was left on, energy was wasted and is potentially dangerous.  I wanted to avoid this.

First, lets look at how it operates in factory condition.  The thermostat directly linked the mains electricity to the load.  When the dial on the thermostat is turned on or off, the contacts in the thermostat change to either open or closed.  This determines whether the heater element gets electricity or not.  The thermostat has built in hysteresis, that gap prevents damage to the heater element from  toggling on and off repeatedly.  The wiring is heavy gauge wire to handle the loads drawn by the heater element.  Linking the heater element to a central thermostat would require extensive electrical wiring.  I decided to use a micro-controller to bridge the thermostat to my controller and back to the heater element load through a solid state relay.

The solid state relay is an Inkbird rated at 25 amps, which can be purchased for under $10.  The relay will turn on when a 3-36 volt supply is applied to the input.  I’m using a transistor driver circuit as a buffer between the relay input terminals and my micro-controller.  My ATX 5 volt supply line will be used to turn the relay on.  The relay can handle 24-380 volts AC load.  I use it to handle a 750 watt load from a 120 volt AC supply, so that just over 6 amps.  Higher loads would require a heat sink.  I mounted the relay to the space heater chassis with thermal compound.

The micro-controller is an ATTiny84.  The ATTiny84 was selected because it has I2C support that I was able to get working without much effort.  This micro-controller is also used in my smoke detector housed multi-sensor endpoints, which I’ll cover in later posts.  It has the ability to handle logic conditions and do the work that the thermostat had done.  I have several variables programmed into the sketch that are central to the logic functions.  These memory registers collectively create the conditions that operate the space heater.

When the thermostat changes state from on or off, it changes the Attiny84 memory register named “ThermoState”  The Attiny84 will change the state of the memory register named “RelayState” based on the value contained in the “ThermoState” variable.  When the “RelayState” setting is on, the Attiny84 sets the output of one of its pins high, which drives the transistor.  This transistor then switches on or off based on that input and thus turns on or off the solid state relay it is connected to.  The solid state relay is connected between electrical mains and the heater element load.  This is the identical working conditions of the unit as it is from the factory.

Next, I fed a low voltage 4 wire link from my controller to the space heater.  This supplies the 5 volts and ground, as well as the SDA and SCL I2C data lines.  I’ve programmed all of my I2C slaves with unique identifiers.  With that unique ID, my I2C master can query the values in the memory registers on the space heater micro-controller.  I’ve also setup memory registers on the space heater micro-controller so values from the I2C master can be set, these are “TimeOverride” and “TempOverride”.

I use the “TimeOverride” to turn the space heater off at specific times.  For example, it will not turn on in the summer or when everyone is asleep.  I’ve also set a memory register so that the space heater will turn off after 2 hours of continuous use.    If someone dials the thermostat off and on again, this resets that “TimeoutOverride” value back to zero and the space heater will turn back on.  This timeout period  can be adjusted on the I2C master, so no need for me to reprogram the space heater micro-controller.  The last control variable is if the outside temperature is above a specific value.  If it is, then the space heater will not turn on.  I’m pleased with how well this has worked.  In the past, I typically turned the mains circuit breaker off in spring and back on in fall.

One last thing is I’m able to graph the usage and operation of the space heaters.  The I2C master queries the Attiny84 registers and passes these values back to my Raspberry Pi.  Here I use Cacti graphs that track the operation and I also have email notifications when the unit operates in an unexpected fashion.  Fundamentally, that is how all of my smart devices work throughout the house.  All in all I’m pleased with how this worked out.  I hope you have enjoyed this and look forward to expanding on this subject.

Comments are closed.