Particulate-Matter Node — Site (Pi-C, sensor_id=3)
A measurement node connecting the Plantower PMS7003 laser PM sensor to the Raspberry Pi over the primary UART (9600 8N1).
The sensor co-locates on an existing leak node and reports PM1.0/PM2.5/PM10 (ug/m3) every 10 minutes under the same
sensor_id as that node's leak sensor; high-PM2.5/PM10 threshold decisions and SMS dispatch are handled by the server.
Raspberry Pi 4 Model BBCM2711Raspberry Pi OS Bookworm 64-bitPlantower PMS7003UART /dev/serial09600 8N1metric_type=pms7003Report interval 10 min
240-Pin Header Pinmap Diagram Used pins highlighted · others in gray
GPIO15 (RXD). 3.3V logic — connects directly, no level shifter
RXD (command in)
Pi TXD → sensor
8
Optional — only for passive-mode/sleep commands. Active streaming needs only TXD
SET / RESET
—
n/c
Optional. Leave floating — internal pull-up keeps the sensor enabled/running
4Wiring Schematic sensor ↔ header
Active streaming mode uses only VCC · GND · sensor TXD → Pi RXD. The dashed Pi TXD → sensor RXD
line is optional (needed only to send passive-mode / sleep commands). The PMS7003 TXD is 3.3V logic,
so it wires directly to the Pi — no level shifter.
5Electrical Design · Cautions
Critical — power VCC from 5V, but NEVER wire the sensor TXD to a Pi 5V pin
The PMS7003 VCC must be 5V (pin 2 or 4) — its fan and laser will not run on 3.3V. However the
UART data lines are 3.3V logic: the sensor's TXD connects directly to the Pi RXD (pin 10).
Do not connect any 5V line to a GPIO — that would damage the 3.3V-only Pi GPIO. Double-check pin numbers before power-up.
Enable the UART: add enable_uart=1 to /boot/firmware/config.txt (Bookworm) or use raspi-config → Interface Options → Serial Port.
Disable the serial login console: answer "No" to the login-shell question in raspi-config, or remove console=serial0,115200 from cmdline.txt. Otherwise the console fights the sensor for /dev/serial0. install.sh does both automatically.
Port: the module reads /dev/serial0 (alias to the primary UART; also /dev/ttyS0 / /dev/ttyAMA0). 9600 baud, 8 data bits, no parity, 1 stop bit.
dialout group: the service user needs the dialout group to open /dev/serial0 (systemd unit sets SupplementaryGroups=dialout).
Warm-up: the PMS7003 needs a few seconds of fan/laser warm-up after power-on for stable readings; the driver simply reads until a valid checksummed frame arrives.
Role split: this node only reports PM1.0/PM2.5/PM10 every 10 minutes. High-PM2.5/PM10 threshold decisions and SMS dispatch are done by the server.
Config file:raspberry_pi4_pms7003/config.py (UART_PORT=/dev/serial0, UART_BAUD=9600). Per-device values (SENSOR_ID 1 vs 3) are overridden in config_local.py.
# Verify the UART device exists (symlink to ttyS0 / ttyAMA0)
$ ls -l /dev/serial0
lrwxrwxrwx 1 root root 5 ... /dev/serial0 -> ttyS0
6Installation Checklist
Do wiring work with power disconnected (no hot-plugging)
Connect VCC → physical pin 2 (5V) — the sensor fan/laser need 5V
Connect GND → physical pin 6 (or any other GND pin)
Connect sensor TXD → Pi RXD (pin 10, GPIO15) — this is the data line
(Optional) Pi TXD (pin 8) → sensor RXD, only if sending passive-mode commands