I’ve thought of a new project. I’m going to build a plugin controller for a mains power socket. This will replace the cheap ones that I have for the telly/AV gear in the living room, that turns off the playstation, mythTV PC, amp, sub-woofer and telly so nothing is on standby and the ones that are used in the study to stop the PCs on our desks using power when off.
So where to start? Let’s start with some requirements.
- It must be able to turn the mains on and off to a socket.
- It must be remote controlled
- It could measure the power used (Watt meter)
So I will need a relay or triac, radio, some controller and possibly some way of measuring power.
I’m going to tackle this project in 5 parts (which might change as I go along)
- Power supply. The controlling electronics is going to need a 5 volt supply. Rather than use another socket for a wall-wart I’ll need to build one from scratch.
- Micro-controller. It’ll need some brains. Since I have a bunch of Arduino Nano clones knocking around I’ll use them to start with and probably have an embedded Arduino compatible circuit in the end.
- Radio. There will need to be a radio for control and to report readings about power usage.
- Relay. To switch the mains on and off.
- Power sense. There are two ways I could do this, that I have found. More about that in a later post.
So I’m ready to start. First thing is to look on the Internet and find out what people have done before.
For controlling a relay the tutorial at SparkFun is excellent so that part should be easy. I found a site I’d bookmarked a long time ago called OpenEnergyMonitor that has done the sensing technology. They have two methods documented on their site for measuring power. The invasive method involves using a current sensing resistor and a potential divider directly across the mains and the non-invasive method uses a current transformer.
For the radio I could use XBee transceivers which are excellent but they’re expensive. I found what look to be nice FM transceivers on Farnell and will be trying those out. I also found a page that appears to detail somebodies attempt to use them with an Arduino (I’ll know more when I translate it into English).
The power supply should be simple. A transoformer, a bridge-recifier, a couple of caps and a voltage regulator should do the trick. Designs for these are all over the Internet such as this one on discovercircuits.com. For the invasive power meassurement design I will need two independent power supplies. I can do this easily enough by getting a transformer with two secondary windings and building the power supply circuit twice. More on that in a later post.
Well I’ve got a lot to be getting on with. So the next stage to make an order for components and start building.