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

How to Use Relay with optocoupler: Examples, Pinouts, and Specs

Image of Relay with optocoupler
Cirkit Designer LogoDesign with Relay with optocoupler in Cirkit Designer

Introduction

A relay with an optocoupler combines the functions of a relay and an optical isolator, allowing for the control of high voltage or high current circuits while providing electrical isolation from the control circuit. The optocoupler uses light to transmit signals between its input and output, ensuring that the control side is protected from voltage spikes and noise.

Explore Projects Built with Relay with optocoupler

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino Nano Controlled Octocoupler Interface for Signal Isolation
Image of complete togba no lcd: A project utilizing Relay with optocoupler in a practical application
This circuit uses optocouplers paired with 220-ohm resistors to interface an Arduino Nano with an external device via a 5-pin relimate connector, providing electrical isolation and signal transfer while protecting the microcontroller. The Arduino's digital I/O pins are connected to the optocouplers, but the control logic is not yet defined in the provided code.
Cirkit Designer LogoOpen Project in Cirkit Designer
Wi-Fi Controlled Octocoupler Circuit with Wemos D1 Mini
Image of Opto: A project utilizing Relay with optocoupler in a practical application
This circuit uses a Wemos D1 Mini microcontroller to control an optocoupler, which in turn interfaces with an external system. The microcontroller drives the optocoupler through a 220-ohm resistor, allowing for electrical isolation between the microcontroller and the external connections.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based Optocoupler Control Circuit with Pushbutton Interface
Image of DVM1a: A project utilizing Relay with optocoupler in a practical application
This circuit involves an Arduino UNO controlling two 4N35 optocouplers, which are used to isolate different sections of the circuit. The circuit also includes a pushbutton for user input, resistors for current limiting, and a ceramic capacitor for noise filtering.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP8266 NodeMCU Controlled Relay with AC Bulb and Opto-isolated Input
Image of IoT LOAD CONTROL: A project utilizing Relay with optocoupler in a practical application
This circuit uses an ESP8266 NodeMCU to control a relay via a PC817 optocoupler and BC547 transistor, allowing for the switching of an AC-powered bulb. The circuit includes a protective diode for the relay, an LED indicator, and employs resistors for current limiting and signal interfacing.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Relay with optocoupler

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 complete togba no lcd: A project utilizing Relay with optocoupler in a practical application
Arduino Nano Controlled Octocoupler Interface for Signal Isolation
This circuit uses optocouplers paired with 220-ohm resistors to interface an Arduino Nano with an external device via a 5-pin relimate connector, providing electrical isolation and signal transfer while protecting the microcontroller. The Arduino's digital I/O pins are connected to the optocouplers, but the control logic is not yet defined in the provided code.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Opto: A project utilizing Relay with optocoupler in a practical application
Wi-Fi Controlled Octocoupler Circuit with Wemos D1 Mini
This circuit uses a Wemos D1 Mini microcontroller to control an optocoupler, which in turn interfaces with an external system. The microcontroller drives the optocoupler through a 220-ohm resistor, allowing for electrical isolation between the microcontroller and the external connections.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of DVM1a: A project utilizing Relay with optocoupler in a practical application
Arduino UNO-Based Optocoupler Control Circuit with Pushbutton Interface
This circuit involves an Arduino UNO controlling two 4N35 optocouplers, which are used to isolate different sections of the circuit. The circuit also includes a pushbutton for user input, resistors for current limiting, and a ceramic capacitor for noise filtering.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of IoT LOAD CONTROL: A project utilizing Relay with optocoupler in a practical application
ESP8266 NodeMCU Controlled Relay with AC Bulb and Opto-isolated Input
This circuit uses an ESP8266 NodeMCU to control a relay via a PC817 optocoupler and BC547 transistor, allowing for the switching of an AC-powered bulb. The circuit includes a protective diode for the relay, an LED indicator, and employs resistors for current limiting and signal interfacing.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Home automation systems (e.g., controlling lights, fans, or appliances)
  • Industrial control systems
  • Motor control and switching
  • Protection circuits for microcontrollers and low-voltage devices
  • Signal isolation in noisy environments

