Ramesh
Published © GPL3+

Arduino Nano Based Weather Monitor with Bluetooth HC-05

In this tutorial shows how to connect BMP280 barometric pressure, temperature and altitude sensor interface to Arduino Nano board with Bluet

IntermediateProtip2 hours1,853
Arduino Nano Based Weather Monitor with Bluetooth HC-05

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
Grove - Barometer Sensor (BMP280)
Seeed Studio Grove - Barometer Sensor (BMP280)
×1

Software apps and online services

MIT App Inventor
MIT App Inventor

Story

Read more

Schematics

Circuit diagram

Code

BMP280

Arduino
#include <Wire.h>

#include <SPI.h>

#include <Adafruit_BMP280.h>

Adafruit_BMP280 bmp; // I2C

Adafruit_Sensor *bmp_temp = bmp.getTemperatureSensor();

Adafruit_Sensor *bmp_pressure = bmp.getPressureSensor();

//Adafruit_BMP280 bmp(BMP_CS); // hardware SPI

//Adafruit_BMP280 bmp(BMP_CS, BMP_MOSI, BMP_MISO,  BMP_SCK);

void setup() {

  Serial.begin(9600);

   lcd.init();                      // initialize the lcd 

  // Print a message to the LCD.

  lcd.backlight();

  Serial.println(F("BMP280 test"));

  //if (!bmp.begin(BMP280_ADDRESS_ALT, BMP280_CHIPID)) {

  if (!bmp.begin()) {

    Serial.println(F("Could not find a valid BMP280 sensor, check wiring or "

                      "try a different address!"));

    while (1) delay(10);

  }

  /* Default settings from datasheet. */

  bmp.setSampling(Adafruit_BMP280::MODE_NORMAL,     /* Operating Mode. */

                  Adafruit_BMP280::SAMPLING_X2,     /* Temp. oversampling */

                  Adafruit_BMP280::SAMPLING_X16,    /* Pressure oversampling */

                  Adafruit_BMP280::FILTER_X16,      /* Filtering. */

                  Adafruit_BMP280::STANDBY_MS_500); /* Standby time. */

                    bmp_temp->printSensorDetails();

}

void loop() {

    sensors_event_t temp_event, pressure_event;

    bmp_temp->getEvent(&temp_event);

    bmp_pressure->getEvent(&pressure_event);

    

//    Serial.print(F("Temperature = "));

    Serial.print(bmp.readTemperature());

//    Serial.println("°C");

    Serial.print("|");

//    Serial.print(F("Pressure = "));

    Serial.print(pressure_event.pressure);

//    Serial.println(" hPa");

    Serial.print("|");

//    Serial.print(F("Approx altitude = "));

    Serial.print(bmp.readAltitude(1013.25)); /* Adjusted to local forecast! */

//    Serial.println(" m");

    Serial.print("\n");

    delay(1000);

   

}

Github

https://github.com/adafruit/Adafruit_BMP280_Library

Credits

Ramesh
15 projects • 19 followers

Comments