XStore

NORVI X-R4 – USER GUIDE

Updated on September 8, 2026

9 min read

Overview #

NORVI X is a next generation modular industrial controller designed to power smart automation and IoT solutions. Built around a CPU module and a range of plug and play expansion modules, the platform scales from a handful of I/O points up to 200, giving system integrators, OEMs, and industrial engineers a flexible foundation for automation, remote monitoring, and data acquisition projects.

The NORVI X-R4 is a 4 channel relay output expansion module built for this platform. It provides electrically isolated relay outputs suitable for industrial control, automation, and power switching applications. Relay outputs are controlled through a PCA9538 I2C I/O expander, which keeps the module simple to add without using up extra MCU pins on the CPU module.

The X-R4 is not a standalone device. It needs to be paired with a NORVI X CPU module, such as the CPU ESPS3 X1, to be programmed and operated.

This guide covers everything needed to confidently install, wire, and commission the module, including safety requirements, technical specifications, terminal and address configuration, wiring steps, software setup, diagnostic test code, and troubleshooting.

Key Features #

  • 4 electromechanical relay outputs, each with a COM and NO terminal
  • Controlled through a PCA9538 I2C I/O expander, so only SCL and SDA are used from the CPU
  • Suitable for both AC and DC load switching
  • Rated switching current of 5 A per channel, up to 250 V AC or 30 V DC
  • Onboard DIP switch for I2C address selection, allowing multiple relay modules on the same bus
  • DIN rail mountable enclosure with spring terminals
  • Plug and play connection to the CPU module through the expansion bus
  • One status LED per input channel
  • CE / EMC compliant

Safety Information #

  • Install and wire this module only if you are a qualified electrician or trained technician familiar with industrial control equipment.
  • Confirm the host CPU is running from a regulated 24 V DC supply.
  • Never exceed 250 V AC or 30 V DC, or the rated switching current of 5 A on any channel.
  • Mount the module on a DIN rail inside a suitably rated enclosure.
  • The module has an IP20 protection rating and is not designed for direct outdoor or wash down exposure.
  • Keep the operating environment within minus 40 to plus 85 degrees C and avoid condensing humidity.
  • Do not connect or disconnect the module from the expansion bus while the system is powered.
  • Follow applicable local and national electrical codes.

Technical Specifications #

Electrical #

Rated Supply Voltage24V DC
Current Consumption80mA @ 24V DC

Output Specifications #

Number of Outputs4 x relay outputs
Output TypeSingle pole normally open relay
Isolation Voltage750 Vrms between open contacts
Rated Switching Voltage250 V AC / 30 V DC
Maximum Switching Voltage277 V AC
Rated Switching Current5 A
Limiting Continuous Current5 A
Breaking Capacity (max)1250 VA (AC) / 750 W (DC)
Initial Contact Resistance30 mΩ or less (5 VDC, 100 mA)
Mechanical Endurance10 x 10⁶ operations
Power Supply24V DC, shared with CPU through the expansion port
Communication BusInternal expansion bus (I2C)
Status Indicators4 LED output indicators
Connector TypeSpring terminal

Hardware Layout & GPIO Map #

The table below lists the terminals on the X-R4 and how they map into the PCA9538 port expander. None of the host CPU’s GPIO pins are claimed directly by the relay channels themselves. Only SCL and SDA are shared across the I2C bus.

TerminalFunction
NO1Relay 1 normally open
COM1Relay 1 common
NO2Relay 2 normally open
COM2Relay 2 common
NO3Relay 3 normally open
COM3Relay 3 common
NO4Relay 4 normally open
COM4Relay 4 common

Each channel is a single pole, normally open contact. To switch a load, wire the load in series between the COM terminal and the field supply, and connect the NO terminal to the load itself so the circuit closes only when that channel is energized.

I2C Address Selection #

The X-R4 connects to the host CPU’s I2C bus using SCL on IO9 and SDA on IO8. DIP switches 3 and 4 are not used for addressing. Set each stacked X-R4 module to a different address so the CPU can communicate with each module individually.

NORVI X-R4 I2C address selector
I2C Address Selector
Address Selection
DIP 1DIP 2DIP 3DIP 4Address
OFFOFF××0x73
ONOFF××0x72
OFFON××0x71
ONON××0x70

Wiring Guide #

GPIO pin assignments for the I2C bus are listed in the Expansion Port table below. This section covers how to physically wire the module.

Power Connection #

