Stufin
Home Quick Cart Profile

2-Ch 5V relay Board

Buy Now on Stufin

Name

2-Ch 5V Relay Board

Description

The 2-Ch 5V Relay Board is a compact, low-cost, and widely used Internet of Things (IoT) component designed to control and switch high-current devices using a low-voltage signal. This relay board is capable of switching two independent channels, making it an ideal solution for various applications, including home automation, industrial control, and robotics.

Functionality

The 2-Ch 5V Relay Board acts as an electronic switch that can turn On/Off devices connected to it, such as lights, fans, motors, and solenoids. The relay board operates by using a low-voltage signal (5V) to control the flow of high-voltage current (up to 250V AC or 30V DC) to the connected devices. This allows for safe and efficient control of devices that require higher voltage and current than what microcontrollers or other low-voltage devices can provide.

Key Features

### Relay Specifications

Number of Channels

2

Relay Type

Electromagnetic Relay (EMR)

Contact Rating

10A/250V AC, 10A/30V DC

Switching Voltage

5V DC

Switching Current

10mA (max)

### Board Specifications

Power Supply

5V DC

Input Interface

Digital (0-5V)

Operating Temperature

-40C to 85C

Dimensions

45mm x 35mm x 20mm (L x W x H)

### Other Features

Indicator LEDs

Each channel has a built-in LED indicator to show the relay's On/Off status

optocoupler Isolation

Provides electrical isolation between the input control signal and the relay coil

PCB Material

High-quality FR4 glass epoxy material

Mounting Holes

4 x 3mm mounting holes for secure installation

Applications

The 2-Ch 5V Relay Board is suitable for a wide range of applications, including

Home automation systems

Industrial control systems

Robotics and mechatronics

IoT projects

DIY electronics projects

Interface and Connections

The relay board has a simple digital input interface, which can be connected to a microcontroller, Arduino, Raspberry Pi, or any other digital output device. The board has two 3-pin headers for each relay channel, with the following connections

VCC

5V power supply

GND

Ground

IN

Digital input signal (0-5V)

Wiring and Installation

Please ensure proper wiring and installation to avoid damage to the relay board or connected devices. Follow the manufacturer's instructions and guidelines for safe and reliable operation.

Safety Precautions

When working with the 2-Ch 5V Relay Board, please observe the following safety precautions

Handle the board with care to avoid damage to the components

Ensure proper isolation between the relay board and external devices

Use a suitable power supply voltage and current rating

Avoid overheating or excessive mechanical stress on the relay board

By following the guidelines and specifications outlined in this documentation, you can effectively integrate the 2-Ch 5V Relay Board into your IoT project or application.

Pin Configuration

  • Component Documentation: 2-Ch 5V Relay Board
  • Pin Description:
  • The 2-Ch 5V Relay Board has 6 pins, which are clearly labeled on the board. Here's a detailed description of each pin:
  • 1. VCC (5V Power Supply)
  • Function: Provides power to the relay board
  • Voltage: 5V DC
  • Recommended current: 200mA (max)
  • Connection: Connect to a 5V DC power source (e.g., Arduino, Raspberry Pi, or a separate power supply)
  • 2. GND (Ground)
  • Function: Provides a ground reference for the relay board
  • Connection: Connect to the ground pin of the power source or a common ground point in the circuit
  • 3. IN1 (Input 1)
  • Function: Controls Relay 1 (Channel 1)
  • Logic: Active LOW (i.e., relay turns ON when input is LOW, and turns OFF when input is HIGH)
  • Connection: Connect to a digital output pin from a microcontroller (e.g., Arduino, Raspberry Pi) or a logic signal from another device
  • 4. IN2 (Input 2)
  • Function: Controls Relay 2 (Channel 2)
  • Logic: Active LOW (i.e., relay turns ON when input is LOW, and turns OFF when input is HIGH)
  • Connection: Connect to a digital output pin from a microcontroller (e.g., Arduino, Raspberry Pi) or a logic signal from another device
  • 5. COM (Common Pins for Relays)
  • Function: Provides a common connection point for the normally open (NO) and normally closed (NC) contacts of both relays
  • Connection: Connect to the load or device being controlled (e.g., AC/DC power supply, lamp, motor)
  • 6. NO/NC ( Normally Open and Normally Closed Pins for Relays)
  • Function: Provides separate connections for the normally open (NO) and normally closed (NC) contacts of each relay
  • Connection:
  • + NO (Normally Open): Connect to the load or device being controlled when the relay is ON
  • + NC (Normally Closed): Connect to the load or device being controlled when the relay is OFF
  • Connection Structure:
  • To use the 2-Ch 5V Relay Board, follow this general connection structure:
  • Connect VCC to a 5V DC power source
  • Connect GND to a common ground point in the circuit
  • Connect IN1 to a digital output pin from a microcontroller or a logic signal from another device to control Relay 1
  • Connect IN2 to a digital output pin from a microcontroller or a logic signal from another device to control Relay 2
  • Connect COM to the load or device being controlled
  • Connect NO to the load or device being controlled when the relay is ON
  • Connect NC to the load or device being controlled when the relay is OFF
  • Important Notes:
  • Make sure to use a suitable power supply that can provide enough current to drive the relays.
  • Use a suitable load rating for the relays to avoid overheating or damage.
  • Ensure proper insulation and isolation between the relay board and the load or device being controlled.
  • By following this documentation, you should be able to successfully connect and use the 2-Ch 5V Relay Board in your IoT projects.

