Weather Station with Multiple Sensors

Introduction

This experiment demonstrates how to build a weather station using sensors for temperature, humidity, pressure, and other environmental parameters.

Weather Station Sensors

Components Needed

Circuit Setup

  1. Connect all sensors to the Arduino according to the datasheets provided for each sensor.
Weather Station Circuit Setup

Code for Weather Station

Upload the following code to your Arduino to collect data from the weather sensors:


#include 
#include 
#include 

Adafruit_BME280 bme;

void setup() {
  Serial.begin(9600);
  if (!bme.begin()) {
    Serial.println("Could not find a valid BME280 sensor, check wiring!");
    while (1);
  }
}

void loop() {
  float temperature = bme.readTemperature();
  float humidity = bme.readHumidity();
  float pressure = bme.readPressure() / 100.0F;

  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.print(" °C");
  Serial.print(" Humidity: ");
  Serial.print(humidity);
  Serial.print(" %");
  Serial.print(" Pressure: ");
  Serial.print(pressure);
  Serial.println(" hPa");

  delay(2000);
}
            

Explanation

The weather station uses sensors to read environmental data, such as temperature, humidity, and air pressure. The data is then displayed on the Serial Monitor.

Troubleshooting