Subaru Forester Owners Forum banner

Relay Tutorial

39575 Views 19 Replies 5 Participants Last post by  Tuned200
Our Foresters are loaded with relays. They show up in lots of electrical discussions here, both in terms of being the possible culprits for various problems (they usually aren’t) and as being part of the solution for interesting mods. Since we’re not all electrical engineers, I thought that it might be useful to put together a description of what they are, how they work, what you can do with them, and where you can get them—all together in one place. Please join in if you have questions, or add further insights that might help explain things even more.

I’ll start with the really basic stuff. The relay basic stuff (sorry!). If it’s too elementary, just skip through till you get to the part with the info you need.

A relay is simply a switch controlled by an electromagnet. The magnet part is called ‘the coil’ and the switch is ‘the contacts.’ Internal terminology includes ‘the arm’ AKA ‘common’ or ‘COM,’ which is the part of the switch that moves, and ‘the contact(s)', which remain stationary. Yes, ‘contacts’ is used in a couple of different senses, but the meaning is usually pretty clear.

Just as switches come in different configurations such as Single Pole (one circuit), Double Pole (two separate circuits switched simultaneously), Single Throw (on/off), Double Throw (one way or another), Normally Open, Normally Closed, etc., so too do relays. Here’s a picture that illustrates the components and construction of a typical relay. This is a rather large Double Pole Double Throw (DPDT) one intended for AC operation, switching high currents, but it works the same way as the smaller, enclosed DC ones that you would find in an automotive application. I chose it for clarity of illustration. When the coil is unenergized, a spring holds the arms up against the Normally Closed (NC) contacts. Energize the coil and it pulls the arms down to the Normally Open (NO) contacts. Turn off the power and the arms snap back to the NC position. Since this is a Double Pole relay, it has two completely separate sets of arms and contacts that operate simultaneously.
533548
For this discussion we’ll start by confining ourselves pretty much to the common Single Pole, Single Throw, Normally Open relay (SPST NO), and then moving out into other things. SPST NO means that the relay is essentially an on/off switch that’s off when there’s no power to the coil. Put power to the coil, and it pulls the arm onto the contact. This closes the switch, which stays closed till power is removed from the coil and a spring pulls the arm back away from the contact. Powering the coil is sometimes called ‘picking’ the relay. The origin of this term is lost to time.

Why bother with all of this? Why not eliminate the middleman and just turn on the ultimate thing with the same electricity that would have powered the relay? There are lots of reasons why. The coil doesn’t take much electricity at all. It can be a long way away from the place that’s powering it and be controlled by very light duty switches and wiring, allowing the heavy duty wiring to be right up close to the load and the source of power. It can attach to an existing circuit and not place any appreciable additional load on it. (But see the caution below regarding the weasel word ‘appreciable.’) The contacts, however, can be very sturdy and capable of switching much heavier amounts of power. And the switched power can come from different sources than the power that goes to the coil. The contacts could easily be used for switching voltages much different from the voltage that is driving the coil. One could be high voltage and one low, or one AC and the other DC! Total isolation.

Don’t underestimate the importance of keeping the high-current wiring short—close to the battery and close to the load. While it’s easy to think of the lines in a schematic drawing as being perfect conductors, all wire has resistance and resistance eats up energy (in proportion to the square of the current!). Flimsy wires have more resistance than thick ones, and some of the wiring in our Foresters is a bit on the flimsy side. As short as the distances might be, over two volts goes missing in the stock high beam circuit due to losses in the wiring and the switching circuitry, which is especially sad considering how close the battery and the headlights actually are to each other. This is a job for relays—relays in the right place with the right kind of wiring.

Relays are a very common thing on Subarus. Think about all the key-on things we have in our Foresters—engine, lights, radio, blower, wipers, to name just a few. No way would you want all that electricity to actually come up inside the steering column and go through the ignition switch. Too expensive, and too clumsy. Big fat wires and a really heavy duty switch. So there are relays in different places whose only job in life is to get turned on when the key is on, and to stay on till the key goes off. They in turn deliver the higher current to the other parts of the Forester through their contacts. Other relays serve to control various on/off situations involving circuits with heavy current demand. The starter is certainly the prime example. It’s actually powered by two relays. The first is a regular one, and it provides power to the solenoid. The solenoid is just a special purpose relay. Like a relay it closes a set of very heavy duty contacts to power the starter motor, and it also engages the starter into the flywheel to crank the engine.

