Skip to content

Example 40: BMP280 Pressure Sensor ​

Experiment Overview ​

BMP280 is a digital pressure/temperature sensor using I2C. FastBee includes the driver in the release baseline.

Note: This feature requires FASTBEE_ENABLE_I2C_SENSORS=1 and active i2cSensors.

Hardware Wiring ​

Board LabelGPIO PinConnected Device
SDAGPIO21BMP280 SDA
SCLGPIO22BMP280 SCL

BMP280 I2C address: SDO to GND = 0x76, SDO to VCC = 0x77.

JSON Configuration Example ​

json
{
  "peripherals": [
    {
      "id": "bmp280_01",
      "name": "BMP280 Barometer",
      "type": 38,
      "enabled": false,
      "pins": [21, 22],
      "params": {
        "category": "bmp280",
        "i2cAddress": "0x76"
      }
    }
  ]
}

Data Channels ​

ChannelField NameUnitDescription
0temperature°CAmbient temperature
1pressurehPaAtmospheric pressure
2altitudemEstimated altitude (based on standard pressure)

Peripheral Execution Linkage ​

Scenario: Pressure & Temperature Monitoring (Timer Trigger) ​

Feature: Periodically read BMP280 pressure and temperature data

Web UI Configuration Steps ​

Step 1: Create Rule

  1. Click Peripheral Execution in the left menu
  2. Click New Rule button
  3. Fill in basic configuration:
    • Rule Name: Pressure & Temperature Monitoring
    • Report Data: ✅ Enabled
    • Enable: ✅ Enabled

Step 2: Configure Trigger (Timer Trigger)

  1. Click Add Trigger button

  2. Fill in trigger configuration:

    FieldValueDescription
    Trigger TypeSelect Timer TriggerPeriodic collection
    Timer ModeSelect Fixed IntervalSecond interval
    Interval1010 seconds

Step 3: Configure Action (Sensor Read)

  1. Click Add Action button

  2. Fill in:

    • Action Type: Select Sensor Read
    • Target Peripheral: Select bmp280_01
    • Data Field: pressure (pressure)
  3. Click Save button

BMP280 Data Channels ​

ChannelField NameUnitDescription
0temperature°CAmbient temperature
1pressurehPaAtmospheric pressure (300-1100hPa)
2altitudemEstimated altitude (based on standard pressure)

Notes ​

  1. Firmware State: Confirm i2cSensors is compiled and active
  2. I2C Sharing: Can share bus with other I2C devices (SDA/SCL)
  3. Altitude Accuracy: Altitude estimation is based on standard pressure 1013.25hPa; actual calibration needed
  4. Sampling Interval: 5-10 seconds sampling recommended
  5. BME280 Compatible: BME280 (with humidity) uses the same address and basic protocol

FastBee | fastbee.cn