Hardware Integration
Pexla sensors connect to virtually any host system through standard interfaces. All models share the same ¾″ NPT form factor and 3.3V logic. Choose the interface that matches your platform.
Pinout Overview
Pexla sensors expose all interfaces on a single 6-pin JST connector. UART TX/RX, I²C SDA/SCL, and a configurable GPIO/threshold pin share the same harness. The Modbus RS485 variant substitutes the UART lines for A/B differential pairs.
Generic MCU via UART / RS232
UART is the primary interface for all Pexla models. A direct 3-wire connection (TX, RX, GND) is all that's needed. The sensor transmits distance frames immediately on power-up at 9600 bps — no initialization required. For 5V MCUs such as Arduino Uno, a simple voltage divider on the RX line protects the sensor's 3.3V input.
Wiring Table — UART (3.3V MCU)
| Pexla Pin | MCU Pin | Wire | Notes |
|---|---|---|---|
| VCC | 3.3V | ● | Max 6V; 3.3V or 5V both work |
| GND | GND | ● | Common ground required |
| TX (sensor out) | RX (MCU in) | ● | Direct — no level shift needed at 3.3V |
| RX (sensor in) | TX (MCU out) | ● | For API commands only; leave open for read-only |
| GPIO | Any digital in | ● | Optional: threshold alert / wake |
5V MCU (Arduino Uno): add a 10kΩ / 20kΩ voltage divider on the MCU TX → Pexla RX line. The sensor TX → MCU RX line works directly as 3.3V is a valid HIGH for 5V CMOS.
Default UART Settings
| Baud Rate | 9600 bps (configurable up to 500,000) |
| Data Bits | 8 |
| Parity | None |
| Stop Bits | 1 |
| Flow Control | None |
| Logic Level | 3.3V |
| Output Frame | R{distance_mm}\n @ 1 Hz |
| Maxbotix PWM | Available on GPIO pin |
Maxbotix pin-compatible: Pexla MX is a drop-in replacement for HRXL-MaxSonar-WR sensors. Same pinout, same PWM output format, same operating voltage range.
MCU via I²C
I²C allows up to 127 Pexla sensors on a single 2-wire bus, making it ideal for multi-point monitoring arrays. The sensor appears as a 7-bit I²C peripheral. Pull-up resistors (4.7 kΩ typical) must be present on SDA and SCL. The I²C interface supports 100 kHz (Standard) and 400 kHz (Fast) modes.
Wiring Table — I²C
| Pexla Pin | MCU Pin | Wire | Notes |
|---|---|---|---|
| VCC | 3.3V | ● | 3.3V or 5V |
| GND | GND | ● | Common ground |
| SDA | SDA | ● | 4.7 kΩ pull-up to 3.3V required |
| SCL | SCL | ● | 4.7 kΩ pull-up to 3.3V required |
| GPIO | INT pin | ● | Optional: data-ready interrupt |
I²C Configuration
| Default Address | 0x52 (7-bit) |
| Speed | 100 kHz / 400 kHz |
| Pull-ups | 4.7 kΩ to 3.3V |
| Max Bus Length | ~1 m at 400 kHz |
| Multi-sensor | Up to 127 devices |
| Data Register | 0x00–0x01 (distance MSB/LSB) |
Multi-sensor arrays: each Pexla sensor's I²C address can be configured via the API. Deploy up to 127 sensors on a single bus for distributed level monitoring across a treatment facility or stormwater network.
Modbus Host via RS485
The Pexla ModBus model implements Modbus RTU over RS485 — the industrial standard supported by virtually every SCADA system, PLC, and data logger. RS485 differential signaling allows cable runs up to 1200 m and multi-drop networks of up to 32 devices on a single twisted-pair cable. The Pexla sensor acts as a Modbus slave (server) responding to function codes 03 (Read Holding Registers) and 06 (Write Single Register).
Wiring Table — RS485
| Pexla | RS485 Bus | Wire | Notes |
|---|---|---|---|
| VCC | +12V or +5V | ● | Sensor powered from bus or separate supply |
| GND | GND | ● | Common ground |
| A (D+) | A (D+) | ● | RS485 positive (non-inverting) |
| B (D−) | B (D−) | ● | RS485 negative (inverting) |
Termination: add a 120 Ω resistor across A/B at each end of the bus for cable runs over 10 m or at speeds above 9600 bps. Bias resistors (560 Ω) should be present at the master end.
Modbus Configuration
| Protocol | Modbus RTU |
| Default Address | 0x01 (configurable 1–247) |
| Baud Rate | 9600 bps default (configurable) |
| Parity | None, 8-N-1 |
| Cable | Twisted pair, shielded |
| Max Nodes | 32 (hardware), 247 (protocol) |
| Max Distance | 1200 m at 9600 bps |
| Register 0x0000 | Distance in mm (uint16) |
| Register 0x0001 | Temperature × 10 (int16) |
| Register 0x0010 | Threshold high (mm) |
| Register 0x0011 | Threshold low (mm) |
| FC 03 | Read holding registers |
| FC 06 | Write single register (config) |
PC via USB-C
The Pexla USB and Pexla SD models include a USB-C connector that presents as a virtual COM port (USB CDC) on Windows, macOS, and Linux — no driver installation required on modern operating systems. The USB connection simultaneously powers the sensor and provides full bidirectional API access. Use any serial terminal or Python script to read live distance data and configure all parameters.
USB Connection
| Connector | USB-C (Pexla) ↔ USB-A/C (PC) |
| Protocol | USB CDC (virtual COM port) |
| Driver | None required (Win 10+, macOS, Linux) |
| Windows Port | COMx (Device Manager) |
| macOS Port | /dev/cu.usbmodem* |
| Linux Port | /dev/ttyACM0 |
| Baud Rate | Any (USB is not baud-sensitive) |
| Power from USB | 5V, up to 500 mA |
| Firmware Update | Via USB — drag-and-drop or CLI tool |
Recommended Serial Terminals
Free. Connection → Serial. Set port and baud.
Graphical, logging support, timestamps.
screen /dev/ttyACM0 9600
Built into Arduino IDE. Tools → Serial Monitor.
pip install pyserial — see API Integration docs.
minicom -D /dev/ttyACM0 -b 9600
Interface Selection Guide
All interfaces expose identical distance data and API functionality. Choose based on your host platform, cable length, and deployment context.
| Criteria | UART / RS232 | I²C | Modbus RS485 | USB-C |
|---|---|---|---|---|
| Best For | MCUs, Arduino, RPi | Multi-sensor arrays | SCADA / PLC / DCS | Development, logging |
| Max Cable | ~15 m (RS232: 15 m) | ~1 m | 1200 m | 5 m (USB spec) |
| Multi-device | 1:1 only | 127 on one bus | 32–247 on one bus | 1:1 only |
| Wires Required | 3–4 | 4 + pull-ups | 4 (A, B, PWR, GND) | 1 cable |
| Noise Immunity | Moderate | Low (short runs) | Excellent | Excellent |
| Protocol | ASCII frames | Register-mapped | Modbus RTU | USB CDC / ASCII |
| Power from Host | No | No | No | Yes (5V USB) |
| Driver Needed | No | No | No | No (Win10+/mac/Linux) |
| API Access | Full | Full | Full (via registers) | Full |
| SDI-12 (Pexla MX) | ✓ on TX pin | — | — | — |