derapados
Published © CC0

Weather Station v.1.0

First version of basic Home Weather Station.

IntermediateShowcase (no instructions)26,285
Weather Station v.1.0

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
BOSCH BME/BMP280
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1
Resistor 4.75k ohm
Resistor 4.75k ohm
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

WeatherStation1.0

Schematic and code

Code

WeatherBase1.0

Arduino
/* ------------------------------------------------------------------------------- */
// Weather Station v1.0
// Andrea Martignoni
// martignoni.a@gmail.com

#include <LiquidCrystal.h> //Liquid Cristal Mgt Lib
#include <Wire.h> //Management of wire connections
#include "cactus_io_BME280_I2C.h" //Manage BME280 temp, humidity, pressure sensor


// Connections for LCD:
// rs (LCD pin 4) to Arduino pin 12
// rw (LCD pin 5) to Arduino pin 11
// enable (LCD pin 6) to Arduino pin 10
// LCD pin 15 to Arduino pin 13
// LCD pins d4, d5, d6, d7 to Arduino pins 5, 4, 3, 2
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2); //Define PINs LCD
// Create the BME280 object
//BME280_I2C bme;              // I2C using default 0x77 
BME280_I2C bme(0x76);  // I2C using address 0x76

int backLight = 13;    // pin 13 will control the backlight managed by button


void setup()
{
  pinMode(backLight, OUTPUT); //Define output mode
  Serial.begin(9600); //Serial communication 9600

  digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
  lcd.begin(16,2);              // columns, rows.  16X2LCD
  lcd.clear();                  // start with a blank screen
  lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
  lcd.print("Temperatura Sensore");    //Starting text row 1
  lcd.setCursor(0,1);           // set cursor to column 0, row 1
  lcd.print("XY Celsius");      //starting text row 2
  

  if (!bme.begin()) {           //Check if BME280 is connected and working
    Serial.println("Could not find a valid BME280 sensor, check wiring!");
    while (1);
  }

  bme.setTempCal(-1);           //Claibrate BME280 sensor
 
  
}


void loop()                     //Main looping code
{
 
  lcd.clear();                                                            //Clear LCD
  bme.readSensor();                                                       //Read Sensor
  lcd.setCursor(0,0);                                                     //Position on row 1
  lcd.print("P:"); lcd.print(bme.getPressure_MB());                       //Send to LCD row 1 Pressure in millibars
  lcd.print(" H:"); lcd.print(bme.getHumidity());                         //Send to LCD row 1 Humidity in millipascals
  lcd.setCursor(0,1);                                                     //Position on row 1
  lcd.print("T:"); lcd.print(bme.getTemperature_C()); lcd.print("C");     //Send to LCD row 2 Temperature in C
  lcd.print(" T:"); lcd.print(bme.getTemperature_F()); lcd.println("F");  //Send to LCD row 2 Temperature in F
 
  delay(1000);                                                            //just here to slow down the output so it is easier to read
}


/* ------------------------------------------------------------------------------- */

Credits

derapados

derapados

3 projects • 30 followers
https://www.linkedin.com/in/andreamartignoni/

Comments