The X-R4 requires no separate power supply. It receives 24V DC from the CPU module through the shared expansion port connector, provided the CPU is powered from a regulated 24V DC source rated at least 1 A.

Relay Output Wiring #

  • Each of the four channels is an isolated, normally open contact.
  • Connect one side of the field supply to the COM terminal of the channel you are using.
  • Connect the load between the NO terminal and the return of the field supply.
  • The load receives power only when the relay channel is switched on by the firmware.
  • Keep AC and DC wiring runs separated and clearly labeled if the panel uses both.
  • Confirm total load current draw stays within the enclosure and supply design limits.
NORVI X-R4 relay output terminal wiring
NORVI X-R4 Relay Output Terminal Wiring

Mounting and Connecting the Module #

  • Power off the entire system before touching any wiring or seating the module.
  • Mount the X-R4 on the DIN rail next to the CPU module or another expansion module already in the chain, and seat it firmly onto the expansion bus connector.
  • The default I2C address is 0x73 with both addressing DIP switches OFF. Leave this setting for a single X-R4. If multiple I2C addressed modules are used, configure each with a unique address.
  • Wire the field loads to RO1 through RO4, using the COM and NO terminals. Confirm that the load remains within 5 A, 250 V AC or 30 V DC.
  • Power the system back on.
  • Upload the module’s test sketch from the NORVI GitHub repository and confirm that each relay channel switches correctly.
NORVI X-R4 expansion module connected with NORVI X CPU
NORVI CPU Controller with NORVI X-R4 Expansion Module

Expansion Port (50 pin) #

The X-R4 connects to the CPU through the shared 50 pin expansion bus. The pins used by this module are SCL, SDA, GND, 24V, and 5V. The remaining pins pass through for other expansion modules.

PIN INDEXPurposeGPIOSOURCE
1MOSIIO11ESP32-S3
2MISOIO13
3SCLKIO12
4GND—-
5SCLIO9
6SDAIO8
7GND—-
8RX1IO18
9TX1IO17
10GND—-
11D+—-
12D-—-
13GND—-
14CS1P1_0PCA9539
I2C Address 0x75
15CS2P0_7
16CS3P0_6
17CS4P0_5
18IO1IO1ESP32-S3
19IO2IO2
20IO4IO4
21IO5IO5
22IO6IO6
23IO7IO7
24IO10IO10
25IO11IO35
26IO12IO36
27IO13IO37
28IO14IO14
29RS485_TXIO15
30GND—-
31GND—-
32RS485_RXIO16
33P1_1P1_1PCA9539
I2C Address 0x75
34P1_2P1_2
35IO21IO21PCA9538 Reset
36GND—-
37GND—-
38P1_3P1_3PCA9539
I2C Address 0x75
39P1_4P1_4
40P1_5P1_5
41IO39IO39ESP32-S3
42IO40IO40
43NC—-
44NC—-
45NC—-
46GND—-
475V5V
48GNDGND
4924V24V
5024V24V

Software Setup (Arduino IDE) #

The NORVI X-R4 is read through the host CPU using the Arduino IDE with the ESP32 board package. Firmware examples and required libraries are maintained in the NORVI GitHub repository.

Board Configuration #

  1. Install Arduino IDE

    Install the Arduino IDE and add ESP32 board support:

    Tools → Board → Boards Manager → ESP32
  2. Connect the Controller

    Connect the NORVI X CPU to your computer using the USB interface.

  3. Select Board and Port

    Configure the board and communication port:

    Tools → Board → ESP32 Arduino → ESP32S3 Dev Module
    Tools → Port → Select the corresponding COM/serial port
Arduino IDE Board and Tools Menu Configuration
Arduino IDE Board and Tools Menu Configuration

Configure Board Settings #

Under the Tools menu, configure the following settings:

Upload Settings under the Tools Menu
Upload Settings under the Tools Menu
SettingSelection
USB CDC On BootEnabled
Flash Size16MB (128Mb)
PSRAMQSPI PSRAM

Test Code Examples #

Required Libraries #

Install these via Arduino IDE → Sketch → Include Library → Manage Libraries before compiling any of the examples below:

  • Wire
  • WiFi
  • SPI
  • PCA9538
  • TFT_eSPI
  • CST816S
  • Free_Fonts

Install the Required Library #

Install the Wire library through:

Sketch → Include Library → Manage Libraries

Search for Wire and install it if required.

