Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Relay: Examples, Pinouts, and Specs

Image of Relay
Cirkit Designer LogoDesign with Relay in Cirkit Designer

Introduction

A relay is an electromechanical switch that uses an electromagnetic coil to open or close a circuit. It allows control of high-power devices using low-power signals, making it an essential component in automation, control systems, and various electronic applications. Relays are widely used in home appliances, automotive systems, industrial machinery, and microcontroller-based projects.

Explore Projects Built with Relay

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
WeMos D1 R2 Controlled Relay Switching Circuit for AC Bulb and USB Charger
Image of Hand Gesture Light: A project utilizing Relay in a practical application
This circuit uses a WeMos D1 R2 microcontroller to control a 5V 2-relay module, which in turn controls the power to an AC bulb and a cellphone charger. The microcontroller also interfaces with a line tracking sensor, which likely provides input to control the relay states. The AC bulb and cellphone charger are powered by an AC wire connection, with the relay acting as a switch for the bulb.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Powered 8-Channel Relay Controller with Wi-Fi Connectivity
Image of Olimex ESP32-POE2 4Ch X 2 Switches: A project utilizing Relay in a practical application
This circuit features an ESP32 microcontroller connected to an 8-channel relay module. The ESP32 controls the relay channels via its GPIO pins, allowing for the switching of external devices or loads through the relays.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered IR Sensor Controlled Relay Module
Image of New: A project utilizing Relay in a practical application
This circuit uses an IR sensor to control a 1 Channel 5V Relay Module, which is powered by a 9V battery. The IR sensor detects an object and sends a signal to the relay module to switch its state, enabling or disabling the connected load.
Cirkit Designer LogoOpen Project in Cirkit Designer
Wi-Fi Controlled Smart Lighting System with NodeMCU and Relay Module
Image of HOME AUTOMATION USING GOOGLE ASSISTANT: A project utilizing Relay in a practical application
This circuit uses a NodeMCU V3 ESP8266 microcontroller to control a 4-channel relay module, which in turn controls four bulbs. The relays are powered by a 220V power source, and the microcontroller can switch each relay on or off to control the corresponding bulb.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Relay

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Hand Gesture Light: A project utilizing Relay in a practical application
WeMos D1 R2 Controlled Relay Switching Circuit for AC Bulb and USB Charger
This circuit uses a WeMos D1 R2 microcontroller to control a 5V 2-relay module, which in turn controls the power to an AC bulb and a cellphone charger. The microcontroller also interfaces with a line tracking sensor, which likely provides input to control the relay states. The AC bulb and cellphone charger are powered by an AC wire connection, with the relay acting as a switch for the bulb.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Olimex ESP32-POE2 4Ch X 2 Switches: A project utilizing Relay in a practical application
ESP32-Powered 8-Channel Relay Controller with Wi-Fi Connectivity
This circuit features an ESP32 microcontroller connected to an 8-channel relay module. The ESP32 controls the relay channels via its GPIO pins, allowing for the switching of external devices or loads through the relays.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of New: A project utilizing Relay in a practical application
Battery-Powered IR Sensor Controlled Relay Module
This circuit uses an IR sensor to control a 1 Channel 5V Relay Module, which is powered by a 9V battery. The IR sensor detects an object and sends a signal to the relay module to switch its state, enabling or disabling the connected load.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of HOME AUTOMATION USING GOOGLE ASSISTANT: A project utilizing Relay in a practical application
Wi-Fi Controlled Smart Lighting System with NodeMCU and Relay Module
This circuit uses a NodeMCU V3 ESP8266 microcontroller to control a 4-channel relay module, which in turn controls four bulbs. The relays are powered by a 220V power source, and the microcontroller can switch each relay on or off to control the corresponding bulb.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Switching high-power loads such as motors, lights, and heaters.
  • Isolating low-power control circuits from high-power circuits.
  • Implementing safety mechanisms in industrial systems.
  • Controlling devices in home automation systems.
  • Interfacing with microcontrollers like Arduino or Raspberry Pi.

Technical Specifications

Below are the general technical specifications for a typical relay. Always refer to the datasheet of the specific relay model for precise details.

