Pirelay-V2 – SB Components Ltd Skip to content

Successfully Funded!

LoRaWAN Series - Gateways & Nodes, Build for Raspberry Pi, Pico, Espressif, and beyond!

Explore our lineup of Gateways & Nodes, compatible with TheThingsStack, Chirpstack & more.


PiRelay V2 is developed by SB Components with the potential to control 4 appliances and loads up to 250V AC/ 7 A, 30V DC/ 10A to provide a way to control the high voltage/current devices. It helps the user to enhance the intelligence of the appliances. It comprises an “Optocoupler” that allows the circuit to transmit an electrical signal between two isolated circuits through light energy. Optocoupler helps the user to prevent the high voltages in one part of the circuit from affecting the other part of the circuit which provides safety to the system. It provides a better connection of Pi Relay V2 with the Raspberry Pi that gets enabled from the standardized shield form factor. One can enable the IoT technology of their home appliances using Pi Relay V2 that will make their life efficient.


  • High-quality Relay and loads up to 250VAC/7A, 30VDC/10A.
  • Optocoupler
  • Standardized shield shape and design.
  • LED working status indicators for each Relay.
  • High-quality Relays.
  • Pin Stacking Header for accessing GPIO of RPi.


  • Channel - 4 CH
  • Operating Voltage - 5V
  • AC Control Voltage - 7A / 250V
  • DC Control Voltage - 10A / 30V
  • Dimensions - 6.5cm x 5.5cm


Hardware Details

    • There are a total of 5 led's on the PiRelay-V2 board.

The power led will light up when the board is powered via gpio header. The status/indicator led will light up when the relay1-relay4 is activated.

    • COM (Common): Connect this pin to the signal you want to switch.
    • NC (Normally Close): In this configuration, the relay always remains closed until you send a signal to the relay to open the circuit.
    • NO (Normally Open): This configuration is totally opposite of NC Terminal configuration, It remain open until you send a signal to relay to close the circuit.

    • On-Board jumpers are provided to use default pins of Pi internally connected with GPIO Header. In case you need to use any other GPIO rather than the default one, you can remove these jumpers and connect relay pins directly to the GPIO of Raspberry Pi Pins.

    • On-Board optocouplers are provided to protect the circuit from high voltage/current to avoid any kind of mishappening. it also offers isolation between the analog and digital grounds to ensure that switching currents in the relay coils do not affect the noise margin of the digital circuit.


    • Stack PiRelay-V2 HAT on Raspberry Pi 40 Pin GPIO header.
    • Make sure all four jumpers are connected.
    • Open Terminal and clone/download the repository by typing below command in terminal:

git clone https://github.com/sbcshop/PiRelay-V2.git

    • Your code will be downloaded to '/home/pi' directory. Use 'ls' command to check the list of directories and 'cd' command to enter directory.

cd PiRelay-V2

    • 'test.py' is example code for PiRelay-V2. Run test file and play with PiRelay-V2 by running below python command.

python3 test.py

    • You can also use any other GPIO of Raspberry Pi by removing the jumpers and connecting the relay pin directly to the Raspberry Pi GPIO header using jumper cables or wire.

GPIO 4 Relay Not working Fix

    • Click on Start button >> Preferences >> Raspberry Pi Configuration, Then click on Interfaces Tab and make sure 1-Wire is disabled.
    • Click on the OK button then reboot Raspberry pi.


  • Source Code