Choosing the Right USB Relay Controller

USB Relay Control devices are a common and convenient choice for basic computer controlled switching applications.  When considering a USB relay board, the application should be critical to your choice.  Not all USB controlled switches are ideal for all applications, particularly when it comes to high voltage switching or switching of inductive loads.  Special precautions will be in order when controlling some types of devices, and electrically noisy devices can cause unreliable operation.  Similarly, small signals loads, such as Audio or Video, can be adversely affected by the on-board relay, as not all relays can switch small signals.

There are many considerations you must address when choosing a USB relay controller, hopefully this article will give you some insight and help you address problems before they begin.  Our company introduced the world’s first RS-232 relay controller in 1995, a few years later, we introduced USB relay boards.  We have learned a thing or two about USB control, and we hope you find this article helpful in your next computer control application.

Identifying and Managing Inductive Loads

Let’s start with a inductive loads and how they interfere with USB connectivity:  Inductive loads are high voltage or high current loads that involve a magnetic field.  A motor, solenoid, valve, transformer, pump, or any other device that causes motion or generates a magnetic field is an inductive load.  Inductive loads are particularly difficult to control for ANY USB relay board, as the electromagnetic interference does not stay confined and isolated to the relay as one might assume (though solid-state relays are superior to mechanical relays in terms of isolation).

With regard to mechanical relays, USB relay boards may have to deal with induction from two sources: the coil of the relay and whatever happens to be connected to the relay.  The relay coil is well known for its inductive tendencies.  But the device connected to the relay is often ignored because there is an assumption of isolation since the coil of the relay is not electrically connected to the contacts.  In fact, nothing could be further from the truth.

When a relay is activated, current begins to flow through the contacts.  This current is flowing right next to the coil built into the relay.  The coil acts as a high-ratio transformer as current flows, so the driver circuit must be strong enough to handle the current (often in the form of electromagnetic interference) that flows back into the driver circuit.  The higher the voltage, the more noise is inducted onto the coil of the relay.  Many driver circuits are designed to handle this current flow, as flyback protection is usually built into most relay controllers.  Flyback protection alone is not enough to halt the electromagnetic interference from affecting the logic logic, power supply, and drive circuits.

When the USB port receives a command to deactivate the relay, the magnetic field inducted on the coil collapses, and a high voltage spike is sent right back into the control electronics, which can result in a malfunction or even a disconnect from the USB driver (more on this later).  This spike cannot be suppressed with a reverse polarity diode as one might expect.

Not only are the electronic relay drivers and logic affected, but most inductive loads also adversely affect the contacts of the relay.  Each time a relay is activated or deactivated with an inductive load attached, micro-pits begin to form in the relay contacts, causing excessive wear.  Mechanical relays will display micro-pits under a powerful microscope.  Some pits are so large they can be seen without any magnification.

Solid state relays are not immune to the effects of induction, in fact, they tend to be more fragile and less tolerant of highly inductive load sources.  Solid-state relays are; however, superior isolators, and will effectively block inductive loads from reaching the logic or control circuits of the relay board.  So at first glance, they appear to be more reliable since they do not reveal the symptoms of induction.

Solid state relays handle induction in a slightly different way.  Solid state relays are rated over a voltage range.  Induction introduces a spike that can frequently exceed the voltage rating of the solid state relay (even when working with small loads).  Frequent switching can cause excessive heat and over-voltage conditions for a solid-state relay, leading to failure.

Loss of Communications with the USB Relay Board

The High Voltage Spikes released by inductive loads are NOT compatible with USB communications.  Frequently, these spikes will travel through the USB port directly back to your computer, causing your motherboard to disconnect the USB device from the list of available USB devices.  The only way to recover from this condition is to remove the USB device from the computer and plug it back in.  In extreme cases, the inductive spikes can cause damage to the USB port of your computer.

It’s easy to blame a controller for malfunctioning when working with inductive loads, but in reality, the fact that a controller (regardless of manufacturer) malfunctions when working with these loads does have one benefit:

