1. Product Introduction
1.1 Product Overview
This relay module is designed for embedded control applications to reliably switch external loads on and off. It features three independently controllable relay channels and supports active-low triggering from common 3.3V and 5V development platforms.
The module integrates optocoupler-based input signal conditioning, MOSFET relay drivers, status LEDs, and a selectable control-side voltage (VIO). An onboard synchronous buck converter provides an approximately 3V supply rail for the relay coils. This architecture improves power efficiency and reduces heat generation when powered by 5V.
1.2 Features
- Three independent relay channels with normally open (NO), common (COM), and normally closed (NC) contact terminals.
- Maximum permissible load of the relay:NO: 10A @ 250VAC / 28VDC; NO/NC: 5A @ 250VAC
- Supports 3.3V or 5V DC power input.
- Selectable VIO level: onboard 3V supply rail or input VCC.
- Optocoupler isolation at the input stage improves noise immunity and ensures a stable, reliable signal interface.
- Independent status LED for each relay channel.
- Compatible with STM32, ESP32, Arduino, Raspberry Pi, and other embedded controllers when wired to match the corresponding logic levels.
1.3 Specifications
| Item | Specification |
|---|---|
| Relay channels | 3 |
| Power input | 3.3V or 5V DC |
| Control inputs | CH1 / CH2 / CH3 |
| Trigger logic | Active low |
| VIO selection | 3V or VCC, selectable via the onboard slide switch |
| Status indication | Independent LED indicator for each relay channel |
| Typical full-load coil current | Approximately 0.35A with all three relays energized |
| Dimensions | 60 mm × 53 mm |
2. Usage
The control pin CHx(x=1/2/3) of this relay is triggered by a low level. When the VCC supply voltage is 3.3V and the logic level of the CHx pin is 0V and 3.3V, the VIO switch can be set to the VCC or 3V position. When the VCC supply voltage is 5V and the logic level of the CHx pin is 0 and 3.3V, the VIO switch should be set to the 3V position; if the logic level is 0V and 5V, the VIO switch should be set to the VCC position. The state of the switch corresponding to different VCC and CHx pin drive voltages is shown in Table 2-1 below:
VCC Voltage CHx Signal Level VIO Switch State 3.3V 0~3.3V VCC/3V 5V 0~5V VCC 5V 0~3.3V 3V
2.1 Hardware Overview
The onboard hardware resources are shown below.
3-CH Relay Module (3.3V/5V IO) — Hardware Overview
- Relay output terminals
- Relays
- Relay control signal voltage selection switch
- Power indicator (PWR)
- CH3 relay status indicator
- Relay control interface
- CH2 relay status indicator
- CH1 relay status indicator
Wiring instructions for the relay are shown below:NC – Normally Closed contact, COM – Common contact, NO – Normally Open contact.
2.2 Raspberry Pi Example Programs
The demo codes is based on the lgpio library, for Bookworm and later systems.
2.2.1 Wiring
The Bookworm example uses BCM GPIO numbering. Connect the module to the Raspberry Pi as shown below.
| Module Interface | Pin Function | BCM Number |
|---|---|---|
| VCC | 3.3V | 3.3V |
| GND | GND | GND |
| CH1 | Channel 1 Driver Pin | 26 |
| CH2 | Channel 2 Driver Pin | 19 |
| CH3 | Channel 3 Driver Pin | 13 |
Table 2-2 3-CH Relay Module (3.3V/5V IO) to Raspberry Pi Pin Assignment
2.2.2 Installing the lgpio Library
For Bookworm or later systems, the example programs use the `lgpio` library; the installation command for this library is as follows:
wget https://github.com/joan2937/lg/archive/master.zip
unzip master.zip
cd lg-master
make
sudo make install
2.2.3 Running the Example Programs
Python:
Navigate to the Python directory:
cd /home/pi/demo-codes/rpi/3-relay/python
Run:
sudo python3 3-relay.py
C:
Navigate to the C directory:
cd /home/pi/demo-codes/rpi/3-relay/c
Run:
sudo make clean
sudo make
sudo ./main
2.3 Arduino Example Program
2.3.1 Wiring
Connect the module to the Arduino UNO as shown below.
| Module Pin | Arduino UNO |
|---|---|
| VCC | 5V |
| GND | GND |
| CH1 | D7 |
| CH2 | D8 |
| CH3 | D12 |
Table 2-3 Module to Arduino Pin Assignment
2.3.2 Running the Example Program
After completing the wiring according to Table 2-3, open the demo-codes\Arduino\3-ch-relay.ino sketch in the Arduino IDE. Select Arduino Uno under Tools > Board and the corresponding port under Tools > Port. Click Verify. Once verification is successful, upload the sketch to the Arduino Uno and observe the relay status.
2.4 STM32 Example Program
2.4.1 Wiring
Connect the module to the STM32F103RB development board as shown below.
| Module Pin | STM32F103RB |
|---|---|
| VCC | 3.3V |
| GND | GND |
| CH1 | PC10 |
| CH2 | PC11 |
| CH3 | PC12 |
Table 2-4 Module to STM32 Pin Assignment
2.4.2 Running the Example Program
After completing the wiring according to Table 2-4, open the demo-codes\stm32\MDK-ARM\3-relay.uvprojx project in the MDK-ARM IDE. Build the project. Once the build is successful, download the code to the STM32 development board and observe the relay status.
2.5 Raspberry Pi Pico Example Program
2.5.1 Wiring
Connect the module to the Raspberry Pi Pico as shown below.
| Module Pin | Raspberry Pi Pico |
|---|---|
| VCC | 3.3V |
| GND | GND |
| CH1 | GP0 |
| CH2 | GP1 |
| CH3 | GP2 |
Table 2-5 Module to Raspberry Pi Pico Pin Assignment
2.5.2 Running the Example Program
- With the Pico powered off, press and hold the BOOTSEL button. Connect the Pico to your computer using a USB cable, then release the button. An RPI-RP2 drive will appear. Drag the
RPI_PICO-20260406-v1.28.0.uf2file from thedemo-codes\pciodirectory onto the RPI-RP2 drive. - After completing the wiring according to Table 2-5, right-click the
3-relay.pyfile in thedemo-codes\pythondirectory and open it with Thonny. Go to Tools > Options. In the Interpreter tab, select MicropyPython (Raspberry Pi Pico), set the port (COMx, where x may vary depending on the computer), and click OK. Click the "Run current script" button or press F5 to run the script and observe the relay status.
3. Resources
3.1 Schematic
3.2 demo codes
3.3 Datasheets
4. Related Links
5. FAQ
6. Appendix
6.1 Product Precautions and Repair
6.1.1 Precautions
- Do not connect or disconnect the module while it is powered on!
- Follow all warnings and instructions marked on the product.
- Keep the product dry. If any liquid is accidentally spilled on the product or it becomes wet, disconnect the power immediately and allow it to dry completely.
- Ensure adequate ventilation and heat dissipation during use to prevent component damage caused by excessive temperatures.
- Do not use or store the product in dusty or dirty environments.
- Avoid using the product in environments subject to repeated temperature changes, as condensation may damage its components.
- Handle the product with care. Dropping, striking, or violently shaking it may damage the circuitry and components.
- Do not clean the product with organic solvents or corrosive liquids.
- Do not attempt to repair or disassemble our products yourself. If the product malfunctions, contact us for repair. Unauthorized repairs may damage the product, and any resulting damage will not be covered by the warranty.
6.1.2 Repair
Address: After-Sales Repair Department, Guilin Shengui Technology Co., Ltd., Room 9#-211, Building 9, Minhua Technology Information Incubation Base, No. D-10-2, Information Industrial Park, Chaoyang Road, Qixing District, Guilin, Guangxi, China.
Contact: After-Sales Repair Department
