# Solved: Using a PC to control a mains power relay switch



## tmetford (Apr 8, 2008)

I want to use my PC to switch on/off the power supply to a 2.5Kw storage heater at my place of work.
At the moment I have a PC there which I can control remotely and I'd now like to use that PC to control the heating in my office. 
In particular I want to know how to connect the PC to some electronically controlled relay switch (that can handle mains 240volt 30amp) but I don't know where to start or how to do this. Also I'll need some appropriate software (operating system on the PC is Windows XP) with which to programme the operation of the switch to the heater.
What component/device/cable/PC port (i.e. Serial port like COM 1, USB, Parallel port) would connect the PC to the relay switch?
I do have some DIY skills though a novice's guide to wiring up a relay switch to a PC and requisite software will be important here!
Thanks for your help.
Tim


----------



## etaf (Oct 2, 2003)

It can be done 
heres a link to a USB relay device - *NOT* enough power for your application
http://www.sigma-shop.com/product/7/usb-relay-controller-one-channel.html

so its easily done - just need to find one with a suitable relay - or you could use this relay to switch a another relay that is correct power 
Something like this one http://www.maplin.co.uk/module.aspx?TabID=1&criteria=usb&ModuleNo=37495&C=SO&U=Strat15 - the 240v switch may be the one to look into

* LOOK into this a little more before purchase *


----------



## paisanol69 (Sep 7, 2005)

both of the links *etaf* provided are exactly what you will need, however consider the following before you "build" your remote heater control:

1. The heavy duty relay in the second link, its contact function are in the "de-energized"state, so be sure to wire the heater to the N.O. / Common contacts, so that when the computer energizes the relay, the power will be passed to the heater.

2. Install a "bypass" switch around the heavy duty relay, to provide for the heater to work, in case your computer fails, or has a problem, that way, you will still be able to heat your work space, while trying to fix/repair your computer.

3. You could also purchase an inexpensive thermostat, and wire/connect it to the low voltage circuit coming from the computer, to the coil of the high voltage heavy duty relay. That would allow you to set a desired temp for your work space, and avoid running the heater excessivly ( since your computer will only give you the option of full on, or completely off control)

best of luck, and let us know how your project turns out!!


----------



## robinofloxley (May 11, 2009)

More trouble than it's worth. Get one of these LCD 7 day on off timers.

http://www.maplin.co.uk/module.aspx?TabID=1&criteria=usb&ModuleNo=97806&C=SO&U=Strat15

You can also find them in Tesco and Pound shops (but still about 10 quid)

Linking PCs and relays and heaters will probably invalidate your work insurance and get you into trouble with elf and safety.

Even on a timer, make sure no-one can put boxes or bags in front of the heater.

A 13A socket can handle 3kW. 13Ax230V


----------



## paisanol69 (Sep 7, 2005)

robinofloxley said:


> More trouble than it's worth. Get one of these LCD 7 day on off timers.
> 
> http://www.maplin.co.uk/module.aspx?TabID=1&criteria=usb&ModuleNo=97806&C=SO&U=Strat15
> 
> ...


.....probably the simplest, and easiest solution :up:


----------



## Frittmann (Jan 18, 2010)

This project brings back some memories for me. Back in the mid 80's, the days of 8-bit computing, I used to have an Atari 800XL computer which had dual joystick ports that were addressable programmatically and could be used for both input and output. Old joysticks were often relieved of their cabling, which was recycled to connect between the joystick ports and somer custom veroboards (which may or may not have been encased in a project box), which were generally configured with transistors, microcontroller chips, and relays. We could control A/C devices or monitor environmental detectors through them. A simple home alarm system could even be built using them. I had my Atari machine running the electric kettle, the heater, and the toaster at one pioint, and everything was timer controlled via an Atari BASIC program that I had written. Those were the days! 

These days, they use PCI cards, or the USB device mentioned above by *etaf,* to achieve the same effect. I've seen many such PCI cards in use in industrial settings since then. Thanks for the memories, *tmetford*, and I hope your project works out well.


----------



## tmetford (Apr 8, 2008)

I take your point; it's an obvious and simple solution!
I was wanting to control the heating remotely and, although I've come across the kit I need for that I do take your point about Elf & Safety/Insurance invalidation etc.
Thank you for your timely suggestion.
Tim


----------