Technical Specifications

Key Technical Details

  • Relay Type: Electromechanical or solid-state relay
  • Optocoupler Type: Phototransistor-based
  • Input Voltage (Control Side): Typically 3.3V to 5V DC
  • Relay Voltage (Load Side): 5V, 12V, or 24V DC (varies by model)
  • Maximum Load Current: Up to 10A (depending on the relay rating)
  • Electrical Isolation: > 1000V between control and load sides
  • Trigger Current: ~5-20mA (depending on the optocoupler and relay)
  • Switching Time: ~10ms (varies by relay type)
  • Operating Temperature: -40°C to 85°C

Pin Configuration and Descriptions

Control Side (Input)

Pin Name Description
VCC Positive voltage input (3.3V or 5V)
GND Ground connection
IN Control signal input (active LOW)

Load Side (Output)

Pin Name Description
NO Normally Open terminal
NC Normally Closed terminal
COM Common terminal

Usage Instructions

How to Use the Component in a Circuit

  1. Power the Control Side: Connect the VCC and GND pins to the power supply of your control circuit (e.g., 5V from a microcontroller).
  2. Connect the Control Signal: Attach the IN pin to a GPIO pin of your microcontroller. When the GPIO pin is set LOW, the relay will activate.
  3. Connect the Load Side:
    • For devices that should turn ON when the relay is activated, connect the load between the NO (Normally Open) and COM (Common) terminals.
    • For devices that should turn OFF when the relay is activated, connect the load between the NC (Normally Closed) and COM terminals.
  4. Power the Relay: Ensure the relay's load side is powered with the appropriate voltage and current as per its specifications.

Important Considerations and Best Practices

  • Optocoupler Isolation: Ensure the control and load sides are electrically isolated to protect sensitive components.
  • Flyback Diode: If the relay is controlling an inductive load (e.g., a motor), add a flyback diode across the load to suppress voltage spikes.
  • Current Ratings: Do not exceed the relay's maximum current and voltage ratings to avoid damage.
  • Active LOW Trigger: Most relay modules with optocouplers are triggered when the IN pin is pulled LOW. Verify this behavior in your specific module.

Example: Connecting to an Arduino UNO

Below is an example of how to control a relay with an optocoupler using an Arduino UNO.

// Example: Controlling a relay with optocoupler using Arduino UNO

#define RELAY_PIN 7  // Define the GPIO pin connected to the relay's IN pin

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

void loop() {
  digitalWrite(RELAY_PIN, LOW);  // Activate the relay (turn ON the load)
  delay(1000);  // Keep the relay ON for 1 second

  digitalWrite(RELAY_PIN, HIGH);  // Deactivate the relay (turn OFF the load)
  delay(1000);  // Keep the relay OFF for 1 second
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. Relay Not Activating:

    • Cause: Insufficient input voltage or current.
    • Solution: Verify that the control side is powered with the correct voltage (e.g., 5V) and that the GPIO pin can supply enough current.
  2. Load Not Switching:

    • Cause: Incorrect wiring on the load side.
    • Solution: Double-check the connections between the NO, NC, and COM terminals.
  3. Microcontroller Resetting When Relay Activates:

    • Cause: Voltage spikes or noise from the relay.
    • Solution: Add a flyback diode across the load and use decoupling capacitors near the microcontroller.
  4. Relay Stuck in ON or OFF State:

    • Cause: Damaged relay or optocoupler.
    • Solution: Replace the relay module and ensure the circuit is within the component's specifications.

FAQs

  • Q: Can I use a 3.3V microcontroller with a 5V relay module?
    A: Yes, but ensure the optocoupler can trigger the relay with a 3.3V signal. If not, use a level shifter.

  • Q: How do I know if the relay is active?
    A: Most relay modules include an LED indicator that lights up when the relay is activated.

  • Q: Can I control AC loads with this relay?
    A: Yes, as long as the AC voltage and current are within the relay's rated specifications. Always follow safety precautions when working with AC.

  • Q: What is the purpose of the optocoupler?
    A: The optocoupler provides electrical isolation between the control and load sides, protecting the control circuit from voltage spikes and noise.