Channels ▼

Al Williams

Dr. Dobb's Bloggers

Relay Race

March 15, 2013

Computers were going to render the office paperless. Maybe it's just me, but I don't think that worked out. New technologies may make older things less common, but sometimes the old things fill a niche that the new technologies can't replace. Sure, photographic film, vinyl records, and horse-drawn carriages aren't everywhere anymore, but they still serve their purpose.

There was a time when electronic switching meant relays. Today we are fortunate to have a variety of methods to switch electrical circuits without using mechanical components. There are bipolar transistors, very good power FETs, and more exotic switching elements like SCRs (Silicon Controlled Rectifiers).

You'd think a relay would be as hard to find as a slide rule (have I ever mentioned that I collect slide rules?). They aren't, though. Every situation is different, and there are still a few cases where relays fit the bill.

Consider a typical bipolar transistor circuit:

Relay Race

This is fine for small loads like the LED shown. A small transistor like this can easily handle 100mA and there are bigger transistors available as well. Conceptually, when you bring the input high, the transistor will "turn on" and essentially ground the connected LED lead. That's fine in theory, but the reality is a little different. The collector of the transistor can't quite get to ground. There is some minimum voltage between the collector and the emitter, and the transistor just can't get lower than that.

I put this circuit together in the excellent CircuitLab simulator so you can experiment with it yourself. With these component values, the voltage at the collector reaches almost to 120mV. That's pretty close to zero, but it isn't zero. For the case of the LED, it isn't a big deal. The LED will be just a little less bright than it would be with a solid ground connection.

However, there are cases where that 120mV drop might make a big difference. For example, long wires also drop some voltage (wires aren't perfect in the real world). That 120mV might be the difference between delivering an acceptable voltage and having the circuit not work properly. Even more important is when you want to minimize power dissipation. Consider that even for this simple circuit, Q1 dissipates about 8mW. If this were a bigger transistor switching, say, a motor or a bright incandescent lamp, the current could be very high and the power consumed would be much greater. Another application that can be sensitive to voltage drops is switching low-level signals (switching a receiver between antennas, for example).

Have a look at the figure below, which is basically the same circuit but using a (greatly oversized) FET. Even with the relatively anemic gate drive, the voltage at the bottom of the LED is now only about 17mV and the power dropped by the FET is a hair over a milliwatt. If you pushed the gate voltage to something more reasonable (say, 12V), the numbers get even better.

Relay Race

For most things an FET switch is almost perfect. The gate draws virtually no current (although I usually put a very large resistor from the gate to ground to protect the gate from electrostatic overvoltage, so that draws a very small amount of current also). You can get FETs that are better optimized for low-voltage inputs, or you can use a bipolar to switch a higher voltage since the currents involved are tiny (see the bottom part of the previous schematic online).

As low as 17mV is, it isn't perfect. Of course, a real piece of wire has some resistance too, but unless you have a very long length of wire, it wouldn't drop 17mV in this circuit.

A relay isn't much more than a piece of wire. Granted, a relay isn't quite as efficient as a piece of wire since it has switch contacts in the circuit. However, a relay contact still offers a very low resistance.

So why would you select a relay over a semiconductor switching device? In addition to very low on resistance, relays have extremely high off resistance (as in, practically infinite). Because the relay's coil only interacts with the contacts magnetically, the control circuit and the switched circuit are highly isolated from one another. Relays can easily be sized as large as needed to handle very high voltages and currents. Although the fact that relays are mechanical is most often a disadvantage, in some cases it is an advantage. For example, it is very difficult for a double throw relay to fail so that both sides of the switch connection are made at the same time.

But there are some downsides to using a relay, which is why they've mostly given way to solid state switches. They are often large, make noise when they operate, and the relay coils generate potentially high voltage spikes. Since they are mechanical, relays fail more often than solid state devices.

I would never suggest using relays without a good reason. But not using relays would be like refusing to use a motor. Both are electromechanical devices and both have certain applications where they are very difficult to replace.

Unfortunately, the mechanical nature of relays means a lot of people dismiss them as "simple" things that you can just throw into a circuit. In fact, there are a lot of considerations to selecting the right relay to maximize the reliability and lifetime of a circuit. I'll talk about some of those next time.

Meanwhile, have you ever used a relay in a design? Leave a comment and share your story.

Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 

Comments:



Video