A malfunctioning USB relay controller is a sure way to indicate to the user that something is terribly wrong with the installation, and it must be properly handled to ensure a long life span.  Inductive loads MUST be managed externally, away from the relay board, regardless of how good your controller is.  We put together a tutorial on Controlling Inductive Devices which demonstrates the problem.  Inductive loads are typically managed using external components, as shown in the tutorial.  When a controller malfunctions, it’s letting you know the problem has not been properly managed.  When a controller is working properly, induction is properly managed, and the relay controller can give you years of reliable service.  Unmanaged problems can lead to early failure of the relay controller and potentially damage to a computer.  The USB port is a fragile bus, and the fact that it kicks off devices that misbehave is an ideal way to protect the computer from the serious electronic damage that can be caused by induction.

In our USB relay boards, we galvanically separate the USB circuit from the relay control PCB.  This provides greater noise immunity on the USB port, allowing the controller to tolerate a little more induction before your motherboard kicks the device off the USB bus.  Extreme induction will still cause our controllers to malfunction, but this is easily managed with an external components.  Properly suppressing induction requires external components to be installed as close to the inductive source as possible, which is why it is not possible for us to include these components on any of our relay controllers.

Symptoms of Unmanaged Inductive Loads Include:

  • USB Driver Disappears from the Device List of your Computer

  • Software will Unexpectedly Crash because the USB Port Has Been Terminated

  • The USB LED will Turn Off on the USB Relay Board

  • Activating or Deactivating a Relay Causes All Relays to Turn Off

  • User must Physically Remove the USB Plug and Re-Insert to Resume Operation

  • Controller Becomes Unreliable or Loses Communications

  • Extreme Cases may Damage the USB Port of your Computer

Back To Top

USB Software Driver Types

There are many ways to talk to USB relay controllers, some manufacturers choose HID or Custom USB communications to gain a performance advantage.  HID USB protocols do not require a driver, they use a standard HID descriptor to communicate relay control data.  Most computers support HID protocols, so HID commands are relatively easy to handle, but the software can be a little complex, so an extensive library of samples should be provided for all HID based USB relay boards.

Other relay control manufacturers support custom USB descriptors, which require a driver for each platform.  These devices are more limited by platform unless the manufacturer has provided a USB driver for each platform.  This would be my least favorite type of USB device unless it were well supported with tons of samples.  Watch for OS upgrades, as these kinds of drivers may require updates.  Newer operating systems can easily render older drivers obsolete, leaving your hardware useless.

We use VCP drivers to communicate to our relay controllers.  VCP stands for Virtual COM Port.  Essentially, we use good old fashioned serial communications to communicate data to our USB relay controllers.  The advantages of this protocol are abundant:

  1. VCP Drivers are available for EVERY Computing Platform, including Windows, Linux, MacOS, even Android and other specialty platforms.

  2. Mechanical relays are slow to respond, with a typical reaction time of 5-10ms, so there is no speed advantage to using USB at high speeds (serial data can easily outrun the recommended switching speed of a relay)

  3. VCP communications is easy to work with EVERY programming language, all you need to do is make sure your language supports serial communications.  If you can send serial data, you can talk to a VCP controller.

  4. Serial communications is by far the oldest and most widely used computer to computer hardware communication platform in the world and despite it’s age, it is still widely used in the most modern of embedded systems.  While few motherboard manufacturers include a serial port, it’s still used extensively for embedded systems to talk to other embedded systems.

  5. A COM based platform ensures an upgrade path to other communication technologies.  Our VCP relay controllers can be easily converted to industrial wireless, ethernet, WiFi, bluetooth, RS-232, and even Cloud based relay control infrastructures because all of these technologies support COM communications.

Back To Top

Power Relays vs. Signal Relays

One of the biggest tech support questions and problems we have seen with all relay controllers (not just USB) is the unusual expectation that relays make a 0 Ohm connection between the Common and Normally Open or Normally Closed contact.  This is a huge misconception, which accounts for about 10 to 15 of our returns per year.  The real measurement between Common and Normally Open connections has been measured as high as 150 Ohms on a high-quality mechanical relay!

The reason for the unusually high resistance is the simple fact that high-quality power relays, when new, include a anti-corrosive coating on their contacts.  This coating burns off after a few on/off cycles of high current flow through the contacts.  After this coating is burned off, the relay will drop to a 0 Ohm reading on your meter.

