🛠 Configure Xerxes Pi 2026 I/O
Objectifs
This tutorial aims to master Input/Output (I/O) on the Xerxes Pi 2026 carrier board. We will utilize Qwiic connectors for I2C peripherals and the mezzanine connector for specific signals. The goal is to read a sensor and display data on an OLED screen, using the pins exposed by this compact 120 x 40 mm board.
Required Hardware
- Xerxes Pi 2026 board with Raspberry Pi CM4 or CM5 module inserted.
- USB-C or PoE power supply (depending on the selected bridge).
- Qwiic SH-series cables (4-pin) for I2C.
- I2C Sensor (e.g., BME280) and I2C OLED Display (SSD1306).
- Raspberry Pi OS or Ubuntu Server installed on the M.2 NVMe storage.
- SSH terminal or HDMI screen via the mezzanine connector.
Steps
- Hardware Preparation: Ensure the CM4/CM5 module is firmly seated in the two 100-pin mezzanine connectors. Check the power bridge to select USB-C or PoE. Connect the Qwiic cable from the BME280 sensor to one of the available SH-series connectors on the board.
- Software Configuration: Connect via SSH. Enable the I2C interface using the configuration utility:
sudo raspi-config nonint do_i2c 0
sudo reboot
- Library Installation: Install the tools needed to communicate with I2C peripherals:
sudo apt update
sudo apt install python3-smbus i2c-tools
- Peripheral Detection: Scan the I2C bus to confirm the sensor and display are recognized. You should see their addresses (e.g., 0x76 for BME280, 0x3C for OLED):
sudo i2cdetect -y 1
- Test Script: Create a simple Python script to read the sensor and display the temperature on the OLED. Use the
adafruit-circuitpython-bme280andadafruit-circuitpython-ssd1306libraries.
import board
import busio
import adafruit_bme280
import adafruit_ssd1306
i2c = busio.I2C(board.SCL, board.SDA)
bme = adafruit_bme280.Adafruit_BME280_I2C(i2c)
display = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c)
while True:
display.fill(0)
display.text(f"Temp: {bme.temperature:.1f}C", 0, 0)
display.show()
- Execution: Run the script. Data should appear on the OLED. If nothing displays, check Qwiic connections and I2C addresses.
Verification
The sensor must transmit consistent data, and the display must update the temperature in real-time. Use dmesg to check for I2C bus errors. The system should remain stable under light load.
Further Reading
Explore I2S audio expansion via Qwiic connectors. Integrate this configuration into Docker for isolated management, as suggested by the macOS monitoring app. Consult the KiCad files on GitHub to understand the routing of CSI and HDMI signals exposed on the mezzanine.
Other tutorials for this board
Code examples for this board
poe-status-monitor.pypythonnvme-benchmark.shbashqwiic-bme280-reader.pypythonpwm-fan-control.pypythonethernet-poe-config.shbashnvme_storage_benchmark-6.inobash