Hackster is hosting Hackster Holidays, Finale: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Tuesday!Stream Hackster Holidays, Finale on Tuesday!
Lisleapex Blog
Published © CC BY-SA

How to Connect BMP280 Pressure Sensor Module With Arduino

For this project we will use Arduino Uno and BMP280 along with LCD 16x2 display module to display temperature and pressure values.

BeginnerWork in progress1.5 hours298
How to Connect BMP280 Pressure Sensor Module With Arduino

Things used in this project

Story

Read more

Schematics

circuit_diagram_connecting_bmp280_to_arduino_GeT4atL7Vh.png

Code

Untitled file

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);



}

Credits

Lisleapex Blog
24 projects • 0 followers
Fast Delivery of High-Quality Electronic Components

Comments