It should be stated this would never be a problem, except high-power relays are often chosen because of their low cost, and not for their specialty, which is high power switching.  Power relays will frequently corrupt low-power signals, such as audio, video, or other types of high-speed logic.  The contacts of a power relay are significantly different than the contacts of a signal relay.  Signal relays should be chosen for low-power signals.  Power relays should be chosen for power switching applications.  High-current relays should be chosen for high-power loads.  Choosing the correct relay is critical to the reliability of the controller and the integrity of the switched signal.

Back To Top

Using USB to Control Dangerous Loads

Imagine you want to use a USB relay controller to control a heater, or maybe you want to control a water pump for irrigation applications.  How about using a relay board to control a gas valve.  Don’t think of using standard on/off commands for these applications, this is how you get into some serious trouble.  Computers are not fool-proof, communications is not fool-proof, you should be able to rely on the relay board to handle dangerous applications automatically.  A quality relay controller must have a timer mechanism for controlling relays for a period of time.  This will force a relay to turn off automatically if communication is lost.  Relay commands must be powerful enough to handle dangerous loads in the event of any communication malfunction.

The proper way to control a room heater from a USB relay controller:

  1. Send a command to activate a Relay for 10 Seconds

  2. Monitor the Temperature of your Room

  3. If the Room is too Cold, Send Another Command to Restart the Timer for 10 More Seconds

  4. When the Room comes to temperature, Stop Sending Turn-On Commands

In the above application, the relay is turned on via a timer by sending a USB command to the controller.  The relay board will automatically turn the relay off if you stop sending timer commands to the controller.  The relay cannot stay energized using this strategy, keeping the heater safe from overheating.  This is often referred to as a watchdog timer, and should be considered a basic requirement for any USB relay board handling a dangerous electrical load.  NCD ProXR Enhanced and Advanced relay controllers include 16 timers that run concurrently, allowing 16 fail-safe relays to be activated for different time duration.

Standard Relay Configurations

SPST Relays: Single Pole Single Throw:

A relay SPST relay has two connection terminals, acting like a basic switch.  Inside an SPDT relay, two pieces of metal make contact when the relay is activated.  This type of relay is normally open (though some manufacturers make a normally closed version) and completes a circuit when the relay is energized.  We do not use this type of relay very often as SPDT relays do the same thing with nearly identical cost.  The only exception being 30-Amp high-current relays and solid-state relays, which we offer only in SPST configuration.

SPDT Relays: Single Pole Double Throw:

A SPDT relay has three contact points whereby two contacts (common and normally closed) are connected when the relay is off.  When the relay is energized, the common contact disconnects from normally closed and reconnects to the normally open connection.  This is the most common type of relay we offer, as this type of relay can be wired to turn a light on when the relay is on or it can be wired to turn a light off when the relay turns on.  We offer SPDT relays in 1-Amp (for low-power signals), 5-Amp, 10-Amp, and 20-Amp (for high-power signals).

DPDT Relays:

A DPDT relay is exactly like having two separate SPDT relays inside a single relay with both SPDT relays switching simultaneously.  There is no connection between each of the two internal SPDT switches.  Both SPDT switches inside a DPDT relay share a single electromagnet, forcing both switches to activate or deactivate simultaneously.  These relays are frequently used in signal switching applications, and are not ideal for high current loads above 5 Amps.

Exotic Relay Configurations:

Other more exotic (and rare) relay configurations can be simulated using our relay grouping functions.  Have you ever heard of a 8PDT relay?  A 8PDT relay contains 8 poles that switch between two positions simultaneously.  This could be used to switch 8 high-power signals simultaneously.  The only problem is, if you could buy such a relay, it would be very expensive, as it is rarely needed, and likely produced in extremely low volumes.

ProXR series relay controllers include relay grouping commands.  Use these commands to activate multiple relays simultaneously.  Relay grouping commands make the following relay configurations possible using low-cost relays:

3PDT Relays: 3 Poles that Move Simultaneously Between Normally Closed and Normally Open
4PDT Relays: 4 Poles that Move Simultaneously Between Normally Closed and Normally Open
5PDT Relays: 5 Poles that Move Simultaneously Between Normally Closed and Normally Open
6PDT Relays: 6 Poles that Move Simultaneously Between Normally Closed and Normally Open
7PDT Relays: 7 Poles that Move Simultaneously Between Normally Closed and Normally Open
8PDT Relays: 8 Poles that Move Simultaneously Between Normally Closed and Normally Open

