10A/250VAC or 10A/30VDC
10A/250VAC or 10A/30VDC
12V DC
15mA
-40C to 85C
Applications
| The 12V 2CH Relay Board is suitable for a wide range of applications, including |
Precautions and Safety Guidelines
| When using the 12V 2CH Relay Board, please follow these precautions and safety guidelines |
Component Documentation: 12V 2CH Relay BoardOverviewThe 12V 2CH Relay Board is a dual-channel relay module designed to control and switch high-power devices or appliances using a microcontroller or other digital signal sources. This relay board is suitable for IoT projects, home automation, and industrial control systems.Key Features2-channel relay module with normally open (NO) and normally closed (NC) contacts
Operating voltage: 12V DC
Maximum switching current: 10A per channel
Optocoupler isolation for AC and DC loads
LEDs indicate relay status
Compatible with various microcontrollers and digital signal sourcesPinoutThe relay board has the following pins:VCC (12V DC power supply)
GND (ground)
IN1 (input for channel 1)
IN2 (input for channel 2)
NO1 (normally open contact for channel 1)
NC1 (normally closed contact for channel 1)
NO2 (normally open contact for channel 2)
NC2 (normally closed contact for channel 2)Code Examples### Example 1: Basic Relay Control using ArduinoThis example demonstrates how to control the relay module using an Arduino board.Hardware RequirementsArduino Uno or compatible board
12V 2CH Relay Board
12V DC power supply
Load devices (e.g., LED, fan, or lamp)Software RequirementsArduino IDE (version 1.8.x or later)Code
```c++
const int relay1Pin = 2; // Pin 2 for relay channel 1
const int relay2Pin = 3; // Pin 3 for relay channel 2void setup() {
pinMode(relay1Pin, OUTPUT);
pinMode(relay2Pin, OUTPUT);
}void loop() {
// Turn relay 1 ON for 2 seconds
digitalWrite(relay1Pin, HIGH);
delay(2000);
digitalWrite(relay1Pin, LOW);
// Turn relay 2 ON for 2 seconds
digitalWrite(relay2Pin, HIGH);
delay(2000);
digitalWrite(relay2Pin, LOW);
}
```
### Example 2: Home Automation using Raspberry Pi and PythonThis example demonstrates how to control the relay module using a Raspberry Pi and Python.Hardware RequirementsRaspberry Pi (any model)
12V 2CH Relay Board
12V DC power supply
Load devices (e.g., LED, fan, or lamp)Software RequirementsRaspbian OS (latest version)
Python 3.x
RPi.GPIO library (install using `pip install RPi.GPIO`)Code
```python
import RPi.GPIO as GPIO
import timeGPIO.setmode(GPIO.BCM)
relay1_pin = 17
relay2_pin = 23GPIO.setup(relay1_pin, GPIO.OUT)
GPIO.setup(relay2_pin, GPIO.OUT)while True:
# Turn relay 1 ON for 2 seconds
GPIO.output(relay1_pin, GPIO.HIGH)
time.sleep(2)
GPIO.output(relay1_pin, GPIO.LOW)
# Turn relay 2 ON for 2 seconds
GPIO.output(relay2_pin, GPIO.HIGH)
time.sleep(2)
GPIO.output(relay2_pin, GPIO.LOW)
```
These examples demonstrate the basic operation of the 12V 2CH Relay Board. You can modify the code to suit your specific IoT project requirements. Always ensure safe and proper connections when working with high-power devices and loads.