So, in its simplest application, a relay is a way of using a small amount of electricity, flowing through light-duty wiring and switches, to turn on something of much hungrier power consumption that is perhaps located some distance away. Already that’s a capability that would be useful in a mod such as driving lights, supplemental horns, and the like. But now, let’s go beyond the basic SPST NO relay and see what else they can do for us.

The concept of Double Pole (or even multiple pole) relays is pretty easy to grasp. You can control totally separate circuits, each perhaps operating at a different voltage or coming from a different place, all together at the same time. Useful, yes, but you can do essentially the same thing with two Single Pole relays, and anyway Double Pole relays intended for use in automobiles just aren’t as common or easy to find. About the only time it would make a difference would be if space were extremely tight or if there were something about the circuit that absolutely demanded that they both switch at the same time or not at all—perhaps a safety situation that could not accommodate failure of just one.

So now let’s look at Double Throw relays, and while we’re at it at Normally Closed ones. What’s the big deal here? Double Throw lets you switch two things back and forth. And both kinds can turn something off when something else is on, like a NOT in a piece of digital circuitry. Having a hard time finding a place that says low beams are on? Maybe it might be easier to find a place that says high beams are off, and then flip that around with a NC relay or the NC contact of an SPDT one.

Time to think out of the box. It’s easy to visualize an SPDT relay as a way of switching power between two places. It comes in on the arm and goes out on one or the other of the contacts to one place or another place. The eye is drawn to this viewpoint by the typical left-to-right flow in circuit diagrams (as illustrated below). But it can work the other way too, bringing power in from two different sources to the contacts, and sending the selected variety out via the arm. I’m presently working with another member on an application where a relay’s arm will power a LED strip with steady electricity from one contact or flashing on/off electricity from the other one, depending on which way it’s positioned.

Here’s the symbol that’s typically used for relays in schematic diagrams. This one is an SPDT model, but you can substitute different switch configurations as appropriate. It’s a good illustration of what actually happens. With no current to the coil the arm is up against the NC contact, held there by a spring. Current can flow between the arm and the NC contact. When the coil is magnetized it pulls down the arm, the NC contact opens, and the NO contact closes. Sometimes you’ll see a drawing of an actual coil rather than the simple rectangle used here. It’s just easier to draw a rectangle than a coil!

533549

Relays were an important part of creating logic (controlling things based on complex situations and relationships) before the days of integrated circuitry and sealed modules. Heck, you could even build a computer out of relays. They can provide the essential NAND function out of which one can construct any sort of logic. The relay-based computer would be slow, but it sure would be noisy and fun to watch! Some people are actually doing this for fun! Now, in automotive applications, you see logic being implemented in sealed modules. They’re cheap to build (but expensive to buy), and they can provide a very sophisticated capability. But they aren’t very amenable to mods because we don’t know how much power they can really handle, nor can we get inside of them to alter their operation. As a rather conservative engineer, I’d be uncomfortable adding anything to one of these that significantly increased its load.

So, it’s time for the cautions. I’d have no problem using relays to add a capability to a circuit that is already driven by relays, by switches, or by fuses that go straight to the battery. Sturdy stuff. But I would stop short of wiring a relay directly into a circuit that emanates from a sealed module, and for a couple of reasons. The first is that the relay is going to be adding load to the circuit, possibly exceeding the module’s (unknown) design specifications. While I have characterized relays as a low power way to control a high power circuit, they do indeed consume a modest amount of power which could be enough to overload a rather minimal source. I’ve measured some of the automotive relays in my collection in the range of 130-175 milliamps, which is about a quarter of the rating of the dome light bulb for example. Low, but still real. I might be able to avoid that problem by rearranging the other loads (replacing incandescents with LEDs, for example—but always measure actual currents to be sure), or I could put a transistor in between so that it controls the actual current used to pick the relay while presenting acceptably minimal load to the module. More on this later.