Relay grouping commands make it easy to control relays in groups, perfect for simultaneous switching applications.

While there are many more types of switches (and terminology), this gives you a basic run-down of different types of commonly available switches.

Back To Top

Powering a USB Relay Board: Not So Simple!

Being a relay controller manufacturer means we have to answer to customers when things go wrong.  When it comes to power, there are plenty of opportunities for things to go wrong.  Powering a USB relay controller has to be met more caution than you might realize.

USB Powered Relay Boards

High-power mechanical USB powered relay boards are absolutely prohibited as per USB specification.  We lose a tremendous amount of revenue each year because we refuse to compete in the USB powered relay board segment of the market.  We are frequently contacted to be a supplier in this area.  The USB specification has clearly provided guidelines as to how power should be utilized from the USB port, and surging currents produced by high-current mechanical relays is strictly prohibited.  While a few small signal relays can be safely powered from the USB Port, the market for such relays is relatively limited.  Solid state relays may be safely powered from the USB Port, and we have considered manufacturing such devices, but in 21 years of business, not a single customer has ever asked us for a USB powered solid state relay controller.

Power Load-Sharing USB Relay Controllers

A load sharing USB relay board is a controller that has a power supply that is expected to control the relay board and the external load being switched by the relay.  This is only safe when working with resistive loads (lights, resistors, heating elements, or other non-inductive loads).  Sharing the power supply of the relay controller with a motor, solenoid, valve, pump, or other inductive loads will cause serious problems in terms of reliability, and can cause damage to the USB port of your computer.  Ideally, inductive loads and the USB relay board will each have their own power supply.  If only one power supply is possible in your installation, we do have a work-around available, so please consult with us if you MUST load-share your power supply with an inductive load.  Load-Sharing inductive loads with a USB relay controller should be avoided whenever possible.

Back To Top

Solid State vs Mechanical Relays

Mechanical relays are clearly better than solid state-relays…but not really.  The fact is, you need to consider your application and your budget carefully before you choose a solid-state or mechanical relay solution.  Each has pros and cons, so rather than pick a side, it would be better to explore common uses of each, and see where your application lands.

Mechanical relays are ideal for most applications, as cost is frequently a factor in deciding any technology solution.  Mechanical relays are capable of switching any type of load from small signals to high current, high-induction, audio, and sometimes video provided the correct relay is chosen for each computer controlled switching application.  Mechanical relays are the low-cost workhorse of the computer industry.

The lifespan of a mechanical relay can easily exceed 1,000,000 on/off cycles at the rated load.  In many cases, we have seen mechanical relays exceed 10,000,000 cycles before failure.  Lifespan is frequently a reason people choose solid-state over mechanical.  However, I would argue that solid-state relays can suffer from failure for the same reasons as mechanical relays, so lifespan is less of a factor when choosing my own applications.

Mechanical relays have one major pitfall.  Inductive switching wears down the contacts, and in the process of switching inductive loads, noise is inducted onto the driver circuit, causing potential problems with logic if not properly handled.

Mechanical relays are also available in a wide variety of low-cost configurations, including 20 Amp, 30 Amp, small signal, DPDT, and much more.

Solid-State relays are mostly available in a SPST configuration.  Rarely are they available in SPDT or DPDT configurations.  Solid-State relays are expensive, they can generate a lot of heat when switching large loads, and may even require external cooling.  Solid-State relays also require a MINIMUM load before they operate correctly.  Inductive loads can easily destroy a solid-state relay, and are more susceptible to damage caused by induction than mechanical relays.  The maximum load rating of a solid-state relay typically comes from fairyland, and in no-way resembles the actual use case of said relay.  Further, solid-state relays are typically rated for AC switching applications, though a few DC solid-state relays are available for select applications.

