It's very simple.
I want to 开发者_如何学JAVAplug 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?
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.
(source: electronickits.com)
There are X10 products for the UK (and European) power systems as well, complete with UK 3-pin plugs.
The projects you've seen for the American system can be applied to the UK simply by buying the UK version of the products.
To send and receive commands on the powerline, you would need the CM12 module, which can be programmed through the serial port as you require. In addition there is already a selection of off-the-shelf software that can control the CM12 module. It might be easier for you to interface with such software, instead of controlling the CM12 directly.
A popular online vendor of UK-based X10 products is Let's Automate.
Try the iBoot . . . we use it at hospitals . . . very reliable uses a very simple interface. UK power is available as well . . .
I am a happy customer of Phidgets products and this one would satisfy your requirement: PhidgetInterfaceKit 0/0/4 (interface is through a USB port).
Product Description The PhidgetInterfaceKit 0/0/4 Provides a convenient way to interface your PC with various higher-voltage devices such as incandescent bulbs, high-power relays, and motors The 1014 contains 4 Relay Outputs for switching AC or DC power; the relays are Single Pole Double Throw (SPDT).
In terms of software control, Phidgets Inc. offer many libraries.
(source: phidgets.com)
精彩评论