But then there’s this second caution: It’s a fact of electronics that when power is removed from a coil of some sort (such as in a relay), the collapsing magnetic field induces a current spike in the opposite direction of the original flow of electricity. It’s called inductive kick. Though brief, this spike can be of significantly higher voltage than the amount that was originally there, and it can puncture sensitive electronics that might have been a part of the coil’s drive circuitry. Things like those expensive sealed modules.

Try this in your garage some night: Hook up a relay to a source of power, shut the lights off, and then remove one of the wires. Big spark!

There are solutions to all of these problems, but I’ll save them for Part Two of this tutorial, where we can talk a bit more about electronics than just about the simple fundamentals of relays. Transistors, diodes, and that sort of stuff. First I want to do a bit of breadboarding, develop some rules of thumb, and search out a few sources.

But we’re not done with Part One. There is one more caution, and this one is kind of tricky. One thing that can happen with relays is to accidentally create a situation where the relay keeps itself closed. This is called ‘latching.’ It’s fine if it’s what you had intended to do, but if not then it can be embarrassing. It’s even more of a risk in a mod than in an original circuit, because sometimes there will be seemingly unrelated circuitry elsewhere in the vehicle and on another page of the wiring diagram which creates a sneak path that ultimately comes back and results in a latching situation.

Here’s a diagram of how this can happen—in a good way. It uses a DPST NO relay, with one set of contacts switching the current to the controlled circuit (AKA ‘the load’) and the other set used for latching the relay. Initially the relay is just sitting there. There’s no power to its coil, so its contacts are open. Then the push button switch S1 is closed for a moment. Current flows through the switch, through the Normally Closed push button switch S2, and through the coil, picking the relay. Power goes to the load through the upper set of relay contacts. But when S1 is then opened the relay stays closed, because now there’s current flowing through its lower contacts into its coil, bypassing the now-open S1. Only when S2 is actuated does the relay open. Yes, this is a useful capability if it’s what you had in mind. On/off push buttons are cool in some applications. But otherwise, it’s a surprise.

533550

Note that you could implement this circuit with only an SPST NO relay that controls both the load and the latching, but this would mean that S1 takes the full current of the load until the relay latches and its contacts take over the job. This might be acceptable if the current is within the switch’s and the wiring’s rated capacity.

Let’s look at how to actually do this stuff with real components. The most common relays in automotive use are called Bosch relays, as they were originally developed by the German company of that name. They are cubical in shape, about an inch in each dimension, and they’re capable of switching enormous amounts of current—up to 40 Amps or more in some cases. And they’re cheap—you can get them for a dollar or so at one of the sources described below. They come in SPST NO and SPDT. If you have a Double Pole application, just use two relays.

As you look at the SPST relay from the bottom there are four terminals, one along each edge. The two that are parallel to each other are the coil, and the two that are perpendicular are the contacts. There might be numbers indicated there as well. If so, 85 and 86 are coil and 30 and 87 are contacts. I guess these numbers mean something in German. Not that it matters much, but 87 (the one that’s perpendicular to the three others and parallel to its side) is the fixed NO contact, and 30 is the arm.

There is also an SPDT Bosch relay, similar in size. The ones that I have can switch only 30 Amps (still a lot), probably because they had to cut down a bit on the size of the contacts in order to fit all of them into the same size container. The terminals for the coil, the NO contact, and the arm are in the same location as in the SPST version, and the NC contact 87a is located in the center.

You can connect to the terminals of these relays with 1/4” crimp connectors, or you can use a socket that’s made for this purpose. I recommend the latter. It’s cleaner, better insulated, and less likely to have problems in the future.

You can buy Bosch relays from MCM Electronics at a mere $1.09 apiece, both SPST NO 40 Amp and SPDT 30 Amp. Read more about MCM at my Sources Thread. They also carry a socket that works with either. A quick look on eBay also shows some good prices, especially in lots of five or ten with sockets included.


533551
Bosch Relays from MCM Electronics
SPST NO 40A · SPDT 30A · SPST NO 40A

533552

Bosch Relay Socket from MCM Electronics
Note lighter duty wire to coil (black & white) than to contacts.​

