Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO WiFi Weather Station with AHT10 Sensor and Rain/Wind Detection

View and Edit Project In Cirkit DesignerImage of Arduino UNO WiFi Weather Station with AHT10 Sensor and Rain/Wind Detection

Circuit Documentation

Summary

This circuit is designed to measure environmental parameters such as temperature, humidity, rainfall, and wind speed. It utilizes an Arduino UNO with WiFi R3 ATmega328P+Node MCU ESP8266 as the central microcontroller to interface with various sensors including the AHT10 for temperature and humidity, a rain sensor for detecting rainfall, and a wind vane for measuring wind speed. The circuit is powered by a Lipo Battery, which is regulated by an XL4015 5A DC Buck Step-down module. A rocker switch is included to control the power supply to the circuit.

Component List

Arduino UNO+WiFi R3 ATmega328P+Node MCU ESP8266

XL4015 5A DC Buck Step-down

Lipo Battery

RAIN SENSOR

Wind Vane

Rocker Switch

AHT10

Wiring Details

Arduino UNO+WiFi R3 ATmega328P+Node MCU ESP8266

XL4015 5A DC Buck Step-down

Lipo Battery

RAIN SENSOR

Wind Vane

Rocker Switch

AHT10

Documented Code

/*
 * This Arduino Sketch measures temperature, humidity, rainfall, and windspeed
 * using various sensors connected to an Arduino UNO with WiFi R3 ATmega328P+Node MCU ESP8266.
 * The sensors used are AHT10 for temperature and humidity, a rain sensor for rainfall,
 * and a wind vane for windspeed.
 */

#include <Wire.h>
#include <Adafruit_AHTX0.h>

Adafruit_AHTX0 aht;

const int rainSensorPin = A1; // Rain sensor connected to A1
const int windVanePin = A0;  // Wind vane connected to A0

void setup() {
  Serial.begin(9600);
  if (!aht.begin()) {
    Serial.println("Could not find AHT10 sensor!");
    while (1) delay(10);
  }
  pinMode(rainSensorPin, INPUT);
  pinMode(windVanePin, INPUT);
}

void loop() {
  sensors_event_t humidity, temp;
  aht.getEvent(&humidity, &temp);

  int rainValue = analogRead(rainSensorPin);
  int windValue = analogRead(windVanePin);

  Serial.print("Temperature: ");
  Serial.print(temp.temperature);
  Serial.println(" degrees C");

  Serial.print("Humidity: ");
  Serial.print(humidity.relative_humidity);
  Serial.println("%");

  Serial.print("Rainfall: ");
  Serial.print(rainValue);
  Serial.println(" (analog value)");

  Serial.print("Windspeed: ");
  Serial.print(windValue);
  Serial.println(" (analog value)");

  delay(2000); // Wait for 2 seconds before next reading
}

This code initializes the AHT10 sensor and reads the analog values from the rain sensor and wind vane. It then prints the temperature, humidity, rainfall, and windspeed to the serial monitor every two seconds.