serial-portparallel-portinterfacing

programmatically controlling power sockets in the UK


It's very simple.

I want to plug a lamp into the UK mains supply.

I want to be able to power it on and off from software - say from serial port commands, or by running a command-line or something I can get to from ruby or Java.

I see lots written about how to do this with X10 with American power systems - but has anybody actually tried doing this in the UK?

If you got this working:

1) Exactly what hardware did you use?

2) How do you control it from software?


Solution

  • There is really no differences on what you have to do on the US and on the UK. What you need is either use the parallel port, from which you can control 8 sockets without hardware multiplexing, and up to 256 with multiplexing, or a microcontroller with serial/USB communication support (you could use PIC, which are easy to program with assembler) to control the same kind of hardware: a board with either triacs of relays (I'd recommend relays, as with them you don't have to worry what device you connect/control) that support the voltage of your electric grid, and some transistors to actuate the triacs/relays, to decouple the control circuit with the power circuit.

    The DIY hardware needed to do this is not really that hard, and you might learn some if you've never done electronics.

    If you have a computer with a parallel port and a small amount of devices to control, I'd go with a simple circuit that couples every output of the port to a transistor that actuates the relay, which closes the circuit for each device.

    There are some already built circuit boards on the market that you can buy, but I can't overstate the fact that it's not hard to DIY.

    Some already built relay circuit.
    (source: electronickits.com)