Key Technical Details

  • Manufacturer: Relay
  • Part ID: Relay
  • Coil Voltage: 5V DC (common for low-power relays; other variants available)
  • Coil Current: ~70 mA (varies by model)
  • Contact Rating: 10A at 250V AC or 10A at 30V DC
  • Contact Type: SPDT (Single Pole Double Throw) or DPDT (Double Pole Double Throw)
  • Switching Time: Typically 5-15 ms
  • Dielectric Strength: 1000V AC (coil to contact)
  • Insulation Resistance: ≥100 MΩ at 500V DC

Pin Configuration and Descriptions

The relay typically has 5 pins for SPDT configuration. Below is the pinout description:

Pin Name Description
Coil+ Positive terminal of the electromagnetic coil.
Coil- Negative terminal of the electromagnetic coil.
Common (COM) Common terminal for the switch.
Normally Open (NO) Connected to COM when the relay is activated (coil energized).
Normally Closed (NC) Connected to COM when the relay is not activated (coil de-energized).

Usage Instructions

How to Use the Relay in a Circuit

  1. Power the Coil: Connect the relay's coil terminals (Coil+ and Coil-) to a power source that matches the relay's rated coil voltage (e.g., 5V DC). Use a transistor or MOSFET to drive the coil if controlled by a microcontroller.
  2. Connect the Load:
    • Connect the high-power device (e.g., motor, light) to the COM and NO terminals if you want the device to turn on when the relay is activated.
    • Use the COM and NC terminals if you want the device to turn on when the relay is not activated.
  3. Control the Relay: Use a low-power control signal (e.g., from an Arduino) to energize the coil via a transistor or relay driver circuit.
  4. Add Protection: Place a flyback diode across the coil terminals to protect the circuit from voltage spikes caused by the collapsing magnetic field when the relay is turned off.

Example Circuit with Arduino UNO

Below is an example of how to control a relay using an Arduino UNO:

// Relay control example with Arduino UNO
// Connect the relay module's IN pin to Arduino pin 7
// Ensure the relay module is powered with 5V and GND

#define RELAY_PIN 7  // Define the Arduino pin connected to the relay module

void setup() {
  pinMode(RELAY_PIN, OUTPUT);  // Set the relay pin as an output
  digitalWrite(RELAY_PIN, LOW);  // Ensure the relay is off initially
}

void loop() {
  digitalWrite(RELAY_PIN, HIGH);  // Turn the relay on
  delay(1000);  // Keep the relay on for 1 second
  digitalWrite(RELAY_PIN, LOW);  // Turn the relay off
  delay(1000);  // Keep the relay off for 1 second
}

Important Considerations and Best Practices

  • Voltage Matching: Ensure the coil voltage matches the relay's rated voltage to avoid damage.
  • Current Handling: Verify that the relay's contact rating is sufficient for the load's current and voltage.
  • Isolation: Use optocouplers or relay driver modules for better isolation between the control circuit and the high-power circuit.
  • Flyback Diode: Always use a flyback diode across the coil to protect the control circuit from voltage spikes.

Troubleshooting and FAQs

Common Issues and Solutions

  1. Relay Not Activating:

    • Check if the coil voltage matches the relay's rated voltage.
    • Verify the control signal from the microcontroller or driver circuit.
    • Ensure proper connections to the coil terminals.
  2. Load Not Switching:

    • Confirm the load is connected to the correct terminals (COM, NO, or NC).
    • Check if the load's current and voltage are within the relay's contact rating.
    • Inspect for loose or faulty wiring.
  3. Relay Buzzing or Clicking Rapidly:

    • Ensure the control signal is stable and not fluctuating.
    • Check for insufficient power supply to the coil.
  4. Overheating:

    • Verify that the relay is not switching a load beyond its rated capacity.
    • Ensure proper ventilation around the relay.

FAQs

Q: Can I use a relay to control an AC load with a DC control signal?
A: Yes, relays are designed to isolate and control AC loads using a DC control signal. Ensure the relay's contact rating supports the AC load's voltage and current.

Q: Why is a flyback diode necessary?
A: A flyback diode protects the control circuit from voltage spikes generated when the relay's coil is de-energized. Without it, the voltage spike could damage sensitive components like transistors or microcontrollers.

Q: Can I directly connect a relay to an Arduino pin?
A: No, most relays require more current than an Arduino pin can supply. Use a transistor or a relay driver module to control the relay safely.

Q: How do I know if my relay is SPDT or DPDT?
A: Check the relay's datasheet or inspect the pin configuration. SPDT relays have 5 pins, while DPDT relays typically have 8 pins.

By following this documentation, you can effectively use a relay in your electronic projects while ensuring safety and reliability.