There is one caution regarding Bosch relays. One of our members recently came up against what looked for all the world like an SPDT relay. It had 5 terminals, and they were numbered just as expected. Fortunately there was a diagram on the relay which showed that something was amiss. Instead of being the NC terminal, 87a (the one in the center) was simply a second terminal connected internally to the NO contact (87). I guess they did this to make it convenient to power two lights from the same source without having to make a splice. A second hint of trouble was that the relay was marked as able to handle only 15 amps, which probably means that it had the usual 30 amp contacts inside, but they expected that the current would split equally between those two terminals on the way out. The manufacturer’s catalog used the 87 number to designate both of these contacts, which should make things a little bit more clear, but either way this setup could be a disaster waiting to happen if you weren’t aware of how the relay was actually constructed.

So, if you do come across a 5-terminal Bosch relay, it would be wise to inspect and test it carefully to be certain which variety you actually have in your hands—the common SPDT version, or the much rarer 5-legged SPST NO with two outputs.

One useful and related item that you would probably want to include in any mod that involves relays is a fuse. Adding circuits to a vehicle isn’t quite as simple as it might be with the electricity in your house. The load center (formerly known as ‘fuse box’) in your house is nicely equipped with knockouts and spare slots, ready to accept new breakers and new circuits. Not so in a Subaru. The two fuse panels there are pretty much impenetrable, laid out to provide just what the factory thinks your vehicle would need if fully equipped, and nothing more.

You have a few choices here, all available at MCM, MPJA (also described at my Sources Thread), and elsewhere. You can get an in-line fuse holder, which is simply a fuse socket with a length of wire coming out each end that can be spliced into the circuit. Or for an even neater appearance, you can get single- or multi-fuse blocks and multi-circuit battery connectors and distribution blocks. Car audio places and eBay sellers offer a lot of this sort of stuff too, gold plated even!

Our friend Peaty recently posted a link to Amazon sellers who offer the relay, socket, and fuse holder as a package at an extremely attractive price, with free shipping. You can get the entire package there with free shipping for less than the minimum price of MCM's shipping. Sadly the link no longer works, but search around there and something might pop us. Be sure to look over to the right of the Amazon page for sellers offering an even better bargain than the officially sanctioned one.

The VW section of a junkyard is also a good source for Bosch relays. Pull a bunch of them out of the cars, stuff them in a small, mud-spattered plastic bag, and you can probably get the whole lot for five bucks, with no Shipping & Handling charge! Here’s some of my junkyard collection.

533554

Bosch relays harvested from VWs at junkyard​

That’s it for Part One of this tutorial. Feel free to add to it, or to ask for clarification or further info. I’ll be back in a while with Part Two, where we’ll discuss safe, conservative ways of driving relays and other loads from today’s ubiquitous sealed modules. I’ve also posted a tutorial about multimeters, and one about different applications of diodes. Additional suggestions?
©
See less See more
6
  • Like
Reactions: 3
1 - 20 of 20 Posts
nice informative post. relays are really fun to toy around with.

i just, recently, replaced my Bosch relay (SPDT) for a DEI. my foglamps were stuck on and drained my battery.

this reminds me of a time, right out of high school, when i had a handful of SPDT relays from a buddy who did alarm/installations. i was sitting at a mcdonalds and wanted to make my reverse lights alternate (left & right) while still being able to use reverse. it took 4 SPDT relays, a diode and 1 thermal relay.
relays are really fun to toy around with.
Exactly! That's just how I felt when I first got into this. IC logic is fun too, but they just sit there. They don't even hum. Just sit there. Don't move. They all look the same—you can't even tell the players without a scorecard. Relays however go click, and if they're not enclosed you can actually see them move and visualize the electrons moving along their new pathway.

Engineer's orgasm!

this reminds me of a time, right out of high school, when i had a handful of SPDT relays from a buddy who did alarm/installations. i was sitting at a mcdonalds and wanted to make my reverse lights alternate (left & right) while still being able to use reverse. it took 4 SPDT relays, a diode and 1 thermal relay.
Fun!
The only thing I can add is a little bit about the coil of the relay. The coil is simply an electromagnet similar to what you may have played with in elementary school science classes. You remember those - apply power to the coil and it becomes a magnet. I think the simplest version I've seen was a wire wrapped tightly around a nail. Connect the two ends of the wire to opposing ends of a battery and you have yourself a simple electromagnet. Easy enough. I bring this up because it leads to the next part.

