Introduction
If you want to build your own temperature monitoring system or measure the altitude of a drone, or just want to measure the atmospheric pressure in your area, then one of the best modules to use in your project is the BMP280 Pressure Sensor Module. BMP280 is an absolute pressure and temperature monitoring sensor, which is an upgraded version of BMP085, BMP180 and BMP183 sensors. Why is it called an upgraded version? It will be discussed in the following sections.
The BMP280 sensor module can be used with microcontrollers such as Arduino, PIC, AVR, etc. For this project we will use Arduino Uno and BMP280 along with LCD 16x2 display module to display temperature and pressure values. Before connecting the BMP280 with Arduino, we need to download the BMP280 Arduino library developed by Adafruit.
Supply Part
Arduino
BMP280
Connect wires
Breadboard
LCD monitor - 16x2
Circuit Diagram Connecting BMP280 to Arduino
Arduino Program to Connect BMP280 With Arduino
#include
#include
#include
#include
Adafruit_BMP280 bmp; // I2C
//Adafruit_BMP280 bmp(BMP_CS); //Hardware SPI
//Adafruit_BMP280 bmp(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK);
LCD LCD (9, 8, 5, 4, 3, 2);
void settings() {
lcd.begin(16,2);
SerialNumber.Start(9600);
Serial.println(F("BMP280 Test"));
lcd.print("Welcome");
lcd.setCursor(0,1);
lcd.print("Circuit Digest");
delay(1000);
lcd.clear();
if (!bmp.begin()) {
Serial.println(F("No valid BMP280 sensor found, check the wiring!"));
And (1);
}
/* Default settings from data table. */
bmp.setSampling(Adafruit_BMP280::MODE_NORMAL, /* Operating mode.*/
Adafruit_BMP280::SAMPLING_X2, /* Temperature oversampling */
Adafruit_BMP280::SAMPLING_X16, /* pressure oversampling */
Adafruit_BMP280::FILTER_X16, /* Filter. */
Adafruit_BMP280::STANDBY_MS_500); /* Standby time. */
}
void loop() {
Serial.print(F("Temperature = "));
Serial.print(bmp.readTemperature());
Serial.println("*C");
lcd.setCursor(0,0);
lcd.print("temperature = ");
lcd.print(bmp.readTemperature());
Serial.print(F("Pressure = "));
Serial.print(bmp.readPressure());
Serial.println("Pa");
lcd.setCursor(0,1);
lcd.print("press=");
lcd.print(bmp.readPressure());
Serial.print(F("Approximate height = "));
Serial.print(bmp.readAltitude(1018)); /* Adjust to local prediction! */
Serial.println("m");
Serial number.println();
Delay (2000);
}