So why on earth would anyone want to consider using a solid-state relay given all of these limitations?  Solid-state relays employ optical isolation, keeping computers safe from the most demanding high-power loads and even lighting strikes.  Solid state relays are PERFECT for computer interface solutions because of their isolation from the logic circuits of the USB controller and other logic.  Further, if you want to switch a high-power load, say 100 Amps at 240VAC, a high-current USB mechanical relay controller is destined to be an interface disaster without a ton of support electronics.  Solid-state relays are the answer to extreme current switching applications when combined with mechanical contactors and induction suppression components.  Solid-state relays can have a much higher cycle frequency over mechanical relays, so turning a high-power device on and off frequently is best handled by a solid-state solution.  Solid-state relays seem to have an infinite lifespan when working with resistive loads provided the load is properly sized for the solid state-relay.  Like all relays, solid-state relays should be protected from inductive loads using external components.  This will reduce the damage to the silicon used in the switching process.

Back To Top

USB Controlled High-Power Switching

Controlling High-Power loads with the USB port is best accomplished with a combination of a large mechanical relay called a contactor and a solid-state relay controller.  When paired together, the computer can safely control the solid-state relay, and the solid-state relay will block the induction of the contactor from the computer.  Since a contactor contains a coil, it is an inductive load, and it must be managed accordingly with induction suppression components.  Contactors can be rated at many load and coil voltages, but keep in mind, most solid-state relays are rated for AC switching only.  A select few DC solid state relays are available, but care should be taken to choose a solid-state relay that matches the coil rating of the contactor.  We can assist you in finding the correct solid-state relay and matching contactor if you need help.

Back To Top

Reliability of Mechanical and Solid-State Relays

I could not even begin to guess how many relays we have sold over the years.  Relay failures are extremely rare for both mechanical and solid-state relays.  We always try to work with our customers to choose the correct size of relay for a given load, and to determine the cause of failure on those rare occasions.  The majority of relay failures we have seen are related to overcycling the relay (turning the relay on or off far more frequently than rated), lightning strikes, and of course your basic misuse (too much current or voltage flowing through a heavily cycled relay).  There is this misconception that mechanical relays will wear out prematurely, and that solid-state relays should be used instead.  Rarely have we seen a worn out relay.  Many mechanical relays have a cycle life in the millions, and we have seen no evidence to suggest a mechanical relay is any more or less reliable than a solid-state relay.  Long-term reliability is generally controlled by choosing the correct relay size and making sure the proper protection is used across its lifecycle.  Relay life spans exceeding 10 years are possible, one of our original customers contacted us to let us know that one of our first relay controllers (from 20 years ago) is still fully operational.

Back To Top

USB Relay Switching Speed

The speed of a relay switching operation will help define the lifespan of the relay.  Mechanical relays often have a activation time of 5-10ms, with a deactivation time of 10-20ms.  As a general rule, high-speed switching of mechanical relays will cause physical contact wear.  Solid-state relays are better suited for high-speed switching applications, but they are not immune to the effects of high speed switching.  Users of solid-state relays for high-speed switching applications should monitor the temperature of the solid-state relay.  High-speed switching can cause the temperature of the SSR to rise, particularly when switching high-speed inductive loads.  Inductive loads are particularly brutal for both mechanical and solid-state relays, and in some high-frequency switching applications, custom electronics must be used to properly handle the inductive load.

Solid-State relays are typically available with random turn-or or synchronized turn on.  I prefer to use synchronized turn on, as this type of relay will activate during the zero cross cycle of the AC waveform flowing through the relay.  Random turn-on will activate the relay at a random time, regardless of the position of the AC waveform (and is slightly faster for this reason).  Synchronized relay activation may benefit from having a slightly longer operational life at the expense of activation speed (they are typically a few milliseconds slower).

Back To Top

Manual Control of USB Relays

Manual and computer control is a basic function built into all USB relay controllers we have manufactured for many years.  Manual control allows you to control a relay from the USB port or manually through an external input.  Relays are controlled manually when a analog input is first mapped to a particular relay.  Once mapped, the analog input has control of the selected relay.  When the analog input is high, a relay can be set to activate.  When the analog input is pulled low, the relay will deactivate.  This allows sensors and limit switches as well as the USB port to share control of your relays, based on user configuration.

Back To Top

Expanding USB Relay Controllers

