Espruino and BMP280 example

58

BMP280 is an absolute barometric pressure sensor especially designed for mobile applications. The sensor module is housed in an extremely compact package. Its small dimensions and its low power consumption allow for the implementation in battery powered devices such as mobile phones, GPS modules or watches.
As its predecessor BMP180, BMP280 is based on Bosch’s proven Piezo-resistive pressure sensor technology featuring high accuracy and linearity as well as long term stability and high EMC robustness. Numerous device operation options offer highest flexibility to optimize the device regarding power consumption, resolution and filter performance. A tested set of default settings for example use case is provided to the developer in order to make design-in as easy as possible.

 

Applications
– Enhancement of GPS navigation (e.g. time-tofirst-fix improvement, dead-reckoning, slope detection)
– Indoor navigation (floor detection, elevator detection)
– Outdoor navigation, leisure and sports applications
– Weather forecast
– Health care applications (e.g. spirometry)
– Vertical velocity indication (e.g. rise/sink speed)
Schematics

 

 

 

Code

 

I2C1.setup({scl:B6,sda:B7});
var bme = require("BME280").connect(I2C1);
 
bme.readRawData();
 
var temp_cal = bme.calibration_T(bme.temp_raw);
var press_cal = bme.calibration_P(bme.pres_raw);
var temp_act = temp_cal / 100.0;
var press_act = press_cal / 100.0;
 
console.log("Pressure: " + press_act + " hPa");
console.log("Temperature: " + temp_act + " C");

 
Output

Pressure: 1016.73902477584 hPa
Temperature: 25.34128807298 C

 
Links

https://www.espruino.com/BMP280

1PCS BME280 Digital Sensor Temperature Humidity Barometric Pressure Sensor

Share