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
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.