I like to keep my room a little warmer than the rest of the house, so I use a space heater. Problem is, the space heater isn't exactly precision engineered to achieve a constant temperature. So I made an outlet that switches it on and off based on a real thermostat, to get it under control.
This would also be great for an incubator with a light bulb, or any temperature controlled appliance, really. Since the thermostat can switch on to heat or to cool, you could also use it to switch on a ventilator in a hot area.
Here's what you'll need:
- Thermostat. You don't need a fancy one, but do make sure it is not the type with a tilt/mercury switch. You have to install those level, which is a pain. I used analogue, but you might want a fancy-pants digital one. They'll all work the same.
- Relay. This needs to be capable of handling line voltage (120 or 240VAC), as well as having a current rating big enough to handle your load (20A should be good; space heaters are hungry).
- Power supply/wall wart/brick. Don't spend too much. It can be AC or DC output, but it's voltage needs to match (sort of) the coil on your relay (I'm using 9VDC to control a 12v coil). It should have a barrel plug on the end of its cord which fits into the...
- Barrel plug socket. This will be used to connect the thermostat to the relay box.
- Power cord. It needs to be able to handle the load you want to use, and please use a grounded one.
- Electrical box, double gang. Make sure to get a deep one to accommodate the extra stuff we're going to put in it. Use plastic because it's cheap, easy to drill into, and most importantly, an insulator
- Outlet cover, half blank.
- Wire, solder, heat shrink, zip ties, etc.
Step 1: Transformer
Cut open the wall wart and remove the transformer. An oscillating saw does the trick nicely. A hammer and sharp chisel is another good option.
DON'T cut into the transformer accidentally, because if the wires inside get nicked, it's no good anymore.
Cut the low voltage wires off with about 6" of slack. Extend the high voltage wires.
Step 2: Low Voltage Wiring
Connect one of the low voltage wires to the relay coil, and the other to one side of the barrel plug socket. Then connect the other side of the barrel plug socket to the other side of the relay coil.
The low voltage will power the relay coil, interrupted by the barrel plug socket. That's going to connect to the thermostat.
Step 3: Thermostat Wiring
We will use the cord we cut off the wall wart as the connector to the thermostat.
- Wire 1 goes to R and Rh
- Wire 2 goes to W and Y
R and Rh may already have a jumper between them. If not, use a wire to connect them.
Because I want the thermostat to come on for heating or cooling, the W and Y terminals are get connected.
What do these stand for? They're color conventions used in HVAC. It doesn't matter what colors we use, though.
- W: White, controls the heater
- Y: Yellow, controls the AC compressor
- R: Red, provides power from the transformer
- Rh: Red, same as above, but sometimes HVAC systems have separate transformers for heat and cool
Step 4: Box Preparation
Depending on the kind of box you bought, there may be wings for mounting it. Just cut them off with the oscillating saw.
Step 5: Add Leads to the Relay
The relay I used is intended to be mounted in a PCB, so in order to use it, I need some wire leads on it.
Once you add the leads, be careful not to break off the connections into the relay; they're brittle. We'll add some stress relief when we mount the relay in a bit.
Step 6: Mount the Components in the Box
Drill holes where you want to put a component and then zip tie it down. This is why it's convenient to use plastic: you can drill into it and it's an insulator, so you don't have to worry about the components touching it.
Put the relay leads underneath its mounting zip tie so that they're held down for stress relief. Now you can move the wires around without worrying about them breaking.
Step 7: High Voltage Wiring
First, put the power cord through a hole in the box and tie a knot as a stress relief.
The hot wire from the power cord goes to one lead from the relay and one leg of the transformer. I chose to solder these and cap them with a wire nut.
The neutral wire goes to the neutral side of the outlet (wide slot), as well as the other leg of the transformer.
The hot side of the outlet is fed from the second lead of the relay.
In other words, the transformer always has power, and the outlet has power switched through the relay.
Step 8: Mount the Barrel Plug Socket
Drill a hole in the face plate and mount the barrel plug socket. Put the face plate on a flat surface and drill from the back. The plastic is hard and will crack if you push on the front.
Step 9: Close It Up, Try It Out!
After getting everything mounted and wired, mount the outlet in the box and screw on the face plate. Careful not to tighten the screws too much, it's brittle.
Plug the box into the wall and plug the thermostat into the box and it should work! The outlet will switch on and off under control of the thermostat.
To ensure that the heater doesn't try to cycle on its own, turn the heater on and turn the heater's built in thermostat all the way up.