Kaliko Systems Limited

Make a Low-Power Media Server

Choosing a Relay Board

A relay board (often called a relay card) is an electronic circuit board that provides one or more relays and electronics to interface to your computer. There are many vendors of these boards (a Web search for "Relay Board" will show most of them). The boards are used for many industrial and home control applications, e.g. solar heating, tropical fish tanks, satellite dish positioning, model train tracks and even cocktail mixing. I use a relay board to control power to the external USB hard drives on my home media server.

Relay boards differ very significantly, so choosing a relay board for your application may not be a simple decision. The relay board type must be considered in the context of your overall control system. A simple generic model for a PC relay board based control systems is shown below:
Model for relay board control system
Your choice of relay board will probably be strongly influenced by the other components in your control system. So I suggest that you fully identify the PC and the equipment parts of the above model for your application, before trying to decide on your relay board. Otherwise, typical problems that can occur include: selecting a parallel port relay card, then finding that your PC does not have a parallel port, or finding that there is no software for driving your relay board from your Linux PC.

The primary features of a relay card are:
  1. Number of channels (i.e. independent switches).
  2. The number of channels is not always the same as the number of pieces of equipment to control, as several pieces of equipment can be connected to a single channel and also you may want some spare channels for later expansion. Typically the number of channels on commercial relay boards are : 1, 2, 4, 8, 16 or even 32.

  3. Type of the relays and number of poles on each relay.
  4. The type of relays is either electro-mechanical (standard relays) or electronic (Triacs or FETs) and the type determines the relay's life-time counted in number of switch operations. Electronic relays switch without wear, unlike a electro-mechanical relay, but for most uses of relays the number of operations is not really an issue.

  5. Current and voltage capacity of poles.
  6. The minimum current (called wetting current), maximum current and maximum voltage will be specified by the board supplier. The wetting current is the minimum current required to clear the oxide on the contacts, this is only really an issue if switching signals (where gold contacts are always best). The maximum current is often not limited by the relay, but by the relay board's printed circuit tracks. Where this is the case, the soldering of additional wires in parallel with the tracks can allow for higher currents. The mains surge currents for low-power electronic equipment will often be several amps, as smoothing capacitors are charged, so always use relays rated at 5 amps for mains (I have blown several 2.5 amp fuses on a small 15 watt mains electronic device).

    The maximum relay voltage must allow for voltage spikes, particularly caused by switching inductive loads.

    The number of poles on each relay is usually 1 or 2. For most mains control, I think it is safer to have an unswitched neutral; so I prefer to use a single pole on each relay. However, for reversing AC or DC motors you will often need 2 pole relays (most relays are single pole, but 2 throw, with normally open and normally closed terminals).

  7. PC connection type may typically be:
    1. Parallel 25 pin D connector (note, not a Centronics 36 pin connector).
    2. Serial 25 or 9 pin D connector.
    3. USB (usually a B end connector).
    4. TTL (usually a terminal block)
  8. Using a parallel connection requires extra work with PCs running Windows NT based operating systems (e.g. Windows 2000, XP, Vista, etc), as these operating systems set all the data pins to the "on" state during boot. Some USB relay cards do not require/support external DC power supplies and use power from the PC USB port. For more than 1 relay on such a board, then these boards may not work from un-powered USB hub ports or from USB ports on battery powered PCs. For more specific details see my relay boards page.

  9. PC software support.
  10. Most relay board vendors provide software for one or more of the common PC operating systems. However these are often GUI based, but I want to use my relay boards from Windows batch files (and Linux/Unix shell scripts) so need a command line interface. I have added an overview page on Writing Relay Board Software.

Other considerations like, board size, external DC power requirements, quality of isolation, position of status lights and reliability may also affect your decision. Of these considerations, isolation is particularly interesting. All relay boards provide isolation, but some vendors provide "double isolation". By this term I mean, they provide opto-isolators on the input pins from the PC and secondary isolation using normal relays on the mains side. However, I am not convinced that this "double isolation" is of significant value as normal relays provide typically isolation to around 5KV, but opto-isolators are often only around 2.5KV.

I have recently purchased USB relay boards from JBS (see my relay boards). These are the easiest of my boards to case and are a good price. Having a USB interface makes them simple to use with Windows NT based operating systems and modern PCs that often do not have Parallel or Serial ports. However these relay boards do not have a XP command-line interface utility, so I written one and will share it here once I have permission agreed with the author of the USB HID library that I used. The site http://www.loggytronic.com has a Relay Board page, and this has code for both graphical and command-line Linux utilities specific to the JBS boards (I use this code myself) . The only restriction with the JBS relay board is that it does not allow for an external power supply, so needs to be connected to a USB socket on a mains powered PC or hub to get enough current.