In this article, I’ll show you how to take a regular 5000W electric heater and turn it into a smart heater using a low-cost WiFi smart switch and a relay.
I recently insulated my detached garage and bought an electric heater to warm the space. I’m not in my garage every day, so it would be unnecessary and expensive to keep the space heated constantly. Therefore, on days when I want the garage warm, it will need to be heated from a fairly low temperature. Since it will take a little while to get up to a comfortable temperature, I want to be able to turn the heat on/off from the comfort of my house.
Initially, I thought it might be nice to use a line voltage smart thermostat. I already have a Mysa thermostat connected to an electric baseboard heater in my kitchen. It looks good, it’s very reliable, and I would happily purchase another for my garage. However, the 5000W garage heater is beyond the capacity of the Mysa and all other smart thermostats I found.
Another option would be to buy a heavy duty smart switch that can handle the load ( the 21 Amps of the heater is too much for any standard smart switch). However, all those heavy duty switches come with an enclosure. I prefer to put all my components inside the heater enclosure. So for my purposes, the included enclosure is an unnecessary added cost.
Ultimately, I decided to go the DIY route. Here’s how I did it:
Project plan and wiring diagram
First, I am going to connect a regular smart switch to the coil of a contactor (basically a big relay). The contactor terminals will be connected to the heater. When the smart switch is turned on, the contactor switches will close and the heat will turn on (see wiring diagram below).
If wiring diagrams aren’t your thing, don’t worry. I included step-by-step wiring instructions below.
Second, I’d like to power the smart switch and the contactor from the same power source as the heater. That way I only need to plug one wire into the wall.
Third, I’d like to enclose the Sonoff and the contactor inside the heater so the whole install looks nice and clean.
3 Major components
Here is an explanation of the requirements for the three major pieces of this build:
Most electric heaters will work for this. The main thing is that you need to be able to set the mechanical controls to the “on” position. That way, when the power is turned on, the heat comes on:
heater switch in “on” position >>> power applied >>> heat
You don’t want a digitally controlled heater that requires you to press a button to start the heat:
power applied >>> screen comes on >>> press start >>> heat
Also, my heater is 5000W, but you could buy one with more power if necessary. You just have to make sure that the contactor you buy can handle the power (see below).
There are 3 features to consider when you buy your contactor:
Current rating – The contactor will do the heavy-duty switching. Therefore, it needs to be able to handle the full current of the heater. The heater is 5000W running on a 240V outlet which means I can expect the heater to draw about 21 Amps (5000W/240V). I have to make sure my contactor exceeds this, so I will choose a 30A contactor.
Switch type – The contactor is DPST (double-pole single-throw). What that means is that it controls two circuits (double-pole), but can only turn them either both on or both off (single-throw). In the US, 240V electricity has two “hot” wires (both 120V). It is preferred to have a double-pole switch so that you can switch both “hot” wires.
Coil voltage – The contactor coil should be 120VAC. This will allow you to connect the smart switch circuit to one “hot” wire (120VAC).
I decided to use a Sonoff Basic for my smart switch. I used it because it’s what I’m familiar with, and because I have spare ones laying around. You can use any switch you like, but consider the following:
Current rating – You might be thinking, “You can’t use the Sonoff for that! It’s only rated for 10A. You’re gonna blow up your Sonoff and burn down your garage!”
The Sonoff will not be connected to the heater’s load. The Sonoff switches the coil for the contactor which only requires a minimal current nowhere near the capacity of the Sonoff.
Any 120VAC smart switch with a 10A rating will be more than enough to handle this task.
Wireless protocol – I would like to have a WiFi smart switch (Sonoff is WiFi) to control my heater. I have Z-Wave and Zigbee devices (with a SmartThings hub) in the house, but the garage is too far for the signal to be reliable. However, I used a powerline adapter to extend my WiFi to my garage so that signal is strong.
DIY – The smart switch should have easily accessible wire terminals. You don’t want a fully enclosed smart switch that is designed to be plugged into an outlet. The Sonoff is easily disassembled. The circuit board can be easily accessed for attaching wires.
List of tools and materials
Here is a list of what you’ll need to complete this project:
Heater – I used a ProFusion 5000W heater from Menards, but there’s lots of models that will work.
Sonoff Basic – The smart switch for this build can be purchased by itself or with quantity discounts.
30A DPST contactor w/120V coil – There are many variations of contactors so either be sure of what you need, or buy this one.
Wire Stripper and connectors – You can do this project without a wire stripper, but having one makes it easier. If you don’t have one, the kit in the link is a great deal. The included connectors in this kit will be useful for this build.
10/3 wire– You will need about 1 foot of 10/3 wire (in addition to wire for the cord). I already had 15 feet of wire for the heater cord. The cord was plenty long so I just cut 1 foot from it.
16 gauge wire – The Sonoff terminals are too small for 10 gauge wire so I used 16 gauge wire for the contactor coil circuit. Hopefully you have some laying around because you don’t need much.
Wire clamp – Make sure to get the correct size for your knockout.
Self-tapping screws – You’ll need something to mount the contactor and Sonoff to the heater.
Alright, let’s get started!
Open your heater and find an appropriate place to mount your contactor and smart switch.
Make sure that the screw holes for the components will be in a safe place. You don’t want them to come through the other side and damage something.
2. Remove knockouts
Your heater should have some circular indentations (knockouts) on the case. These are designed to be removable in order to allow wiring to pass through. Find the knockout that is in the most convenient position for efficient wiring and remove it.
My knockout did not come out easily. In fact, I nearly destroyed the heater case and threw it out the window in the process of removing it. Luckily, a few choice words and some focused breathing prevented me from doing something I regretted.
Breathe, Eric. Relax, and just breathe…
I ended up needing a wire snips, a pliers, and a tiny bit of patience (compared to my normal amount of zero) to get the job done.
3. Install wire clamp
The wire clamp will provide a clean point of entry for your electrical wires and also hold them in place.
Install the clamp in the hole from the knockout you just removed. Place the screws for the wire clamp on the inside of the case. This will provide a cleaner look. Also, make sure the screws face a direction that is accessible with a screwdriver.
To tightly fasten the wire clamp to the heater case, use a screwdriver and small hammer.
4. Fasten smart switch and contactor to case
I used 1/2″ #6 self-tapping pan-head screws.
Again, make sure when your screws poke through the other side, they are not going to damage anything important.
NOTE: Before fastening the components make sure you can easily access all the wire terminals. If not, you may want to wait until the wiring is done to permanently fasten them.
5. Connect your ground wire to GND on the heater
If your heater doesn’t have a clearly labeled GND terminal, you can drill your own hole and attach the ground wire anywhere on the metal case.
6. Connect L1 and L2 to contactor input
Your L1 and L2 wires should be the black and red wires. Trim the wires to the appropriate length and strip about 1/4″ off the end. Fasten the stripped ends using the screw clamps of the contactor.
NOTE: L1 and L2 terminals on the contactor are arbitrary. If they are not labeled, just assign one to be L1 and the other to be L2.
7. Connect L1 and L2 of contactor output to L1 and L2 of heater
For each connection, measure the appropriate length of 10 gauge wire. Strip about 1/4″ off each end and fasten using the screw clamps.
8. Connect Sonoff L input to L1 of contactor input
Cut an appropriate length of 16 gauge wire. Strip both ends and insert one end into the L input terminal of the Sonoff. Attach a spade connector to the other end of the wire. Plug it into the L1 spade terminal of the contactor.
9. Connect Sonoff N input to neutral
Cut an appropriate length of 16 gauge wire. Strip both ends. Insert one end into the N input terminal of the Sonoff. Connect the opposite end to the neutral wire (white) using a wire nut.
10. Connect Sonoff L output to contactor coil A
Cut an appropriate length of 16 gauge wire. Strip both ends. Connect one end to the L output terminal of the Sonoff. Connect the other end to a spade connector and plug it into the spade terminal of contactor coil A.
NOTE: The contactor coil terminals are located on the side of the contactor. They may not be labeled. If they are not labeled, just assign one to be A and the opposite side to be B. Polarity does not matter.
11. Connect Sonoff N output to contactor coil B
Cut an appropriate length of 16 gauge wire. Strip both ends. Connect one end to the N output terminal of the Sonoff. Connect the other end to a spade connector and plug it into the spade terminal of contactor coil B.
12. Plug in and set up Sonoff
The wiring is done! Now, plug the heater into the wall outlet so that the Sonoff has power. Use the mobile app (eWeLink) to setup your Sonoff. You may want to leave the case open to allow for a better wireless signal.
13. Close heater and test signal
Once the Sonoff is setup, try closing the heater and see if the wireless signal still works. If it does, you’re good to go. If not, you may have to relocate the Sonoff to the outside of the heater case. It’s also possible to add an antenna to the Sonoff, but I haven’t needed to do that yet.
14. Set heater to desired settings
Set the mechanical switches and dials to your desired settings so that the heater turns on when the power is applied. My heater has several different heat intensities as well as a thermostat dial.
15. Add desired automation
Okay, the hard part is done. Now, the fun part.
I use Alexa for nearly everything. Therefore, I named my Sonoff “garage heat”. That way I can say, “Alexa, turn on garage heat.”
I know this is a fairly simple project, but it’s one of the most useful smart home projects I’ve done. I hope you find it useful, too.
This works great for an electric heater, but there’s no reason the same method couldn’t work for other heavy electrical load applications.
Feel free to suggest any modifications/improvements in the comment section below. Thanks for reading!
26 thoughts on “DIY: How to make a smart garage heater”
Nice work! This is an excellent writeup with clear pics. Thanks for putting so much time into it, it saved me a bunch of time!
Glad you found it useful!
Hi Eric! Love this guide!
I’m looking to use a Sonoff smart switch as well, but I would like to use one that has energy monitoring. Since you aren’t connecting the Sonoff smart switch in series with the appliance it it wouldn’t be able to measure the power draw of the appliance. Is this true?
If this is the case, have you encountered a smart switch could control the contactor as you’ve designed, but still measure the power draw of the appliance?
Thanks for the advice!
I’m glad you found it useful. You are correct that in this wiring configuration, the Sonoff’s energy monitoring would not be very useful. However, you could just record the length of time the Sonoff relay is activated and multiply that by the power of the heater. This would be very easy and reasonably accurate. The only reasons it wouldn’t be accurate is if a) your heater has its own thermostat and is frequently turning on/off while the Sonoff relay is engaged, or b) your heater uses variable power.
This worked great, just insulating my garage to make a workout room and needed to be able to get it warm before we go out in the morning. Quick question, everything worked great. however, I’m getting a humming/buzzing from the Contactor. Any clue what could cause that or is it normal? The buzzing increases/decreases as I go higher or lower heat settings. Units seems to be working properly, just want to make sure I don’t have a bad contactor or something else I should look out for. Thanks!
Most likely it’s the mechanical relay just doing it’s thing and nothing to worry about. A solid-state relay would be silent.
David – I have the same “issue” with the buzzing. Google says the buzz isn’t normal and it could be loose parts inside the contactor that cause the buzz. But if you’re having the same issue I guess it’s just a normal behavior. Perhaps I’ll get one from another brand and hopefully eliminate the issue. The buzz can be quite loud sometimes!
Hey thanks so much for the guide! I followed the guide and did the exact same thing for my two baseboard heaters in my sunroom, works great. One thing though, I got the same contactor that you did, and it has this buzzing noise when the coil is energized. The “pitch” of the noise actually changes every time it’s powered on – sometimes it’s louder, sometimes can barely hear it. Does yours do the same? I wonder if it’s normal. Thanks Eric.
I’ll be installing on a Fahrenheit FUH54 heater. Will this setup allow the fan to run for cool down after the heater coil turns off like it does with the factory setup? If not how can this setup be altered to achieve that?
Hi, I only have two hots (L1 and L2) and a ground (bare copper) 10-2 wire.
It looks as yours is 10-3, you show your Sonoff connected to the Neutral from the outlet.
Will this work with just using the ground (bare copper) to the heater?
Hey Eric, This DIY project was made simple thanks to your clear and concise instructions. Using on a Newair 5000 watt garage heater and works like a charm.
Thank you for spending the time on this, I will definitely watch for any further projects.
All the best,
Rob from Canada
Cool, glad you found it useful!
Great guide. Thanks.
Now I’m trying to figure out how to handle doing this for a 240v 20 amp heater (i.e. 4000w). These typically plug into a receptacle. Problem is that the power cords don’t include a separate neutral. You have an energized white and black – plus a ground. That’s it.
Anyone have an idea? Thanks again!
For those like me stuck with a 20A 240v heater, here’s the only answer — run your Sonoff Basic line separately to a 120v outlet. It worked for me since I had a 120v receptacle next to the 240v receptacle.
Had this page bookmarked for awhile, and just got around to installing it all tonight. The failure points seems to be setting up the Sonoff switch. None of the setup options worked for me and the app’s behavior is a bit wonky (and it’s also from Shenzhen… sigh). I get the feeling even if it does setup OK, it will fail me at some point. So I might resort to using an extra Wyze smart plug to apply power to the contactors. I much prefer that in a number of ways.
Thanks for the guide on setting it all up though.
Hi PJ, glad you found it useful! I totally get not wanting to use a Sonoff. I used the Sonoff because at the time it was really popular among DIY’ers. It’s very low-cost and has the ability to install custom firmware to make it locally controlled.
Like you said, there are lots of smart switches that could be used instead, so definitely use whichever works best for you.
Thanks for your article, I’ve made use of the information to make one of the two elements on my water heater smart. I have Economy 7 electricity (UK) and one of the elements is connected to the cheap rate and the other to the day time, more expensive rate. Now I can switch on both elements at night, plus I can also now do this remotely, for instance if I am away from home. I also have a boost button on my home assistant dashboard which allows me to switch on the element during the day.
I am also thinking forward to when I get solar panels installed I can now automatically switch on the water heater when I know the panels are generating electricity. Thanks.
Awesome! I got thru everything and realized that I’m using 220. I also got this exact contactor so thinking it’s only rated for 120. Great tutorial though!
Hello. Love your clear, concise instruction and photos. Brian above asked my question but I don’t see that you responded to him. perhaps you did so privately. My 30a, 5000w, 240v heater only required 10/2 wire. two hots and a ground. Since I don’t have a neutral wire from the box, is there a workaround without rewiring 10/3 to my heater from the panel? Would appreciate a response at your earliest convenience.
Glad you found the tutorial useful.
I think many smart relay switches will work with 240V so you should be able to connect them to the 2 hot wires. For example, these super cheap Sonoff switches operate with input voltage of 90V-250V https://amzn.to/3S2UQBi. Of course, in this case you also have to make sure your contactor coil operates using 240V as well.
Hi, I wanted to know what program you used to create the wiring diagrams? They are awesome. Thanks in advance!
Hi David, I used LibreOffice Draw I know there’s quicker and easier ways to do it, but this one is free. I don’t make diagrams like that frequently enough to justify paying for software.
I want to use your setup to engage a 50 amp breaker in place of your heater. The breaker is 50 amp 240 volt, HOWEVER it has a NEUTRAL. I see that your heater did not have a neutral. What can be done for a neutral from the Contactor to the Breaker?
Sorry, I’m not really sure what you’re asking.
Instead of using your heater as in the diagram, I will use a 50amp smart breaker which has Ground, L1, L2, and NEUTRAL. How do I connect Neutral to the breaker?
Oh, okay. So you’re basically planning on using the smart breaker the same way you might use a smart relay. Unfortunately, I’m not too familiar with those devices, so I’m not able to give you any sound advice. Typically, they are intended to be installed inside a panel where you should always have the required L1, L2, and N.