Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Weather Monitoring with Arduino
Introduction: Weather monitoring is an essential aspect of many applications, including agriculture, environmental research, and smart homes. By using Arduino, we can easily create a weather monitoring system that can measure temperature, humidity, and atmospheric pressure. In this article, we will explore the importance of weather monitoring and provide an instructive example project using Arduino.
Project: The project aims to create a weather monitoring system that can measure temperature, humidity, and atmospheric pressure and display the data on an LCD screen. The system will be equipped with a DHT11 sensor for temperature and humidity measurement, a BMP180 sensor for atmospheric pressure measurement, and an LCD screen for data visualization. The objective is to provide real-time weather information for various applications.
List of Components:
Examples: Example 1: Temperature and Humidity Measurement
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
dht.begin();
}
void loop() {
float temperature = dht.readTemperature();
float humidity = dht.readHumidity();
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.print(" °C, Humidity: ");
Serial.print(humidity);
Serial.println(" %");
delay(2000);
}
Example 2: Atmospheric Pressure Measurement
#include <Wire.h>
#include <Adafruit_BMP085.h>
Adafruit_BMP085 bmp;
void setup() {
Serial.begin(9600);
if (!bmp.begin()) {
Serial.println("Could not find a valid BMP085 sensor, check wiring!");
while (1);
}
}
void loop() {
float pressure = bmp.readPressure() / 100.0;
Serial.print("Pressure: ");
Serial.print(pressure);
Serial.println(" hPa");
delay(2000);
}
Example 3: Weather Monitoring System
#include <DHT.h>
#include <Wire.h>
#include <Adafruit_BMP085.h>
#include <LiquidCrystal_I2C.h>
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
Adafruit_BMP085 bmp;
LiquidCrystal_I2C lcd(0x27, 16, 2); // Change the address if necessary
void setup() {
Serial.begin(9600);
dht.begin();
if (!bmp.begin()) {
Serial.println("Could not find a valid BMP085 sensor, check wiring!");
while (1);
}
lcd.begin(16, 2);
lcd.print("Weather Monitor");
}
void loop() {
float temperature = dht.readTemperature();
float humidity = dht.readHumidity();
float pressure = bmp.readPressure() / 100.0;
lcd.setCursor(0, 1);
lcd.print("Temp: ");
lcd.print(temperature);
lcd.print("C Hum: ");
lcd.print(humidity);
lcd.print("% Press: ");
lcd.print(pressure);
lcd.print("hPa");
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.print(" °C, Humidity: ");
Serial.print(humidity);
Serial.print(" %, Pressure: ");
Serial.print(pressure);
Serial.println(" hPa");
delay(2000);
}