Relays
A relay is an electrically controlled switching device. It allows a low-power control circuit to switch another circuit that may operate at a different voltage or carry a much higher current. Relays are widely used in power supplies, appliances, automotive systems, industrial control, alarms, amplifiers and automation equipment.
What Is a Relay?
A relay uses an electrical control signal to open or close one or more switching contacts.
A traditional electromechanical relay contains a coil, an iron core, an armature and electrical contacts.
Control voltage
│
▼
Coil
│
▼
Magnetic field
│
▼
Armature
│
▼
Contacts switch
│
▼
Load circuit
The control circuit and switched circuit can be electrically isolated from each other in an appropriately designed relay.
How an Electromechanical Relay Works
When current flows through the relay coil, a magnetic field is produced. The magnetic field attracts the armature and changes the position of the contacts.
Coil OFF │ ▼ Contacts in normal position Coil ON │ ▼ Magnetic field │ ▼ Armature moves │ ▼ Contacts change position
When the coil is de-energized, a spring normally returns the armature to its original position.
Relay Coil
The coil is the control portion of an electromechanical relay.
Common coil voltages include:
- 5 V
- 6 V
- 9 V
- 12 V
- 24 V
- 48 V
The required voltage and coil power depend on the particular relay. Always check the relay datasheet before applying power.
Relay Contacts
The contacts are the switching portion of the relay.
Common contact terminals include:
- COM — Common
- NO — Normally Open
- NC — Normally Closed
Normally Open Contact
A normally open, or NO, contact is open when the relay coil is not energized.
Coil OFF:
COM ───── NO
open
Coil ON:
COM ───── NO
closed
The load connected through the NO contact is therefore normally OFF and is switched ON when the relay is energized.
Normally Closed Contact
A normally closed, or NC, contact is closed when the relay coil is not energized.
Coil OFF:
COM ───── NC
closed
Coil ON:
COM NC
open
An NC contact can therefore be used for circuits that should remain energized until the relay is activated.
COM, NO and NC
┌── NO
│
COM ──────────┤
│
└── NC
COM is the moving common connection. Depending on the coil state, COM is connected to either NO or NC.
SPST Relay
SPST means Single Pole Single Throw.
It provides one switching circuit.
COM ───── NO or IN ───── OUT
SPST relays can be used when only one circuit needs to be switched.
SPDT Relay
SPDT means Single Pole Double Throw.
An SPDT relay has one common terminal that switches between two contacts.
┌── NO
COM ──────┤
└── NC
This is one of the most common relay contact configurations.
DPDT Relay
DPDT means Double Pole Double Throw.
It provides two electrically separate changeover contact sets operated by the same coil.
DPDT relays can be used for polarity reversal, signal switching and other control applications.
Relay Contact Rating
The contact rating specifies the maximum electrical load the relay contacts are designed to switch under specified conditions.
Important ratings include:
- Maximum voltage
- Maximum current
- AC rating
- DC rating
- Resistive load rating
- Inductive load rating
A relay rated for a particular current with a resistive load should not automatically be assumed to handle the same current with an inductive load.
AC and DC Relay Ratings
Relay contacts can have different ratings for AC and DC.
DC switching can be particularly demanding because an electrical arc does not naturally cross zero current in the same way as AC.
Always use the manufacturer's specified rating for the actual load type.
Relay Coil Resistance
The coil resistance determines the current drawn by the coil at a given DC voltage.
For a simple DC coil:
I = V / R
where V is the applied coil voltage and R is the coil resistance.
The relay datasheet should be used for the actual coil specifications.
Relay Coil Power
The approximate power consumed by a DC relay coil can be calculated as:
P = V × I
or:
P = V² / R
This is important when selecting a transistor or power supply to drive the relay.
Driving a Relay with a Transistor
A microcontroller GPIO usually should not drive a relay coil directly. A transistor can be used as the switching device.
+V
│
Relay Coil
│
├───────┐
│ │
│ Diode
│ │
│ │
▼ │
Collector │
Transistor │
Emitter │
│ │
GND ─────┘
MCU GPIO
│
▼
Base / Gate The transistor supplies the coil current while the microcontroller provides only the required control signal.
Relay Driver Transistor
A bipolar transistor or MOSFET can be used as a relay driver.
The driver must be selected according to:
- Relay coil current
- Control voltage
- Transistor voltage rating
- Transistor current rating
- Power dissipation
Relay Flyback Diode
A relay coil is an inductive load. When the coil current is suddenly interrupted, the collapsing magnetic field can generate a high voltage spike.
A diode can be placed across a DC relay coil to suppress this voltage spike.
+V │ Relay Coil │ ├─────────┐ │ │ │ Diode │ │ ▼ │ Transistor │ │ │ GND ───────┘
For a conventional DC relay driver, the diode is normally connected reverse-biased during normal coil operation.
Why the Flyback Diode Is Important
Without suitable suppression, the relay coil can generate a high transient voltage when the driver turns OFF.
This can damage:
- Transistors
- MOSFETs
- Microcontrollers
- Driver ICs
The suppression component should be selected according to the relay coil and driver circuit.
Relay Driver with a MOSFET
A logic-level MOSFET can be used as a low-side relay driver.
+V │ Relay Coil │ ├─────|<|─────┐ │ Diode │ │ │ ▼ │ Drain │ MOSFET │ Source │ │ │ GND────────────┘ MCU GPIO │ ▼ MOSFET Gate
The MOSFET should have a suitable gate-drive voltage and sufficient current and voltage ratings.
Relay Module
A relay module is a circuit board containing a relay and its supporting electronics.
A typical module may contain:
- Relay
- Transistor driver
- Flyback diode
- Resistors
- Indicator LED
- Input connector
Some modules also include optocouplers or additional protection circuitry.
Relay Module Wiring
A typical relay module may provide control terminals such as:
VCC GND IN
The relay contacts may separately provide:
COM NO NC
The exact pinout and input requirements vary between relay modules.
Relay with ESP32
An ESP32 can control a relay module through a GPIO output when the module is electrically compatible with the ESP32.
ESP32 GPIO │ ▼ Relay Module │ ▼ Relay Coil │ ▼ COM / NO / NC │ ▼ Load
The relay module's input voltage and logic-level requirements must be checked before connecting it to the ESP32.
Relay Isolation
One important advantage of an electromechanical relay is that the coil circuit can be electrically isolated from the contact circuit.
This allows a low-voltage control circuit to operate a separate circuit when the relay's insulation and contact ratings are suitable.
Isolation does not automatically make every relay installation safe. The voltage, current, insulation, creepage, clearance and enclosure requirements must still be considered.
Relay Contact Arc
When relay contacts open or close while carrying current, an electrical arc can occur.
Arc severity depends on factors including:
- Voltage
- Current
- Load type
- Inductance
- Contact material
- Switching speed
Inductive loads can produce particularly severe switching transients.
Relay Snubber
An RC snubber can be used across suitable AC or other inductive loads to reduce switching transients and contact arcing.
Relay Contact │ ├──── Load ────┐ │ │ └── RC Snubber ┘
The snubber must be designed for the actual circuit voltage, frequency and load characteristics.
Relay Contact Protection
Different loads require different suppression methods.
- DC inductive loads: diode or suitable transient suppressor
- AC inductive loads: RC snubber or suitable suppressor
- Motors: appropriate transient and interference suppression
- Resistive loads: usually simpler switching conditions
The protection component must be selected according to the load.
Relay Switching Speed
Electromechanical relays are considerably slower than semiconductor switches.
Their switching time depends on the coil, armature mechanism and relay construction.
For very high-frequency switching, a transistor, MOSFET, solid-state relay or other semiconductor device may be more appropriate.
Relay Contact Bounce
Mechanical relay contacts can bounce briefly when they change state.
This means that a single switching operation can produce several rapid electrical transitions.
If a relay contact is connected to a digital input, software or hardware debouncing may be required.
Relay Normally Energized vs Normally De-Energized
The choice of NO or NC contacts depends on the required behavior when the relay coil is not energized.
For example:
- Use NO when the load should normally be OFF.
- Use NC when the load should normally be ON.
For safety-related designs, the desired failure state should be considered carefully.
Solid-State Relay
A solid-state relay, or SSR, performs switching using semiconductor devices rather than mechanical contacts.
Depending on the design, an SSR may contain:
- Optical isolation
- LED input
- Photodetector
- MOSFETs
- Triac
- SCRs
Electromechanical Relay vs Solid-State Relay
| Feature | Electromechanical Relay | Solid-State Relay |
|---|---|---|
| Switching mechanism | Mechanical contacts | Semiconductors |
| Contact bounce | Yes | No |
| Switching speed | Relatively slow | Generally faster |
| Contact wear | Yes | No mechanical contact wear |
| On-state loss | Very low contact resistance | Depends on semiconductor technology |
| Leakage current | Very low when open | Normally higher than mechanical contacts |
AC Solid-State Relay
AC SSRs commonly use semiconductor switching devices such as triacs or SCRs.
They are useful for switching AC loads without mechanical contacts.
The actual load type, current, voltage and switching method must be considered when selecting an SSR.
DC Solid-State Relay
DC SSRs commonly use MOSFET-based switching circuitry.
They are useful for switching DC loads where fast operation and long switching life are important.
Relay Applications
- Power supplies
- Amplifiers
- Speaker protection circuits
- Automotive electronics
- Industrial control
- Home automation
- Security systems
- Appliances
- Motor control
- Lighting control
- Battery systems
- HVAC systems
- Alarm systems
Relay in an Amplifier
Relays are commonly used in audio amplifiers for speaker protection and input or output switching.
A speaker-protection circuit can delay speaker connection after power-up and disconnect the speaker if a fault condition is detected.
Amplifier Output │ ▼ Speaker Protection │ ▼ Relay │ ▼ Speaker
Relay for Speaker Protection
A protection circuit can keep the speakers disconnected during amplifier startup.
After the amplifier becomes stable, the relay energizes and connects the speakers.
The relay can also disconnect the speakers when a protection circuit detects a dangerous DC condition.
Relay for Motor Control
A relay can switch a motor when its contact ratings are suitable.
Motor loads are inductive and can produce significant startup current and switching transients.
The relay must therefore be selected according to the motor's actual electrical characteristics.
Relay for Automotive Applications
Automotive relays are commonly used to switch loads such as:
- Fans
- Lights
- Horn circuits
- Fuel pumps
- Motors
- Heaters
Automotive relays must be selected for the vehicle's electrical system and load requirements.
Relay Testing
A relay can be tested using a multimeter and a suitable power source.
- Identify the coil terminals.
- Measure coil resistance.
- Apply the specified coil voltage.
- Listen or observe for the relay to operate.
- Measure continuity between COM and NC with the coil OFF.
- Measure continuity between COM and NO with the coil ON.
Do not apply a voltage higher than the relay's rated coil voltage.
Testing the Relay Coil
Measure the resistance across the coil terminals.
An open circuit can indicate a broken coil. A resistance substantially different from the specified value can also indicate a problem.
The correct resistance should be compared with the manufacturer's specification.
Testing Relay Contacts
With the relay de-energized:
COM ↔ NC = continuity COM ↔ NO = open
When the relay is energized:
COM ↔ NC = open COM ↔ NO = continuity
This applies to a typical SPDT relay. Other contact configurations are different.
Relay Faults
| Symptom | Possible Cause |
|---|---|
| Relay does not click | Coil supply, driver, wiring or coil fault |
| Coil is open | Damaged relay coil |
| Contacts do not switch | Mechanical fault or damaged contacts |
| Contacts remain stuck | Contact welding or mechanical failure |
| Excessive contact resistance | Worn, oxidized or damaged contacts |
| Relay chatters | Insufficient coil voltage or unstable control signal |
| Driver transistor fails | Coil transient or unsuitable driver |
Relay Chatters
Relay chatter can occur when the coil does not receive a stable energizing voltage.
Possible causes include:
- Low supply voltage
- Weak power supply
- Incorrect driver circuit
- Loose wiring
- Control signal instability
- Incorrect relay coil voltage
Relay Contacts Welded
Relay contacts can weld together when excessive current or severe switching arcing occurs.
Possible causes include:
- Excessive load current
- Inductive load
- High inrush current
- Insufficient suppression
- Incorrect relay selection
Relay Replacement
When replacing a relay, the replacement should match the important electrical and mechanical characteristics.
- Coil voltage
- Coil type
- Coil power
- Contact configuration
- Contact voltage rating
- Contact current rating
- AC/DC load type
- Contact material
- Switching requirements
- Pin configuration
- Physical dimensions
- Mounting style
How to Select a Relay
- Determine the control voltage.
- Determine the coil power or current.
- Determine the required contact configuration.
- Determine the load voltage.
- Determine the load current.
- Determine whether the load is AC or DC.
- Consider resistive or inductive load characteristics.
- Check inrush current.
- Check switching frequency.
- Check insulation and isolation requirements.
- Check physical dimensions and mounting.
- Determine whether an electromechanical or solid-state relay is appropriate.
Choosing Between Relay Types
| Type | Main Advantage | Typical Application |
|---|---|---|
| Electromechanical relay | Very low contact resistance and electrical isolation | General switching |
| Solid-state relay | Fast and silent switching | Frequent switching |
| Automotive relay | Designed for vehicle electrical systems | Automotive loads |
| Signal relay | Low-level signal switching | Electronic signal circuits |
| Power relay | Higher load capability | Power switching |
Advantages of Relays
- Electrical isolation between coil and contacts
- Can switch relatively high voltages and currents
- Can switch AC and DC loads
- Simple control circuit
- Available in many contact configurations
- Useful for safety and control systems
Limitations of Relays
- Mechanical relays have moving parts.
- Contacts eventually wear.
- Mechanical switching is relatively slow.
- Contact bounce can occur.
- Coils consume power while energized.
- Coils generate magnetic-field transients.
- Inductive loads require appropriate suppression.
Common Relay Design Mistakes
- Driving a relay coil directly from a microcontroller GPIO
- Forgetting the flyback diode on a DC relay coil
- Using the wrong coil voltage
- Exceeding contact current ratings
- Ignoring motor or transformer inrush current
- Using an AC contact rating for a DC application
- Ignoring inductive-load suppression
- Using an incorrect transistor driver
- Ignoring contact bounce
- Selecting a replacement only by physical appearance
Key Points
- A relay is an electrically controlled switch.
- Electromechanical relays use a coil and mechanical contacts.
- COM is the common contact.
- NO means normally open.
- NC means normally closed.
- A transistor or MOSFET is commonly used to drive a relay coil from a microcontroller.
- A DC relay coil normally requires flyback suppression.
- Relay contact ratings depend on voltage, current and load type.
- Inductive loads can produce severe switching transients.
- Solid-state relays use semiconductor switching devices instead of mechanical contacts.
- Relays are widely used in amplifiers, automotive systems, industrial control and automation.
- Always check coil voltage, contact ratings, load type, inrush current and pinout when selecting a relay.