PROBLEMS WITH BME280 SENSORS

BME280 on breakout board

If you're struggling to connect up a BME280 sensor and get it going, here are some things to check:

1. I2C ADDRESS

The default I2C address is 0x77 but some third party devices may use 0x76 instead. Make sure your sketch is using the correct one. If you have copied a sketch from somewhere, and it looks like this:

#include <Adafruit_BME280.h>

.

Adafruit_BME280 bme;

Then somewhere you'll have a call to the bme.begin() function. You'll need to specify the I2C address as an argument in the call:

bme.begin(0x76);

To enable the interchangability of sensors with 0x76 and 0x77, you could add some code to look for a sensor on one address and if successful use it, otherwise use the other.

2. INTERMITTENT CONNECTIONS

A sensor returns an unexpected value or NaN. This problem may present itself as either transient or permanent and can be caused by a poor connection to ground or 3V3. To find the problem, move one of the connections to another equivalent pin or just reconnect both wires to a different set of ground and 3V3 pins. If you're using breadboard patch leads and the fault persists then it could be the leads themselves. If you replace the patch leads throw the old ones away or they will come back to haunt you.

3. SDA AND CLK CROSSED

It's easy to accidentally cross over the SDA and SCL leads - check that they're going to the correct pins. Also, not all similar sensors may have the pins in the same order.

4. INCORRECT SENSOR

Incredible as it may seem, or perhaps not on Ebay, are you actually using a BMP280 instead of a BME280? For example, the advertisement on Ebay below shows a BMP280 described as "Breakout Temperature Humidity Barometric Pressure" - it does not measure humidity! Also, a genuine BME280 costs more than £1.59.

Misleading advert on Ebay