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 electromagnet to open or close a circuit. It allows a low-power signal to control a higher power circuit, providing isolation and control in various applications. Relays are widely used in automation, home appliances, automotive systems, and industrial equipment to control high-current devices such as motors, lights, and heaters.

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

  • Home Automation: Controlling lights, fans, and other appliances remotely.
  • Automotive Systems: Switching headlights, horns, and other high-current components.
  • Industrial Control: Managing motors, pumps, and heavy machinery.
  • Microcontroller Projects: Interfacing low-power microcontrollers (e.g., Arduino) with high-power devices.
  • Safety Systems: Providing electrical isolation between control and power circuits.

Technical Specifications

Below are the general technical specifications for a standard 5V single-channel relay module:

Key Technical Details

  • Operating Voltage: 5V DC
  • Trigger Voltage: 3.3V to 5V (logic level compatible)
  • Maximum Switching Voltage: 250V AC or 30V DC
  • Maximum Switching Current: 10A
  • Coil Resistance: ~70Ω (varies by model)
  • Isolation: Optocoupler isolation (in most relay modules)
  • Relay Type: SPDT (Single Pole Double Throw)

Pin Configuration and Descriptions

The relay module typically has the following pins:

Pin Name Description
VCC Connect to the 5V power supply.
GND Connect to the ground of the power supply.
IN Control signal input. A HIGH signal activates the relay, and a LOW signal deactivates it.
COM Common terminal of the relay switch.
NO Normally Open terminal. Connect the load here if you want it to be OFF by default.
NC Normally Closed terminal. Connect the load here if you want it to be ON by default.

Usage Instructions

How to Use the Relay in a Circuit

  1. Power the Relay Module: Connect the VCC pin to a 5V power source and the GND pin to ground.
  2. Control Signal: Connect the IN pin to a microcontroller's GPIO pin or any control signal source.
  3. Load Connection:
    • Connect the load's live wire to the COM terminal.
    • Connect the load's other wire to either the NO or NC terminal, depending on the desired default state:
      • NO (Normally Open): The load is OFF when the relay is inactive and ON when the relay is activated.
      • NC (Normally Closed): The load is ON when the relay is inactive and OFF when the relay is activated.
  4. Control the Relay: Use the control signal to toggle the relay state.

Important Considerations and Best Practices

  • Isolation: Ensure proper electrical isolation between the control circuit and the high-power circuit to prevent damage.
  • Flyback Diode: If you're using a bare relay (not a module), add a flyback diode across the relay coil to protect the circuit from voltage spikes.
  • Current Ratings: Do not exceed the relay's maximum current and voltage ratings to avoid overheating or damage.
  • Power Supply: Use a stable 5V power supply to ensure reliable operation.
  • Microcontroller Compatibility: Ensure the control signal voltage matches the relay's trigger voltage.

Example: Using a Relay with Arduino UNO

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

// Define the relay control pin
const int relayPin = 7;

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

void loop() {
  digitalWrite(relayPin, HIGH); // Turn the relay ON
  delay(1000); // Keep it ON for 1 second
  digitalWrite(relayPin, LOW); // Turn the relay OFF
  delay(1000); // Keep it OFF for 1 second
}

Code Explanation:

  • The relayPin is connected to the IN pin of the relay module.
  • The relay is turned ON by setting the pin HIGH and turned OFF by setting it LOW.
  • A delay of 1 second is used to toggle the relay state repeatedly.

Troubleshooting and FAQs

Common Issues and Solutions

  1. Relay Not Activating:

    • Cause: Insufficient control signal voltage.
    • Solution: Ensure the control signal voltage matches the relay's trigger voltage (3.3V or 5V).
  2. Load Not Switching:

    • Cause: Incorrect wiring of the load to the relay terminals.
    • Solution: Verify the load is connected to the correct terminals (COM, NO, or NC).
  3. Relay Clicking but No Output:

    • Cause: Faulty relay or insufficient power supply.
    • Solution: Check the relay module and ensure a stable 5V power supply.
  4. Microcontroller Resetting When Relay Activates:

    • Cause: Voltage spikes or insufficient power supply.
    • Solution: Use a flyback diode across the relay coil and ensure the power supply can handle the load.

FAQs

  • Q: Can I use a 3.3V microcontroller with a 5V relay module?
    A: Yes, if the relay module supports 3.3V trigger signals. Otherwise, use a level shifter or transistor circuit.

  • Q: Can I control an AC load with a DC relay?
    A: Yes, as long as the relay's maximum switching voltage and current ratings are not exceeded.

  • Q: Why is my relay module heating up?
    A: This could be due to exceeding the relay's current rating. Ensure the load is within the specified limits.

  • Q: Can I use multiple relays with one microcontroller?
    A: Yes, but ensure the microcontroller can supply enough current to drive all the relays or use a separate power supply.

This documentation provides a comprehensive guide to understanding and using relays effectively in various applications.