We do not believe in hardware that goes obsolete.  We are strong proponents of building controllers that last for many years, not disposable devices that require frequent replacement.  As technology evolves, we prefer our controllers to include an expansion strategy of some kind.  There are several areas of expansion we are always working on:

  1. Interface technologies are always being introduced, and we like to adapt different communication modules to our controllers whenever possible, allowing a communication expansion often.  To this point, we have adapted RS-232, USB, WiFi, Bluetooth, Ethernet, Web-i (web page over ethernet), DropNet, and industrial wireless relay control solutions to our product line.  We are currently developing a new WiFi module that provides cloud connectivity to our entire range of ProXR series relay boards, and we have plan to keep developing new interface modules as technology evolves, expanding into LoRa and other IoT based communication technologies.

  2. Powerful automation software in the form of N-Button (SerialPortTool.com) allows you to control our relay boards using a widget based user interface that can be configured for your PC as well as a web browser.  N-Button is constantly evolving to add new automation features.

  3. Relay expansion boards allow you to add relays to your ProXR and Fusion series relay controllers (ProXR Lite does not support relay expansion).  This provides a pathway to controlling many specialized relay types not suitable for mass production.

  4. Most recently, we have been developing I²C expansion devices to include complex sensors, making your relay controller expandable into applications far exceeding basic relay control.

Back To Top

USB Relay Firmware and Hardware Options

USB Relay control is a relatively broad term.  We have created many devices that help focus USB relay control into a more specific application.  Here is an overview of the devices we have manufactured to help guide you into the right devices for your specific USB relay switching application:

ProXR Lite is a popular choice for entry level users who need the ability to control up to 8 relays.  ProXR Lite is available with many relay control options, offering solid state, high-power switching, and low-power signal switching.  ProXR Lite controllers are available with a USB interface that may be removed and upgraded as your needs change.  ProXR Lite controllers include eight analog to digital converters, with programmable 8-bit or 10-bit resolution.  Analog to Digital converters (ADCs) are useful for monitoring many kinds of analog sensors, including temperature, light, magnetic switch sensors, and much more.  The ADCs can me mapped to directly control relays for manual relay control applications.

ProXR series are a popular choice for industrial relay control and switching applications.  ProXR series controllers are expandable, allowing many relays to chain together.  With firmware support for 512 relays, ProXR series are the choice for many industrial applications, as chips may be changed if damaged.  ProXR series controllers always include an XR expansion port, allowing easy chaining of XR series relay expansion boards.  ProXR series are available with a USB interface, or you may remove the USB interface and upgrade the controller to other communication technologies as your needs change.  ProXR series controllers are also available in two hardware/firmware varieties: AD and UXP.

The AD version of a ProXR series controllers include analog to digital inputs, just as the ProXR Lite series relays.

The UXP version of the ProXR series controllers include a UXP expansion port instead of ADCs.  The UXP expansion port can be used to interface contact closure input detectors, up to 48 12-Bit analog to digital inputs, or potentiometer output expansion boards.  The UXP series does not have the ability to map external expansions for direct relay control applications.

The Taralist series USB relay controllers are ideal for time scheduling applications.  The Taralist series include a real time clock and the ability to process up to 999 time activation events.  Taralist controllers are better suited for “set and forget” applications, but some basic relay control functions are available to override the time schedule when needed.  USB is a popular choice for our Taralist series relay controllers, but the USB interface may be removed and replaced should your application requirements change.

The Fusion series USB relay controllers are the most powerful relay control devices we manufacture.  Fusion series controllers include an extended ProXR command set, allowing more commands to control relays.  Fusion series also include our 3rd generation Taralist time schedule functions, allowing more functions for relay control using a time schedule.  Fusion series relay controllers also include extensive Reactor functions, allowing you to configure analog inputs for complex relay control functions without programming.  Use contact closure inputs to cycle through relays, activate timers and much more.  Fusion controllers are the most expandable controllers we manufacture, offering two communication module interface ports, each of which may be configured for USB, Bluetooth, RS-232, Ethernet, Web-i (Ethernet web page), WiFi, or long-range industrial wireless.  Fusion series controllers include a I²C port, allowing access to current monitoring, temperature and humidity sensors, pressure sensors, and much more.

Back To Top