A DC coil (what we have in the car) needs both an electrical 'high' and a 'low' to operate. The low comes from the car's ground path and the high comes from the 12V DC circuitry of the car (the battery and alternator). Apply both of those to opposite electrical ends of the coil and you activate (turn "on") the magnet/coil.

If you switch off or, inadvertently lose, either the high or the low, the coil de-energizes and the relay turns "off" so if your relay won't turn on, you could be missing either the high OR the low. I have an example of a poor high in my car: the passenger seat heater switch has a dirty or loose contact on the high-temp setting so it doesn't always turn on right away; I fiddle with the toggle switch a little bit and it'll come on.

General list of things that can cause a relay to fail to activate (only on the coil side, not the contact side):
- relay works its way loose from the plug
- relay coil gets old and just plain dies (the coil wire inside the relay is broken or comes loose internally)
- broken/loose wire on the high side, either before or after the switch
- broken/loose wire on the low side
- dirty or bad switch contacts
- dirty relay plug contacts on the low/ground side




Are you planning on a later discussion of troubleshooting this stuff?
See less See more
Are you planning on a later discussion of troubleshooting this stuff?
I think you just did. Do you have any more?
Yeah, but I think it makes more sense with/after your multimeter tutorial. It's mostly academic if a person isn't able to properly understand/use a meter.

I have an industrial DC power supply and a bunch of industrial relays and switches at the house so if you need any photo examples I can probably provide some for your tutorials.

It sounds like you have more of an engineering understanding of this stuff than I do, while my knowledge is limited mostly to the application side. So I have a question for you: since a relay can be switched on and off from either the high or low side, is there a particular reason why we mostly switch the high side? I've seen only a couple relay circuits with low-logic (negative logic?). Is it just that troubleshooting a low-side fault is usually harder than finding a high-side fault? Is it because many components need a constant ground (often for safety reasons) anyway so why duplicate efforts? Or some third reason that escapes me?
See less See more
care to talk about this in another thread im interested in using IC chips and relays to do switch for flashing like the wig wags for off road use

Exactly! That's just how I felt when I first got into this. IC logic is fun too, but they just sit there. They don't even hum. Just sit there.
Yeah, but I think it makes more sense with/after your multimeter tutorial. It's mostly academic if a person isn't able to properly understand/use a meter.
I'll get to work on that one.

I have an industrial DC power supply and a bunch of industrial relays and switches at the house so if you need any photo examples I can probably provide some for your tutorials.
A big mother, multipole contactor would make for a nice picture. It's a lot easier to visualize what's happening there than staring at a one-inch black cube!

It sounds like you have more of an engineering understanding of this stuff than I do, while my knowledge is limited mostly to the application side. So I have a question for you: since a relay can be switched on and off from either the high or low side, is there a particular reason why we mostly switch the high side? I've seen only a couple relay circuits with low-logic (negative logic?). Is it just that troubleshooting a low-side fault is usually harder than finding a high-side fault? Is it because many components need a constant ground (often for safety reasons) anyway so why duplicate efforts? Or some third reason that escapes me?
It's partly tradition, partly safety, partly simplicity, partly economics—pretty much all you said and more.

Some things are naturally attached to ground already, so switching on the high side makes more sense. Like the starter. But that can go in the other direction as well. One example is the typical dome light circuitry, switched on the low side because they have to run a wire out to each of the door switches so it's easiest to then use their mounting to the body to complete the circuit. But tail lights usually get switched on the high side and grounded in place so that there's no need to run a second wire back up to the front. It saves both pennies and voltage drops. Whatever works and uses a bit less wire is usually the favored solution in a vehicle.

