This bosch module implements a bosch BME280 environmental sensor, used for sensing temperature, humidity, and barometric pressure using the rdk:component:sensor
API.
Note
Before configuring your sensor, you must create a machine.
Navigate to the CONFIGURE tab of your machine in the Viam app. Add sensor / viam:bosch:bme280 to your machine.
On the new component panel, copy and paste the following attribute template into your sensors’s attributes field:
{
"i2c_bus": "<your-i2c-bus-index-on-board>",
"i2c_address": "<your-i2c-address>"
}
Note
For more information, see Configure a Machine.
The following attributes are available for viam:bosch:bme280
sensors:
Attribute | Type | Required? | Description |
---|---|---|---|
i2c_bus |
string | Required | The index of the I2C bus on the board that the sensor is wired to. |
i2c_address |
string | Optional | Default: 0x77 . The I2C device address of the sensor. |
{
"name": "<your-bosch-bme280-sensor-name>",
"model": "viam:bosch:bme280",
"type": "sensor",
"namespace": "rdk",
"attributes": {
"i2c_bus": "<your-i2c-bus-index-on-board>",
"i2c_address": "<your-i2c-address>"
},
"depends_on": []
}
- To test your sensor, expand the TEST section of its configuration pane or go to the CONTROL tab.
- To write code against your sensor, use one of the available SDKs.
- To view examples using a sensor component, explore these tutorials.