Code Examples

2-Ch 5V Relay Board Documentation
Overview
The 2-Ch 5V relay board is a compact and versatile module that allows users to control high-current devices with a low-current signal from a microcontroller or other digital interface. The board features two relays, each capable of switching up to 10A of current at 250V AC or 30V DC. The relays are controlled by digital inputs and are optically isolated from the load, ensuring safe and reliable operation.
Pinout
| Pin | Function |
| --- | --- |
| VCC | Power supply (5V) |
| GND | Ground |
| IN1 | Digital input for relay 1 |
| IN2 | Digital input for relay 2 |
| Relay 1 | Normally Open (NO) contact |
| Relay 1 | Normally Closed (NC) contact |
| Relay 1 | Common (COM) contact |
| Relay 2 | Normally Open (NO) contact |
| Relay 2 | Normally Closed (NC) contact |
| Relay 2 | Common (COM) contact |
Example 1: Basic Relay Control with Arduino
In this example, we'll use an Arduino Uno to control the relay board. We'll toggle the relays on and off at 1-second intervals.
Hardware Requirements
Arduino Uno
 2-Ch 5V relay board
 Breadboard and jumper wires
 LED or other load device
Software Requirements
Arduino IDE (version 1.8 or later)
Code
```c
const int relay1Pin = 2;  // Digital pin 2 for relay 1
const int relay2Pin = 3;  // Digital pin 3 for relay 2
void setup() {
  pinMode(relay1Pin, OUTPUT);
  pinMode(relay2Pin, OUTPUT);
}
void loop() {
  digitalWrite(relay1Pin, HIGH);  // Turn relay 1 on
  digitalWrite(relay2Pin, LOW);   // Turn relay 2 off
  delay(1000);
digitalWrite(relay1Pin, LOW);   // Turn relay 1 off
  digitalWrite(relay2Pin, HIGH);  // Turn relay 2 on
  delay(1000);
}
```
Example 2: Home Automation with Raspberry Pi and Python
In this example, we'll use a Raspberry Pi to control the relay board and turn on/off a lamp using a web interface.
Hardware Requirements
Raspberry Pi (any model)
 2-Ch 5V relay board
 Breadboard and jumper wires
 LED or other load device
 RPi-compatible web framework (e.g., Flask or Django)
Software Requirements
Raspbian OS (version 10 or later)
 Python 3.x
 Web framework of choice (e.g., Flask or Django)
Code
```python
import RPi.GPIO as GPIO
from flask import Flask, request
app = Flask(__name__)
# Set up GPIO pins for relay control
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)  # Relay 1
GPIO.setup(23, GPIO.OUT)  # Relay 2
@app.route('/relay/1/on', methods=['GET'])
def relay1_on():
    GPIO.output(17, GPIO.HIGH)
    return 'Relay 1 turned on'
@app.route('/relay/1/off', methods=['GET'])
def relay1_off():
    GPIO.output(17, GPIO.LOW)
    return 'Relay 1 turned off'
@app.route('/relay/2/on', methods=['GET'])
def relay2_on():
    GPIO.output(23, GPIO.HIGH)
    return 'Relay 2 turned on'
@app.route('/relay/2/off', methods=['GET'])
def relay2_off():
    GPIO.output(23, GPIO.LOW)
    return 'Relay 2 turned off'
if __name__ == '__main__':
    app.run(debug=True, host='0.0.0.0')
```
Example 3: Automation with ESP32 and MicroPython
In this example, we'll use an ESP32 board to control the relay board and send notifications via Wi-Fi.
Hardware Requirements
ESP32 board (e.g., ESP32 DevKitC)
 2-Ch 5V relay board
 Breadboard and jumper wires
 LED or other load device
 Wi-Fi router
Software Requirements
MicroPython firmware (version 1.12 or later)
 Wi-Fi library (e.g., `wlan`)
Code
```python
import machine
import wifi
# Set up Wi-Fi connection
wifi.connect('your_wifi_ssid', 'your_wifi_password')
# Set up GPIO pins for relay control
relay1_pin = machine.Pin(18, machine.Pin.OUT)
relay2_pin = machine.Pin(19, machine.Pin.OUT)
def send_notification(state):
    # Send notification via Wi-Fi (e.g., using HTTP or MQTT)
    print(f'Relay state changed to {state}')
def toggle_relay1(state):
    relay1_pin.value(state)
    send_notification(state)
def toggle_relay2(state):
    relay2_pin.value(state)
    send_notification(state)
# Toggle relays on and off at 1-second intervals
while True:
    toggle_relay1(1)
    toggle_relay2(0)
    machine.sleep(1)
    toggle_relay1(0)
    toggle_relay2(1)
    machine.sleep(1)
```
Notes and Precautions
Ensure the relay board is powered from a stable 5V source.
 Use appropriate load devices and follow safety guidelines when working with high-voltage or high-current applications.
 Verify the pinout and wiring before powering on the relay board.
 Consult the datasheet for the specific relay model used on the board for detailed specifications and guidelines.