Computing stuff tied to the physical world

Meet the Relay Plug

In Hardware on Aug 18, 2010 at 00:01

Here’s another plug, useful for various applications around the house – the Relay Plug:

Dsc 1812

This one uses miniature relays to control two independent contacts. It has two MDC3105 relay drivers on board, and uses the same detachable terminals for connection to the outside world as the MOSFET Plug.

Unlike MOSFETs, relays provide a fully isolated switching capability. There is no electrical connection between the switched out pins on the terminal block and the JeeNode. The traces on the PCB were in fact laid out with a wide separation between switched pins and the rest of the circuit.

These plugs have just the right size for the Carrier Board + Box, by the way:

Dsc 1823

The relays currently used for this board are rated up to 3A @ 250V (both AC and DC). This means that you could use them for controlling up to 750W worth of devices connected to the mains on each output. Just keep in mind that messing around with the mains voltage is dangerous and can be lethal. Note also that neither the pins on the underside, nor the screws on the terminal blocks are isolated, so you’ll have to consider really carefully how to physically mount everything to prevent shock hazard. I definitely wouldn’t use these plugs for mains power in the box as shown above – such a box can easily open when dropped.

Did I mention that AC mains can be lethal? Ah, yes, I think I did…

Then again, if you know what you’re doing: sure, go right ahead.

For the rest of us, these relays are probably more suitable for controlling low-voltage lights, motors, fans, and… larger relays. One item on my (infinitely long) to-do list is to use these relays to control the power of a couple of external hard disks. Not just to save on electricity when not in use, but also because disks which are not powered up and hence don’t rotate are pretty safe from software mishaps, both accidental or malicious.

The relays are driven from the PWR line, which has to have a supply voltage between 4 and 6V to operate properly. Less, and the relays won’t turn on – more, and the relays + relay drivers will be damaged. Each relay draws about 30 mA of current while turned on. They are not latching: power loss will switch them off.

Controlling the relays in software couldn’t be simpler: use the Port class in the Ports library to set both DIO and AIO as outputs, and then use digiWrite() and digiWrite2() to control DIO and AIO, respectively. Since each relay uses up one port, you can have up to 4 Relay Plugs, i.e. 8 relays hooked up to a single JeeNode.

Here’s an example which listens for incoming radio packets to control a Relay Plug on port 1 (this example is included in the Ports library as “relay_demo.pde”):

Screen Shot 2010 08 15 at 23.18.02

Sending “1,1,17s” via another JeeNode or JeeLink turns both relays on. Sending “0,0,17s” turns them off again.

Documentation for the new Relay Plug is in the Wiki, and there’s an order page in the shop for them now.

  1. AFAIK here in Germany it wouldn’t even be allowed to switch mains power with this plug, because IC-A is way too close to one of K-D’s output pins.

    For the next version of this plug, I’d suggest to change the layout so that no logic level trace is closer to a relay’s switch pins than the relay’s own coil pins. I think this would be possible without enlarging the board by placing the relays somewhat further apart and putting the drivers to the bottom side, next to the coil they are driving.

  2. Come on JC, admit it, you haven’t been away really have you… You sent your wife off alone with the camera and you’ve been hiding in your super secret inventing shed :-)

    This board does kind of answer a question I was going to post about the MOSFET board, namely if you had any plans to do a mains voltage version. Although personally I would have gone with optoisolator drivers and triacs. Preferably zero switching to prevent all that nasty RF caused by switching mid cycle. Might be a bit of a squeeze on the little board though.

  3. Hi JC, have you also considered using a solid state relay. For example S202S12 Series with snubber and zero crossing included.

  4. Interesting… one new plug, 3 comments on switching mains power :)

    I’m willing to look into this, but not as a plug – I simply see no way to send out a mains-switching pcb and sleep well at night. The only option will be something that is closed, isolated, and driven by a harmless low-voitage level. Until then, I will continue to advise using an RF-switched solution…

    P.S. Building a JeeNode’ish solution into a power box/socket of some sort would be another option, but that means it must be very small and sufficiently low-cost, including a power-supply… got some vague thoughts about such an approach, but that’s all they are for now.

  5. Putting things into a nice box, with a nice recognised connector is always going to be a challenge/problem. Well maybe not for you guys in mainland Europe, but for me on this little island off the west coast it will… We do insist on having our own fused plugs/sockets with rectangular pins and an earth.

    On the plus side we do also have this things for sockets with switches… So much easier than having to pull the phone charger out of the wall when you’re finished. I lose track of the number of Euro sockets I have seen on the mainland which have started to work lose from the wall due to the constant in/out use.

    It’s also rather lucky as a 13A UK plug laying on the floor will invariably end up facing pins upwards, and I can assure you they hurt like buggery if you tread on them in the dark!

  6. From the specifications it is not clear whether the relays need continuous drive or single command(as no part number is specified from them :( ).

    Also, what is the required current to for the relay drivers? Ibias is 0.8mA and Iout can sink up to 400mA, but this depends on the relays.. :)

Comments are closed.