ESP32 + Sensirion SDP810-500 Differential Pressure Sensor
Modbus TCP Slave + MQTT Publisher for Home Assistant
This project provides a practical solution for detecting HVAC air filter clogging using an ESP32 microcontroller and a Sensirion SDP810-500 differential pressure sensor. By measuring the pressure before and after the air filter, the system determines the pressure drop (ΔP). As the filter becomes dirty, air flow decreases → pressure drop increases → the system detects clogging.
This project exposes measured data via two simultaneous interfaces:
✅ Modbus TCP Slave — allowing any BAS/BMS controller to poll the device
✅ MQTT Publisher — reporting data to Home Assistant or any MQTT broker
The ESP32 works as:
- I²C master for the SDP810-500 sensor
- Modbus slave device on port 502
- MQTT sensor publisher
- Wi-Fi client
You can test Modbus functionality using Modpoll or any Modbus TCP client.
- Uses SDP810-500 for accurate low-range differential pressure readings
- Calculates pressure difference and outputs values in Pascals
- Includes CRC validation according to Sensirion protocol
- Slave address: 1
- Default port: 502
- Exposes holding registers containing sensor data
- Pollable from software like Modpoll, PLCs, BAS controllers, etc.
Registers map:
| Register | Meaning | Notes |
|---|---|---|
| 40001 (index 0) | Differential Pressure (Pa) | raw_dp/60 scaling |
| 40002 (index 1) | Temperature (°C) | raw_temp/200 scaling |
Publishes real-time pressure values to a Home Assistant MQTT broker:
Topic:
homeassistant/sensor/pressure
- Connects to local network
- Automatically reconnects if connection drops
- MQTT starts only after Wi-Fi IP assignment
- ESP32 development board
- Sensirion SDP810-500PA differential pressure sensor
- 3.3V power supply
- HVAC duct with two pressure sampling points
- Tubing for connecting sensor ports
| ESP32 Pin | SDP810 Pin | Description |
|---|---|---|
| 3.3V | VDD | Power |
| GND | GND | Ground |
| GPIO21 | SDA | I²C Data |
| GPIO22 | SCL | I²C Clock |
This project is written fully in ESP-IDF, using the following components:
esp_wifi— Wi-Fi STA modeesp_event, esp_netifesp_modbus_slave— official ESP-IDF Modbus controlleresp_mqtt_client— MQTT clientdriver/i2c.h— I²C driver for the SDP810 sensor- CRC8 implementation (Sensirion polynomial 0x31)
ESP32 sends continuous measurement command to SDP810 using I²C.
Data is read every 2 seconds and validated with CRC checks. Converted measurements are stored in the holding registers array.
Modbus controllers poll the registers over TCP.
Pressure value is formatted as a string and sent to the MQTT broker.
Compatible with Home Assistant auto-discovery.
Example command:
modpoll -m tcp -t 4:int -r 1 -c 2 192.168.x.xThis reads registers 40001–40002 from the ESP32.
- Pressure tube A connects to duct before the filter
- Pressure tube B connects to duct after the filter
- Clean filter → low pressure difference
- Dirty filter → ΔP rises significantly
- ESP32 reads ΔP and makes it available to:
- Home Assistant
- Any Modbus poller
- Automations can notify you when ΔP exceeds thresholds





