Zum Inhalt springen

WSAL15423 – RPi Relay Board (B)/en

Aus JW Tech Wiki

Documentation notice: This technical documentation was independently rewritten from an archived supplier source. Check technical details and commands against the product version and manufacturer documentation before use.

Summary

Technical overview of the Waveshare RPi Relay Board (B): an 8-channel relay expansion for Raspberry Pi, Horizon Sunrise X3 Pi and Jetson Nano. The module provides relays via GPIO pins; the channel-to-pin mapping is documented in a table.

Related products at JW Tech

Technical overview

  • The module offers eight relay channels controlled through specific Raspberry Pi GPIO pins.
  • Channels 1–8 map to RPi pins 29, 31, 33, 36, 35, 38, 40 and 37 (BCM 5, 6, 13, 16, 19, 20, 21, 26).
  • Yellow jumpers (Relay_JMP) select the relay control input; with jumpers inserted, the Raspberry Pi can drive the relays.
  • For Raspberry Pi: install BCM2835, WiringPi or the Python library RPi.GPIO depending on OS branch (Bullseye uses apt instead of apt-get, Python 3 only; Bookworm supports only lgpio).
  • Demo programs close then open the relays sequentially; each channel has an indicator LED showing state; press Ctrl+C to stop execution.
  • Web control via the Python bottle framework on port 8080, accessed by entering the device IP address in a browser.
  • For Horizon Sunrise X3 Pi: install bottle via pip3, run demo with python3 Relay_Module.py.
  • For Jetson Nano: install Jetson.GPIO, set up the gpio group and udev rules, then run the C or Python demo plus web control.

Commands and examples – verify before use: 

wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz
tar zxvf bcm2835-1.71.tar.gz
cd bcm2835-1.71/
sudo ./configure && sudo make && sudo make check && sudo make install
sudo apt-get install wiringpi
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
gpio -v
git clone https://github.com/WiringPi/WiringPi
cd WiringPi
./build
gpio -v
sudo apt-get update
sudo apt-get install python-pip
sudo pip install RPi.GPIO
sudo apt-get install python3-pip
sudo pip3 install RPi.GPIO
wget https://files.waveshare.com/upload/b/b4/RPi_Relay_Board_B.zip
unzip -o RPi_Relay_Board_B.zip -d ./RPi_Relay_Board_B
sudo chmod 777 -R RPi_Relay_Board_B

Notes and version constraints

  • Exact voltage and current ratings of the relays are not provided; consult the datasheet.
  • Compatibility with specific Raspberry Pi models and operating systems is version-dependent; confirm before use.
  • Web control requires a compatible browser (source recommends Google Chrome); other browsers may have issues.
  • On Bookworm only the lgpio library is available; BCM2835 and WiringPi cannot be installed there.
  • Before running demos, ensure all dependencies are installed and permissions are correctly set.

Source and revision record