Opening the Arduino IDE Library Manager
Opening the Arduino IDE Library Manager
The libraries are available in the NORVI-X-Version-02 GitHub repository .

Open and Upload the Test Sketch #

  1. Open the X-R4 test sketch from the NORVI GitHub repository .
  2. Verify the board and port selections.
  3. Click Upload to upload the test sketch to the NORVI X CPU.

I2C Bus Scan #

Run this first after wiring and setting the DIP switch address to confirm that the PCA9538 on the X-R4 is being detected before testing relay switching.

void I2C_SCAN() {
    byte error, address;
    int deviceCount = 0;

    Serial.println("Scanning...");

    for (address = 1; address < 127; address++) {
        Wire.beginTransmission(address);
        error = Wire.endTransmission();

        if (error == 0) {
            Serial.print("I2C device found at address 0x");

            if (address < 16) {
                Serial.print("0");
            }

            Serial.print(address, HEX);
            Serial.println(" !");
            deviceCount++;

            delay(1);
        }
        else if (error == 4) {
            Serial.print("Unknown error at address 0x");

            if (address < 16) {
                Serial.print("0");
            }

            Serial.println(address, HEX);
        }
    }

    if (deviceCount == 0) {
        Serial.println("No I2C devices found\n");
    }
    else {
        Serial.println("Scanning complete\n");
    }
}

Depending on the DIP switch setting, the expected device address is 0x70, 0x71, 0x72, or 0x73.

Relay Toggle Test #

This sequence switches each of the four channels in order through the PCA9538. It can be used to verify the physical relay channel mapping before connecting real loads.

#include <Wire.h>

#define PCA9538_ADDR 0x73
#define PCA9538_OUTPUT_REG 0x01
#define PCA9538_CONFIG_REG 0x03

void setRelayConfig() {
    Wire.beginTransmission(PCA9538_ADDR);
    Wire.write(PCA9538_CONFIG_REG);
    Wire.write(0x00);
    Wire.endTransmission();
}

void setRelays(byte state) {
    Wire.beginTransmission(PCA9538_ADDR);
    Wire.write(PCA9538_OUTPUT_REG);
    Wire.write(state);
    Wire.endTransmission();
}

void relayTest() {
    setRelayConfig();

    for (int i = 0; i < 4; i++) {
        byte state = 1 << i;

        Serial.print("Switching relay ");
        Serial.println(i + 1);

        setRelays(state);
        delay(1000);
    }

    setRelays(0x00);
}
Confirm the exact register map against the current sketch in the NORVI GitHub repository before relying on this for production firmware, since register addressing can vary slightly between PCA9538 library implementations.

Validating the Full Test Sketch #

When the complete test sketch runs successfully with the X-R4 attached, you should see:

  • I2C scan: The PCA9538 appears at the configured address, 0x73 by default.
  • Relay outputs: Each of the four channels switches on and off in sequence.
  • Display and touch: If the CPU display libraries are included, the TFT initializes and touch input responds.
  • No I2C errors: The Serial Monitor shows no failed transmissions or address conflicts.

If a relay does not switch, or the PCA9538 does not appear during the I2C scan, check the expansion connection and DIP switch address before connecting field loads.

Troubleshooting #

SymptomSuggested Action
Module not detected on I2C scan Reseat the module on the expansion bus, confirm the DIP switch address does not conflict with another module, and check that the CPU has sufficient power supply current headroom.
Relay does not switch despite firmware command Confirm the I2C address in your sketch matches the DIP switch setting, and rerun the I2C bus scan to confirm the PCA9538 is responding.
Relay clicks but load does not switch Check the load current and voltage against the rated switching limits, and confirm wiring is through both COM and NO.
Wrong channel activates Confirm the register bit order in your firmware matches the physical channel order from RO1 to RO4.
Address conflict with another I2C module Change the DIP switch setting on one of the modules so each I2C device has a unique address.
Relay chatters or does not hold Check for a loose expansion bus connection or insufficient power headroom on the shared 24V supply.
System resets unexpectedly under load Check the CPU power supply current rating, especially when several expansion modules are attached to the same bus.
TFT display blank or not working Check three settings under Tools: USB CDC On Boot set to Enabled, Flash Size set to 16MB (128Mb), and PSRAM set to QSPI PSRAM.

Support & Resources #

Product Documentation & Datasheets NORVI X-R4 Datasheet
Product Page Visit NORVI
Firmware Examples & Libraries NORVI X Version 02 GitHub Repository
Technical Support support@norvi.io