• sales

    +86-0755-88291180

Raspberry Pi Pico Relay B User Guide

Overview

Industrial 8-Channel Relay Module For Raspberry Pi Pico, Power Supply Isolation, Photocoupler Isolation

Features

  • Onboard unibody power supply isolation, provides stable isolated voltage, needs no extra power supply for the isolated terminal
  • Onboard photocoupler isolation, prevent interference from external high-voltage circuit connected to the relay
  • High-quality relay, contact rating: 10A 250V AC or ≤10A 30V DC
  • ABS protection enclosure with rail-mount support, easy to install, safe to use
  • Breakout USB port and BOOT pin, make it easy to debug without disassembling the enclosure
  • PWR indicator, RGB LED, and passive buzzer outside the enclosure

Specifications

  • Operating voltage: 5V
  • Communication Protocol: USB
  • Communication interface: Micro USB
  • Relay channel: 8 ch
  • Contact form: 1NO 1NC

Pinout


Hardware connection

Relay BPicoDescription
VCCVSYSPower input
GNDGNDGround
CH1GP21Control pin of Channel 1
CH2GP20Control pin of Channel 2
CH3GP19Control pin of Channel 3
CH4GP18Control pin of Channel 4
CH5GP17Control pin of Channel 5
CH6GP16Control pin of Channel 6
CH7GP15Control pin of Channel7
CH8GP14Control pin of Channel 8
RGBGP13Control pin of RGB LED
BUZZERGP6Control pin of buzzer

Connection


Setup environment

Please refer to Raspberry Pi's guide: https://www.raspberrypi.com/documentation/microcontrollers/

Raspberry Pi

1. Open a terminal of Raspberry Pi
2. Download and unzip the demo codes to directory Pico C/C++ SDK

sudo apt-get install p7zip-full
cd ~
sudo wget  https://www.waveshare.net/w/upload/a/a1/Pico-Relay-B_code.7z
 
7z x Pico-Relay-B_code.7z -o./Pico-Relay-B_code
cd ~/Pico-Relay-B_code
cd c/build/p

c

1. Hold the BOOTSEL button of Pico, and connect the USB interface of Pico to Raspberry Pi then release the button.
2. Go into the build directory and add the SDK path.

cd ~/Pico-Relay-B_code/c/
cd build
export PICO_SDK_PATH=../../pico-sdk

3. Run the command cmake to generate the Makefile file

cmake ..

4. Run the command make to build and generate the executable file.

make -j9

4. after building, a uf2 file is generated. Press and hold the button of the Pico board, connect it to Raspberry Pi by USB cable and then release the button. Copy the main.uf2 file generated to the recognized movable disk (RPI-RP2).

cp main.uf2 /media/pi/RPI-RP2/

python

1. Refer to Raspberry Pi's guides to setup Micropython firmware for Pico
2. Open the Thonny IDE, and drag the demo to IDE and run on Pico as below.

3. Choose File -> Open -> Pico-Relay-B_test.py file and run it

Windows

  • Download and unzip the demo to your Windows desktop, refer to Raspberry Pi's guides to set up the Windows software environment settings.
  • Press and hold the BOOTSEL button of Pico, connect the USB of Pico to the PC with a MicroUSB cable. Import c or python program into Pico to make it run.
TAG: Raspberry Pi 5 Aluminium Case Raspberry Pi DA7212 I2S Audio For XiaoZhi AI Expansion Board Dul-mic Free-Driver For PI5/PI4/Zero DC-DC Step-Down Mini voltage Moudle Input 5~36V voltage Output 5V/3.3V 4A A7670E LTE Cat-1 HAT for Raspberry Pi Multi Band 2G GSM / GPRS LBS Luckfox Pico ESP32 C3 Round LCD Development Board Electronic EYE 0.71 inch Display Watch Screen GC9D01 160x160 Tang Nano Series FPGA FAQ Raspberry Pi MIPI SpotPear Raspberry Pi CM5 Mini Base IO Board NANO B Development For Compute Module 5 Raspberry Pi Camera Raspberry Pi RTC WatchDog ESP32 3.5 inch Capacitive TouchScreen LCD Display ST7796 FT6336 320x480 For Arduino/Raspberry Pi/Pico MPS2280D Raspberry Pi 5 PCIe to M.2 NVMe Dual SSD Adapter Board HAT Pi5 Double 2280 EPS32S3 1.8inch Round LCD Display WIFI-AIDA64-Secondary-TouchScreen/Wireless-Power/Video-Player LVGL SpotPear Raspberry Pi 5 PCIe USB HUB 3.2 Gen1 HAT+ High Speed Pi5 ESP32-C6 LCD Development Board 1.3 inch Display 1.3inch Screen ST7789 240x240 Mini TV SD-Port QST LVGL For Arduino ESP32-S3 USB Dongle D-Robotics RDK X3 Module Core MD Module Horizon Sunrise Pi ARM Cortex-A53 5Tops Size Compatible With Raspberry Pi CM4 Size