Interfacing Boche BME680

Hi,

I am trying the sample code in this regard. I have changed the I2C pins in the overllay file and bme register address to 0x77 as follows. It seems working but I have many questions.

&i2c0 {
	compatible = "nordic,nrf-twi";
	status = "okay";
	bme680: bme680@77 {
		compatible = "bosch,bme680";
		label = "BME680";
		reg = <0x77>;
	};
};

1. I think this is using the Zephyr built in bme680 driver, isn't it?

2. I am evaluating both BME680 and BME688.  How can I change code to suit BME688?

3. My case is a battery powered sensor, so I have to make it as much power efficient as possible. The sample program doesnt seem to meet that goal. I tried commenting out each channel and it doesn't seem that affect the power consumption.  I tried using 'sensor_sample_fetch_chan (dev, SENSOR_CHAN_AMBIENT_TEMP) just to fetch temp channel, but still same. Any idea why?

4. I want to read/write registers of the sensor, but Sensor API doesn't seem to provide any interface. How can I do  this?

Cheers,

Kaushalya

Parents
  • Hello, 

    Both sensors have been in use in our samples and prototyping platforms Thingy:53 and Thingy:91. What version of our SDK are you using? The information below is based on nRF Connect SDK v2.8.0.

    1. I think this is using the Zephyr built in bme680 driver, isn't it?

    Yes, looking at zephyr\boards\nordic\thingy53\thingy53_nrf5340_common.dtsi

    &i2c1 {
    	compatible = "nordic,nrf-twim";
    	status = "okay";
    	clock-frequency = <I2C_BITRATE_FAST>;
    
    	pinctrl-0 = <&i2c1_default>;
    	pinctrl-1 = <&i2c1_sleep>;
    	pinctrl-names = "default", "sleep";
    	bmm150: bmm150@10 {
    		compatible = "bosch,bmm150";
    		reg = <0x10>;
    	};
    
    	bh1749: bh1749@38 {
    		compatible = "rohm,bh1749";
    		reg = <0x38>;
    		int-gpios = <&gpio1 5 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    	};
    
    	bme688: bme688@76 {
    		compatible = "bosch,bme680";
    		reg = <0x76>;
    	};
    };

    2. I am evaluating both BME680 and BME688.  How can I change code to suit BME688?

    Have a the look at the BME68x: Gas sensor sample. This supports both sensors. You can also have a look the samples in our SDK that uses these sensors i.e. the sensor module in Asset Tracker v2 or the Bluetooth Mesh: sensor sample.

    3. My case is a battery powered sensor, so I have to make it as much power efficient as possible. The sample program doesnt seem to meet that goal. I tried commenting out each channel and it doesn't seem that affect the power consumption.  I tried using 'sensor_sample_fetch_chan (dev, SENSOR_CHAN_AMBIENT_TEMP) just to fetch temp channel, but still same. Any idea why?

    I'm not that familiar with the BME68x devices. What sample program are you referring to? The Sensors API in the Zephyr OS does have power management features
    There are options to set ultra low power using CONFIG_BME68X_IAQ_SAMPLE_RATE_ULTRA_LOW_POWER=y but I recommend looking through the BME68x driver documentation.

    4. I want to read/write registers of the sensor, but Sensor API doesn't seem to provide any interface. How can I do  this?

    I think you will need to look at the Sensor API 

    I hope this helps and provides some answers.

    Kind regards,
    Øyvind

  • Hi,

    Thanks for the reply.

    My SDK is 2.6.0.

    2. Unfortunately I cant find any driver like bme68x_irq under my 'drivers/sensor' folder. How can I install the bme68x driver code?

    3. I have managed to cut the power by turning off the heater for gas measurements. But I had to comment out the line 219 in bme680.c in 'drivers/sensor/bme680/'. The line is 

    __ASSERT_NO_MSG(chan == SENSOR_CHAN_ALL)
    This seems like the 'chan' variable has to be SENSOR_CHAN_ALL or otherwise a kernel panic would occur. I want to measure just temp and humidity channel. What is the reason for this _ASSERT ?
    Cheers,
    Kaushalya
Reply
  • Hi,

    Thanks for the reply.

    My SDK is 2.6.0.

    2. Unfortunately I cant find any driver like bme68x_irq under my 'drivers/sensor' folder. How can I install the bme68x driver code?

    3. I have managed to cut the power by turning off the heater for gas measurements. But I had to comment out the line 219 in bme680.c in 'drivers/sensor/bme680/'. The line is 

    __ASSERT_NO_MSG(chan == SENSOR_CHAN_ALL)
    This seems like the 'chan' variable has to be SENSOR_CHAN_ALL or otherwise a kernel panic would occur. I want to measure just temp and humidity channel. What is the reason for this _ASSERT ?
    Cheers,
    Kaushalya
Children
No Data
Related