Relay Wiring Diagram: How Relays Work
A relay is an electrically operated switch that uses a small control signal to switch a much larger load. Relays are found everywhere -- car accessories, industrial control panels, home automation, HVAC systems, and Arduino projects. Understanding how to wire a relay correctly is a fundamental skill for anyone working with electrical systems.
This guide covers the different types of relays, how they work internally, wiring diagrams for common configurations, and practical applications.
What Is a Relay?
A relay is an electromagnetic switch. It contains a coil of wire wrapped around an iron core. When you pass current through the coil, it creates a magnetic field that pulls a metal armature, which moves a set of contacts. When the coil is de-energized, a spring returns the armature to its resting position.
The key advantage of a relay is isolation: the control circuit (coil side) is electrically separate from the switched circuit (contact side). This means you can use a 5V signal from a microcontroller to switch a 120V appliance, or a dashboard switch to control a 30A circuit.
Relay Terminology
- Coil: The electromagnet that operates the relay. Has a rated voltage (5V, 12V, 24V, etc.).
- NO (Normally Open): Contact that is open when the coil is de-energized and closes when energized.
- NC (Normally Closed): Contact that is closed when the coil is de-energized and opens when energized.
- COM (Common): The shared terminal that connects to either NO or NC.
- SPDT (Single Pole, Double Throw): One set of contacts with a common terminal that switches between NO and NC.
- DPDT (Double Pole, Double Throw): Two independent sets of SPDT contacts operated by one coil.
- Energized: The state when current flows through the coil.
- De-energized: The resting state with no current through the coil.
Types of Relays
Electromechanical Relay (EMR)
The most common type. Uses a physical coil and mechanical contacts. Available in many form factors: PCB mount, plug-in (with socket), DIN rail, and automotive (ISO mini relay).
Pros: High current capacity, works with AC and DC, clear mechanical operation. Cons: Limited switching speed, contact wear over time, audible click.
Solid State Relay (SSR)
Uses semiconductor devices (transistors, triacs, or SCRs) instead of mechanical contacts. No moving parts.
Pros: Silent operation, no contact bounce, very fast switching, long life. Cons: Small voltage drop across the output, can overheat at high currents, may need a heatsink.
Automotive Relay (ISO Mini)
A standardized 5-pin relay used in vehicles. Pins are numbered 85, 86, 30, 87, and 87a following the ISO standard.
- Pin 85: Coil negative
- Pin 86: Coil positive
- Pin 30: Common (input power)
- Pin 87: Normally open
- Pin 87a: Normally closed
Time Delay Relay
Includes a timing circuit that delays the switching action by a configurable duration. Used in industrial motor control, HVAC sequencing, and lighting controls.
Latching Relay
Maintains its switched state even after the coil is de-energized. Requires a reverse pulse to reset. Used in lighting control panels and energy-saving applications.
How to Read Relay Pin Diagrams
Every relay has its pin configuration printed on the housing or datasheet. The most common configuration for a general-purpose relay is SPDT (Single Pole, Double Throw) with five pins:
Pin layout (bottom view of a 5-pin relay):
[85] [86]
[30]
[87a] [87]
- Pins 85 and 86 are the coil.
- Pin 30 is the common.
- Pin 87 is normally open (NO).
- Pin 87a is normally closed (NC).
For a PCB relay with standard markings:
- Coil pins are usually on one side.
- NO, NC, and COM are on the other side.
Basic Relay Wiring Diagram: Switching a Load
Example: Using a 12V Relay to Control a High-Power Light
In this example, a dashboard switch controls a 12V relay, which in turn switches a 30A light bar.
Control circuit (coil side):
- Connect the positive terminal of the switch to 12V ignition power (fused at 5A).
- Connect the other terminal of the switch to pin 86 (coil positive).
- Connect pin 85 (coil negative) to ground.
Load circuit (contact side):
- Connect pin 30 (common) to the positive battery terminal through a 40A fuse.
- Connect pin 87 (normally open) to the positive wire of the light bar.
- Connect the negative wire of the light bar to ground.
When you flip the dashboard switch, 12V flows through the coil (pins 86 to 85), energizing the relay. This closes the connection between pin 30 and pin 87, sending battery power to the light bar.
Adding a Flyback Diode
When the relay coil is de-energized, the collapsing magnetic field generates a voltage spike that can damage sensitive electronics. A flyback diode (also called a snubber or freewheeling diode) absorbs this spike.
Connect a 1N4001 diode across the coil terminals:
- Cathode (band side) to pin 86 (coil positive).
- Anode to pin 85 (coil negative).
This is especially important when driving a relay from a microcontroller, transistor, or MOSFET.
Relay Wiring with Arduino or Microcontroller
Microcontrollers output low-current signals (typically 20mA at 3.3V or 5V) that cannot drive a relay coil directly. You need a transistor driver circuit.
Circuit:
- Connect a digital output pin from the Arduino to the base of an NPN transistor (e.g., 2N2222) through a 1K resistor.
- Connect the transistor collector to one coil terminal.
- Connect the transistor emitter to ground.
- Connect the other coil terminal to 5V (or the relay's rated coil voltage).
- Place a flyback diode across the coil.
When the Arduino sets the pin HIGH, the transistor conducts, energizing the relay coil. Most "relay modules" sold for Arduino already include the transistor, flyback diode, and an LED indicator -- you just connect the signal pin, VCC, and GND.
Relay Wiring for Motor Control
Relays are commonly used to control motors, especially for reversing direction. A DPDT relay (or two SPDT relays) can reverse the polarity applied to a DC motor.
Motor Reversing with a DPDT Relay
A DPDT relay has two sets of contacts, each with COM, NO, and NC:
De-energized (motor runs forward):
- COM1 connects to NC1: Motor terminal A gets positive.
- COM2 connects to NC2: Motor terminal B gets negative.
Energized (motor runs reverse):
- COM1 connects to NO1: Motor terminal A gets negative.
- COM2 connects to NO2: Motor terminal B gets positive.
Wiring:
- Connect the positive supply to NC1 and NO2.
- Connect the negative supply (ground) to NC2 and NO1.
- Connect COM1 to motor terminal A.
- Connect COM2 to motor terminal B.
- Wire the coil to your control switch.
Using Multiple Relays
Relay Cascade (One Relay Controlling Another)
When you need a low-voltage signal to control a very high-voltage or high-current load, you can cascade relays. A small relay driven by a microcontroller switches a larger relay that handles the heavy load.
Interlocking Relays
In motor control, two relays are often interlocked to prevent simultaneous energization (which would cause a short circuit in a motor reversing circuit). Electrical interlocking is done by wiring the NC contact of each relay in series with the coil of the other relay.
Relay Specifications You Must Check
Before wiring a relay, verify these specifications:
- Coil voltage: Must match your control voltage (5V, 12V, 24V, etc.).
- Coil current: Determines how much current the coil draws. Needed to size your switching transistor or control circuit.
- Contact rating: The maximum current and voltage the contacts can switch. Always derate by 20% for reliability.
- Contact configuration: SPST, SPDT, DPDT, etc.
- Coil resistance: Lets you calculate coil current (I = V/R).
- Operating temperature: Matters for automotive and industrial applications.
Common Relay Wiring Mistakes
Mistake 1: No Fuse on the Load Circuit
Always fuse the load circuit at pin 30 (common). If the load shorts out, the fuse protects the wiring from melting.
Mistake 2: Undersized Wire
The wire from the battery to pin 30 and from pin 87 to the load must be sized for the full load current. A 30A light bar needs 10 AWG wire minimum.
Mistake 3: No Flyback Diode
Omitting the flyback diode can destroy transistors, microcontrollers, and other sensitive components in the control circuit.
Mistake 4: Using the Wrong Contact
Connecting the load to the NC (normally closed) contact instead of NO (normally open) means the load is on by default and turns off when you activate the switch -- the opposite of what most people want.
Mistake 5: Bad Ground
Both the coil ground and the load ground must have clean, solid connections. A bad ground causes intermittent operation or complete failure.
Relay Applications
- Automotive: Headlight upgrades, horn wiring, fuel pump, cooling fan, light bars, winch control.
- Home automation: Controlling appliances, garage door openers, irrigation valves, pool pumps.
- Industrial: Motor starters (contactors are essentially large relays), PLC output modules, safety interlocks.
- Arduino/Raspberry Pi: Switching mains-powered devices, motor control, solenoid control.
- HVAC: Compressor relays, fan relays, thermostat control circuits.
Create Your Own Relay Wiring Diagram
Mapping out your relay circuit before you build saves time and prevents costly mistakes. With CircuitDiagramMaker, you can:
- Drag and drop relay symbols (SPDT, DPDT, solid state) from the component library
- Draw the coil circuit and contact circuit separately with clear labels
- Add fuses, diodes, switches, and loads to complete the circuit
- Run a DC simulation to verify the circuit operates correctly
- Export your diagram as a PNG or PDF
Create your relay wiring diagram -- free
How to Bench-Test a Relay with a Multimeter
Before you wire a relay into a circuit, it's worth confirming it's actually good. Set your multimeter to resistance (ohms) and work through the coil first, then the contacts.
Measure across pins 85 and 86 (the coil). You should read a finite resistance -- not zero (a shorted coil) and not open/infinite (a broken winding). The actual number varies a lot by relay part number and coil voltage; a small automotive or PCB relay might read anywhere from tens to a few hundred ohms, so check the datasheet if you need an exact figure rather than assuming a fixed value.
Next, with the coil de-energized, check continuity between pin 30 (common) and pin 87 (NO), and separately between pin 30 and pin 87a (NC) if your relay has that pin. Then apply 12V (or whatever the relay's rated coil voltage is) across 85/86 and repeat the continuity checks. Disconnect the load circuit while you do this so you're not feeding stray voltage back through the meter.
| Measurement | Expected reading |
|---|---|
| Resistance across 85/86 (coil) | Finite resistance -- varies by relay, not zero and not open |
| Continuity 30 to 87 (NO), coil de-energized | Open (no continuity) |
| Continuity 30 to 87a (NC), coil de-energized | Closed (continuity) |
| Continuity 30 to 87, coil energized at rated voltage | Closed (continuity) |
| Continuity 30 to 87a, coil energized at rated voltage | Open (no continuity) |
If any of these readings don't match, the relay has failed in some way -- see the failure modes below.
Common Relay Failure Modes
Welded or stuck contacts. The relay stays switched on (30 to 87 still shows continuity) even after you remove power from the coil. This is usually caused by switching a load that exceeds the contact current rating, or by inductive arcing when the relay switches a motor, solenoid, or other inductive load without adequate protection on the load side. Repeated arcing pits the contact surfaces until they fuse together.
Open coil. No click when you energize it, and no continuity across 85/86. The coil winding has broken internally, usually from age, overheating, or physical damage. There's no fixing this -- replace the relay.
Contact corrosion or high resistance. The relay clicks normally, meaning the coil is fine, but the connected load runs weak, dim, or flickers. The contact surfaces have oxidized or pitted enough to add resistance to the load path even though a basic continuity check still shows a closed circuit. A voltage-drop test across the closed contacts under load will catch this where a simple continuity test won't.
Choosing Contact Ratings and Fuse Sizing
When you pick a relay, choose a contact current rating with real margin above the load's steady-state current -- not right at the edge of it. Motors, incandescent bulbs, and other loads with high inrush current can briefly draw several times their running current when they first switch on, and running contacts near their rated maximum shortens their life.
The fuse in the 30/87 load path should be sized to protect the wire gauge you're using, not just matched to the relay's contact rating. Relay contacts are often rated well above what a given wire size can safely carry, so the fuse's real job is protecting the wiring and the load, not the relay itself.
The coil-side (85/86) circuit is a different story. Coil current is typically small, so it's normally adequately protected by a small fuse or simply by the low current rating of the switch or transistor driving it, rather than needing a large fuse of its own.
Relay Coil Power and Control-Side Current
Two simple calculations are useful once you know a relay's coil resistance and rated coil voltage.
Coil power dissipation: P = V² / R, using the coil voltage and coil resistance. This tells you how much heat the coil generates, which matters most in continuous-duty applications where the relay stays energized for long periods.
Minimum control-side current: I = V/R, using the same coil voltage and resistance. This tells you how much current the driving circuit needs to supply to energize the coil. Compare that number to what your control source can actually deliver -- a microcontroller GPIO pin is typically limited to around 20mA, so if the calculated coil current is higher than that, the pin can't drive the relay directly and needs a transistor or MOSFET driver stage in between, as covered in the Arduino wiring section above.
Key Takeaways
- A relay uses a small control signal to switch a larger load, with electrical isolation between the two circuits.
- The five pins on a standard relay are: coil (85, 86), common (30), normally open (87), and normally closed (87a).
- Always include a flyback diode across the coil when driving from a transistor or microcontroller.
- Always fuse the load circuit and use appropriately sized wire.
- DPDT relays can reverse motor direction by swapping polarity.
- Check coil voltage, contact current rating, and contact configuration before wiring.
Frequently asked questions
why does my relay click but the load doesn't turn on
A click means the coil is energizing and the armature is moving, so the coil side is fine. The problem is on the load side: a blown fuse in the 30/87 circuit, a bad ground, a wire that's come loose from pin 87 or 30, or contacts corroded enough to add resistance despite still closing. Check for voltage at pin 87 with the relay energized.
can I use a 12V relay on a 24V system
No. A 12V relay's coil is wound for 12V and will draw roughly double its rated current on 24V, which overheats the coil and can burn it out quickly. Use a relay with a coil rated for your actual control voltage. The contact rating (the load side) is separate and doesn't need to match your control voltage.
do I need a diode with every relay
You need a flyback diode whenever a transistor, MOSFET, microcontroller, or other semiconductor is switching the coil directly, since the voltage spike from the collapsing magnetic field can damage that component. If a mechanical switch alone is energizing the coil, a diode is less critical but is still good practice to protect any other electronics sharing that power rail.
how do I know if a relay is bad
Test it with a multimeter. Measure resistance across the coil pins (85/86) -- it should read a finite value, not zero or open. Then check continuity across the common and normally open pins (30/87) with the coil de-energized and again with rated voltage applied to the coil. If the readings don't flip as expected, or there's no click at all, the relay has failed.
what happens if you wire a relay backwards
Most electromechanical relay coils aren't polarity sensitive, so reversing 85 and 86 usually still energizes the coil normally. The bigger risk is wiring the load to the NC (87a) contact instead of NO (87), which makes the load run backwards -- on by default, off when activated. A backwards flyback diode can short the coil supply when energized and blow a fuse.
why does my relay hum or chatter instead of clicking cleanly
Chattering usually means the coil isn't getting a clean, steady voltage -- a weak or fluctuating power supply, a loose connection at 85 or 86, or a control voltage that's below the relay's rated pull-in voltage. Check the voltage at the coil pins while it's supposed to be energized; if it's sagging or unstable, trace it back to the power source or wiring before assuming the relay itself is defective.