In AC wiring it's not just tradition that favors high side switching; it's the law! Low side can put electricity where it just isn't expected, and in multicircuit situations it can lead to sneak paths that spread it out even farther. Consider what happens in the low-side-switched, multi-circuit headlights in our Foresters. (link here)There are a couple of examples of it in my 100 year old rental property in Baltimore, one in a bathroom which results in there always being electricity going to the light over the sink, switch on or switch off. Worst case scenario is that the bulb breaks and somebody has to use pliers to unscrew its remains. I can't get to the boxes where the wires could be rearranged to cure this (another Code violation). Right now I'm relying on signs, but I recently did have an inspiration flash of how I can fix the problem and it's on the agenda when we're back there later in the month.

There is one factor in the digital world that encourages designers to use low side switching, and that's the NPN transistor. It just naturally favors being underneath the load, and the circuit is a bit easier to design and a bit cheaper to build than a high side one using PNP.
See less See more
care to talk about this in another thread im interested in using IC chips and relays to do switch for flashing like the wig wags for off road use

Tell us more about what you have in mind.
like a Whelen CSP 690 Strobe light kit vid here
or
firing mechanism to switch between semi auto, auto and 3 round burst (im thinking about airsoft),if it doesnt need negative voltage
ive already switched to mosfet for switching
Alternating blinking lights is a classic application for the 555 IC. Here are a couple of examples, and you can find lots more out there.

Substitute opto-isolators for the LEDs and you're almost there. The isolators could drive most anything.

Anything more sophisticated and I'd use a PIC or similar microprocessor.
oh man ur gona make bust out my bread board and look for all those IC chips and electronics kits
Hey, I just moved and I don't know where half my stuff is, let alone have an empty flat space large enough to put the breadboard on.

Nonetheless, this hasn't stopped me from haunting eBay and stocking up on just a few things I always needed, or just realized that I always needed!
good tho all i need is a variable power supple wit pos and neg voltage to power up those OP amps
Dual gets kind of expensive, but you could go with two of these at $20 each (as long as negative isn't grounded).

3-12V @ 2A BENCHTOP POWER SUPPLY-MPJA, Inc.

Edit: It might even work if negative is grounded. Since they use two-prong plugs, the chassis are probably floating with respect to the AC supply and its ground.
I sent you a PM BBottomly, but I will ask here as well since others might encounter my question.

I read the posts here and I am somewhat confused. SPST and SPDT are hanging me up.

Are they as they sound? Can a SPDT do 2x the functions of a SPST? Is this why they are rated at a lesser amperage?
SPST (Single Pole, Single Throw) is a simple on/off function. Put power to the coil (terminals 85 and 86), and the arm (30) connects to the Normally Open contact (87). SPDT (Single Pole, Double Throw) is a one way or another function. When there's no power to the coil the arm connects to the Normally Closed contact (87a) in the center. Apply power and 30 connects to 87 instead. You use SPDT to send electricity in one direction or another, or to get electricity from one place or another.

You could certainly use SPDT in an on/off application by simply ignoring that Normally Closed 5th terminal (87a). But it would be wise to bring power in via the Normally Open contact (87) rather than the arm (30). Do it the other way and the Normally Closed center terminal (87a) will always have voltage on it except when the relay is energized, and this might expose it to an accidental short circuit depending on how you've configured things.

Due to physical constraints on what can fit inside a 1 inch cube, SPDT tends to have a somewhat lower (but still quite significant) current rating. I guess they have to make the contacts a bit smaller so they'll fit.
See less See more
Thank you for the reply and pm. I need to think about what you are saying. I could simply wire up the horns but I would rather understand how the circuit works.

Sent from my DROID BIONIC using Tapatalk
Go back to the first page of the thread, look at the picture of the big, open relay, and visualize how the electricity would flow. That's a Double Pole (2 separate circuits), Double Throw relay, so disregard the rear half of it.
Go back to the first page of the thread, look at the picture of the big, open relay, and visualize how the electricity would flow. That's a Double Pole (2 separate circuits), Double Throw relay, so disregard the rear half of it.
I think I can see how this works. I had 2 years of electronice back in 1997-1998 and have not looked at this stuff until 2008 when I attended a trouble shooting class. Granted it was more geared towards VAC but the terms are coming back to me now. NO / NC.. Now it makes sense.

Thank you for taking the time to help me with this.
1 - 20 of 20 Posts
Top