{
  "metadata": {
    "id": "adafruit-bme280",
    "name": "BME280 Environmental Sensor Breakout",
    "type": "sensor",
    "description": "Bosch BME280 sensor breakout for temperature, humidity, and barometric pressure. Measures humidity (±3% accuracy), pressure (±1 hPa), and temperature (±1.0°C). Supports I2C and SPI communication. Onboard 3.3V regulator and level shifting allow 3-5V supply and logic compatibility, making it easy to use with Arduino (5V) or Raspberry Pi (3.3V).",
    "manufacturer": "Adafruit",
    "part_number": "2652",
    "datasheet_url": "https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme280-ds002.pdf",
    "tags": [
      "sensor",
      "environmental",
      "temperature",
      "humidity",
      "pressure",
      "barometric",
      "BME280",
      "I2C",
      "SPI",
      "Bosch"
    ],
    "schema_version": "1.4.0",
    "version": "0.2.0",
    "taxonomy": [
      "sensor.environmental",
      "expansion.breakout"
    ]
  },
  "domains": [
    {
      "domain": "electrical",
      "power_domains": [
        {
          "id": "vin",
          "name": "Vin (Input)",
          "nominal_voltage_V": 5,
          "voltage_range_V": [
            3,
            5.5
          ],
          "voltage_tolerance_percent": 5,
          "max_current_mA": 150,
          "regulation_type": "unregulated",
          "isolation_type": "non_isolated",
          "ground_reference": "common",
          "description": "Main power input to onboard regulator (3-5V logic supply input)"
        },
        {
          "id": "3v3",
          "name": "Regulated 3.3V",
          "nominal_voltage_V": 3.3,
          "voltage_range_V": [
            3.2,
            3.4
          ],
          "voltage_tolerance_percent": 5,
          "max_current_mA": 100,
          "regulation_type": "regulated",
          "isolation_type": "non_isolated",
          "ground_reference": "common",
          "compatible_domains": [
            "vin"
          ],
          "description": "Onboard regulated 3.3V supply for sensor and low-power external use (up to 100 mA)"
        }
      ],
      "resources": [
        {
          "id": "vin_pin",
          "functions": [
            {
              "name": "power_input"
            }
          ],
          "connector_type": "pin",
          "power_domain_id": "vin",
          "description": "Vin power input pin (3-5V input to regulator)"
        },
        {
          "id": "3v3_out",
          "functions": [
            {
              "name": "power_output"
            }
          ],
          "connector_type": "pin",
          "power_domain_id": "3v3",
          "voltage_output_V": 3.3,
          "max_continuous_current_mA": 100,
          "description": "3.3V output from onboard regulator (for sensor and up to 100 mA for external devices)"
        },
        {
          "id": "gnd",
          "functions": [
            {
              "name": "ground"
            }
          ],
          "connector_type": "pin",
          "power_domain_id": "vin",
          "description": "Ground pin (common reference)"
        },
        {
          "id": "sck",
          "functions": [
            {
              "name": "i2c_scl"
            },
            {
              "name": "spi_sck"
            }
          ],
          "connector_type": "pin",
          "power_domain_id": "vin",
          "description": "Clock pin for I2C (SCL) or SPI (SCK) - input to sensor"
        },
        {
          "id": "sdi",
          "functions": [
            {
              "name": "i2c_sda"
            },
            {
              "name": "spi_mosi"
            }
          ],
          "connector_type": "pin",
          "power_domain_id": "vin",
          "description": "Data pin for I2C (SDA) or SPI (SDI/MOSI) - input to sensor"
        },
        {
          "id": "sdo",
          "functions": [
            {
              "name": "spi_miso"
            }
          ],
          "connector_type": "pin",
          "power_domain_id": "vin",
          "description": "SPI MISO output from sensor. (Also used to set I2C address when tied to ground for 0x76 address)"
        },
        {
          "id": "cs",
          "functions": [
            {
              "name": "spi_ss"
            }
          ],
          "connector_type": "pin",
          "power_domain_id": "vin",
          "description": "Chip Select pin for SPI (active low, tie high or leave unconnected in I2C mode)"
        }
      ],
      "interfaces": [
        {
          "id": "power_input",
          "protocol": {
            "type": "power",
            "role": "input"
          },
          "requires": [
            {
              "function": "power_input",
              "count": 1
            },
            {
              "function": "ground",
              "count": 1
            }
          ],
          "max_instances": 1,
          "description": "Primary power input interface (to supply Vin and ground)",
          "name": "Power Input"
        },
        {
          "id": "power_output",
          "protocol": {
            "type": "power",
            "role": "output"
          },
          "requires": [
            {
              "function": "power_output",
              "count": 1
            },
            {
              "function": "ground",
              "count": 1
            }
          ],
          "constraints": {
            "max_connections": 4,
            "requires_matching_voltage_domain": false
          },
          "power_delivery": {
            "max_voltage_V": 3.3,
            "max_current_mA": 100,
            "regulation_tolerance_percent": 5,
            "ripple_voltage_mV": 50
          },
          "description": "3.3V regulated power output interface (for powering external sensors up to 100 mA)",
          "name": "Power Output"
        },
        {
          "id": "i2c_slave",
          "protocol": {
            "type": "i2c",
            "role": "slave"
          },
          "requires": [
            {
              "function": "i2c_sda",
              "count": 1
            },
            {
              "function": "i2c_scl",
              "count": 1
            }
          ],
          "exclusive": false,
          "protocol_max_freq_Hz": 3400000,
          "constraints": {
            "requires_matching_voltage_domain": true
          },
          "description": "I2C communication interface (slave mode, default address 0x77 or 0x76 selectable)",
          "name": "I2C Slave"
        },
        {
          "id": "spi_slave",
          "protocol": {
            "type": "spi",
            "role": "slave"
          },
          "requires": [
            {
              "function": "spi_mosi",
              "count": 1
            },
            {
              "function": "spi_miso",
              "count": 1
            },
            {
              "function": "spi_sck",
              "count": 1
            },
            {
              "function": "spi_ss",
              "count": 1
            }
          ],
          "exclusive": false,
          "protocol_max_freq_Hz": 10000000,
          "constraints": {
            "requires_matching_voltage_domain": true
          },
          "description": "SPI communication interface (slave mode, up to 10 MHz clock)",
          "name": "SPI Slave"
        }
      ],
      "supply_voltage_V": [
        3,
        5.5
      ],
      "power_consumption_mW": 3,
      "pin_count": 8
    },
    {
      "domain": "mechanical",
      "resources": [
        {
          "id": "mount_hole_1",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ],
          "connector_type": "through_hole",
          "hole_diameter_mm": 2.5,
          "thread_spec": "M2",
          "max_force_N": 20,
          "description": "Mounting hole (likely fits M2 screw)"
        },
        {
          "id": "mount_hole_2",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ],
          "connector_type": "through_hole",
          "hole_diameter_mm": 2.5,
          "thread_spec": "M2",
          "max_force_N": 20,
          "description": "Mounting hole (likely fits M2 screw)"
        }
      ],
      "interfaces": [
        {
          "id": "module_mount",
          "protocol": {
            "type": "threaded_connection",
            "role": "mounting_point"
          },
          "requires": [
            {
              "function": "mounting_hole",
              "count": 2
            }
          ],
          "connection_type": "removable",
          "description": "Module mounting interface (use two screws to secure the breakout)",
          "name": "PCB Mounting"
        }
      ],
      "package_type": "PCB Module",
      "dimensions_mm": {
        "length": 25.2,
        "width": 18,
        "height": 4.6
      },
      "weight_g": 3
    },
    {
      "domain": "thermal",
      "resources": [],
      "interfaces": [],
      "operating_temperature_C": [
        -40,
        85
      ],
      "metadata": {
        "thermal_design_power_W": 0.01,
        "requires_thermal_management": false,
        "thermal_monitoring_available": false,
        "cooling_method": "passive"
      }
    }
  ],
  "design_rules": [
    "Use either I2C or SPI interface at a time (do not connect both protocols simultaneously).",
    "If using multiple BME280 sensors on one I2C bus, ensure each has a unique address (default 0x77, alternative 0x76 by tying SDO to ground).",
    "Keep the sensor away from direct heat sources or sunlight to maintain measurement accuracy.",
    "Do not expose the sensor to condensing humidity or water; it is not waterproof.",
    "Do not exceed 5.5V on the Vin pin (over-voltage can damage the regulator and sensor).",
    "Ensure adequate I2C pull-up resistors are present on SDA/SCL (this breakout includes ~10k pull-ups by default)."
  ],
  "validation_requirements": [
    "Verify that the power supply connected to Vin is between 3.0V and 5.5V.",
    "Check that either the I2C or SPI interface is used, but not both at the same time, to avoid bus contention.",
    "Ensure the microcontroller's logic level is compatible (3.3V or 5V logic are both supported by the breakout).",
    "Validate that all ground connections are common between the sensor and the microcontroller to ensure proper communication.",
    "If multiple I2C devices are on the bus, confirm that the BME280 address does not conflict (change to 0x76 if needed).",
    "For SPI usage, verify that CS is properly controlled (pulled high when not actively communicating to avoid interference on the bus)."
  ],
  "usage_notes": "The BME280 breakout is an easy-to-use environmental sensor for measuring temperature, humidity, and pressure/altitude. It integrates a regulator and level shifters, so it can be directly connected to 5V Arduino boards or 3.3V boards like Raspberry Pi. Many libraries (Adafruit, SparkFun, etc.) are available to get readings quickly. It's low-power, making it suitable for battery-powered weather stations or IoT sensors. For best results, place the sensor in open air flow and away from heat-generating components.",
  "application_examples": [
    "Indoor weather station or environmental monitor",
    "Altitude measurement for a GPS logger or drone (using pressure)",
    "HVAC system humidity/temperature sensor",
    "IoT climate sensor node sending data to the cloud",
    "Smart home device monitoring room comfort levels"
  ],
  "compatibility_notes": "Compatible with virtually any microcontroller that has I2C (Wire) or SPI. Works at 3.3V and 5V logic. For Arduino Uno/ESP8266/ESP32, use I2C or SPI libraries (address 0x77 default). For Raspberry Pi or BeagleBone, use the I2C interface (with 3.3V supply). Multiple BME280 sensors can share an I2C bus if one is set to the alternate address 0x76.",
  "warnings": [
    "If powering from 5V, the sensor will run slightly warmer (due to regulator) which can raise the reported temperature by a small amount.",
    "Avoid placing the BME280 in direct contact with wet conditions; prolonged high humidity may require reconditioning the sensor to maintain accuracy.",
    "When using long wires for I2C, ensure proper pull-ups and possibly shielded cable to avoid signal noise.",
    "Do not draw more than 100 mA from the 3Vo pin; it's intended for low-power sensors and could overheat the regulator if overloaded."
  ]
}