This project implements a Matter-compatible pressure and temperature sensor using an ESP32 microcontroller and the BMP280 sensor. The firmware integrates the BMP280 driver with ESP-Matter to enable seamless communication over the Matter protocol.
- ESP32-DevKitM-1 or ESP32-H2 board
- BMP280 Pressure and Temperature Sensor Module
- Breadboard and connecting wires
- 3.3V power supply
- Ubuntu 24.04 or 24.10
- ESP-IDF 5.2.3 (newer versions should be tested)
- ESP-Matter 1.3 (newer versions should be tested)
Step 1. Install Prerequisites for ESP-IDF:
sudo apt-get install git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
Step 2. Get ESP-IDF:
mkdir -p ~/esp
cd ~/esp
git clone -b v5.2.3 --recursive https://github.com/espressif/esp-idf.git
Step 3. Set up the Tools:
cd ~/esp/esp-idf
./install.sh all
Step 4. Configure Environment Variables:
alias get_idf='. $HOME/esp/esp-idf/export.sh'
Add this line to ~/.bashrc
to persist the alias.
Step 5. Refresh Configuration:
source ~/.bashrc
Running get_idf
will now set up or refresh the esp-idf environment in any terminal session.
Step 1. Install Prerequisites for Matter:
sudo apt-get install git gcc g++ pkg-config libssl-dev libdbus-1-dev libglib2.0-dev libavahi-client-dev ninja-build python3-venv python3-dev python3-pip unzip libgirepository1.0-dev libcairo2-dev libreadline-dev
Step 2. Clone the esp-matter Repository:
cd ~/esp/
git clone -b release/v1.3 --recursive https://github.com/espressif/esp-matter.git
Step 3. Bootstrap esp-matter:
cd esp-matter
./install.sh
Step 4. Configure Environment Variables:
alias get_matter='. $HOME/esp/esp-matter/export.sh'
Add this line to ~/.bashrc
to persist the alias.
Step 5. Refresh Configuration:
source ~/.bashrc
Running get_matter
will now set up or refresh the esp-matter environment in any terminal session.
To connect the BMP280 sensor to the ESP32, use the following wiring instructions:
BMP280 Pin | ESP32 Pin |
---|---|
VCC | 3.3V |
GND | GND |
SDA | GPIO21 |
SCL | GPIO22 |
SDO | GND |
- Ensure that the VCC pin of the BMP280 is connected to the 3.3V pin of the ESP32 to avoid overvoltage damage.
- The SDO pin of the BMP280 should be connected to GND for an I2C address of
0x76
.
git clone https://github.com/<your-repo>/matter-bmp280.git
cd matter-bmp280
Use menuconfig
to configure project-specific settings:
idf.py menuconfig
- Set the I2C GPIO pins to match your wiring (SDA: GPIO21, SCL: GPIO22).
- Enable or disable features like CHIP Shell or OTA based on your requirements.
idf.py set-target esp32
idf.py build
Connect the ESP32 board to the computer and check under which serial port the board is visible. Serial ports typically follow the /dev/tty
pattern.
idf.py -p <PORT> flash
idf.py -p <PORT> monitor
Press CTRL+]
to exit.
This project is licensed under the MIT License. See the LICENSE
file for details.