sensor-experiments

Introduction

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

Components Needed

No Ads Available.

Circuit Setup

  1. Connect all sensors to the Arduino according to the datasheets provided for each sensor.

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

Contact Us

If you have any questions or inquiries, feel free to reach out to us at Microautomation.no@icloud.com .

Follow our Socials for the newest updates!