Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Relay: Examples, Pinouts, and Specs

Image of RelayDesign with Relay in Cirkit Designer

Introduction

A relay is an electromechanical switch that uses an electromagnetic coil to open or close a circuit, allowing control of a high-power circuit with a low-power signal. The Bestep 2 Channel Optocoupler Relay is a versatile module designed for applications requiring isolation between the control signal and the high-power circuit. It features optocoupler isolation for enhanced safety and reliability.

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!

Common Applications and Use Cases

Technical Specifications

The following are the key technical details for the Bestep 2 Channel Optocoupler Relay:

General Specifications

Pin Configuration and Descriptions

The module has two sets of pins: Input Pins for control signals and Output Terminals for the high-power circuit.

Input Pins

Pin Name Description
VCC Connect to the 5V power supply.
GND Connect to the ground of the power supply.
IN1 Control signal for Relay 1. A HIGH signal activates the relay.
IN2 Control signal for Relay 2. A HIGH signal activates the relay.

Output Terminals (for each relay)

Terminal Name Description
COM Common terminal for the relay.
NO Normally Open terminal. Connect the load here if it should be OFF by default.
NC Normally Closed terminal. Connect the load here if it should be ON by default.

Usage Instructions

How to Use the Relay in a Circuit

  1. Power the Module: Connect the VCC pin to a 5V power supply and the GND pin to ground.
  2. Connect the Control Signal: Use a microcontroller (e.g., Arduino) to send a HIGH or LOW signal to the IN1 and IN2 pins to control the relays.
  3. Connect the Load:
    • For a device that should be OFF by default, connect it between the NO terminal and COM.
    • For a device that should be ON by default, connect it between the NC terminal and COM.
  4. Ensure Isolation: The optocoupler ensures electrical isolation between the control circuit and the high-power circuit, enhancing safety.

Important Considerations and Best Practices

Example: Connecting to an Arduino UNO

Below is an example of how to control the Bestep 2 Channel Optocoupler Relay using an Arduino UNO.

Circuit Connections

Arduino Code

// Define the relay control pins
const int relay1 = 7; // Relay 1 control pin
const int relay2 = 8; // Relay 2 control pin

void setup() {
  // Set relay pins as outputs
  pinMode(relay1, OUTPUT);
  pinMode(relay2, OUTPUT);

  // Initialize relays to OFF state
  digitalWrite(relay1, LOW); // Relay 1 OFF
  digitalWrite(relay2, LOW); // Relay 2 OFF
}

void loop() {
  // Turn Relay 1 ON for 2 seconds
  digitalWrite(relay1, HIGH); // Relay 1 ON
  delay(2000);                // Wait for 2 seconds

  // Turn Relay 1 OFF
  digitalWrite(relay1, LOW);  // Relay 1 OFF
  delay(2000);                // Wait for 2 seconds

  // Turn Relay 2 ON for 3 seconds
  digitalWrite(relay2, HIGH); // Relay 2 ON
  delay(3000);                // Wait for 3 seconds

  // Turn Relay 2 OFF
  digitalWrite(relay2, LOW);  // Relay 2 OFF
  delay(3000);                // Wait for 3 seconds
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. Relay Not Activating

    • Cause: Insufficient control signal voltage.
    • Solution: Ensure the control signal voltage is between 3.3V and 5V.
  2. Load Not Turning ON/OFF

    • Cause: Incorrect wiring of the load to the relay terminals.
    • Solution: Verify the load is connected to the correct terminals (NO/NC and COM).
  3. Relay Module Overheating

    • Cause: Exceeding the maximum current rating.
    • Solution: Ensure the load does not exceed 10A. Use a heat sink or cooling fan if necessary.
  4. Interference with Microcontroller

    • Cause: Electromagnetic interference from the relay.
    • Solution: Use decoupling capacitors near the microcontroller and keep the relay module physically separated from sensitive components.

FAQs