Tag Archives: BME280

BME280 Sensor Box of Tricks

bme280Temperature, humidity and pressure readings in one chip? Certainly! The BME280.

I’ve recently spent more time than I care to think, trying to get a BME280 driver to work – finally done it by adapting some work from this fellow (Cosmin Plasoianu) who’s code is good but was out of date for the current Espressif SDK and also referred to another chip as so many bits of code do – the BMP280.

So what’s the difference? Well, the BMP280 is a modern temperature + atmospheric pressure chip – but it does NOT do what the lovely BME280 does – and that is humidity. In other words it can form a replacement for the DHT22 as long as you don’t mind using another wire (i2c). It responds quickly and is relatively accurate. The BME280 is also on a different I2c address to the BMP280.  Anyway – all SORTED.

It is not cheap at nearly £4 but adding in pressure lets you do all sorts of weather-predicting stuff!  As usual I limit accuracy to the nearest degrees C or percentage humidity because while seeing decimal points looks good  – the ultimate accuracy does not warrant it.

I’ve updated the manual {temp_type:3}  – and this uses i2c. The new command assuming GPIO4 and 5 are used for I2c and assuming there are pull-ups in use  – this  fills in the variables temperature, pressure and humidity which can be accessed as {temperature?} {pressure} and {humidity} as normal and are also generated automatically – see manual.

One more success for Home Control 2016.