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

ESP32-Based Smart Weather Station with BME280, BH1750, and OLED Display

View and Edit Project In Cirkit DesignerImage of ESP32-Based Smart Weather Station with BME280, BH1750, and OLED Display

Smart Weather Station Circuit Documentation

Summary

This document provides a detailed overview of a smart weather station circuit. The circuit integrates various sensors and an OLED display to measure and display environmental parameters such as temperature, humidity, pressure, and light intensity. The core of the circuit is an ESP32 microcontroller, which interfaces with a BME280 sensor, a BH1750 sensor, a wind vane, a rain sensor, a soil moisture sensor, and a 0.96" OLED display. Additionally, the circuit includes a relay module to control a pump and a solenoid valve.

Component List

  1. BME/BMP280

    • Description: Sensor for measuring temperature, humidity, and pressure.
    • Pins: GND, SCL, SDA, VIN
  2. Wind Vane

    • Description: Sensor for measuring wind direction.
    • Pins: A0, VCC, GND
  3. 0.96" OLED

    • Description: Display for showing sensor readings.
    • Pins: GND, VDD, SCK, SDA
  4. BH1750

    • Description: Sensor for measuring light intensity.
    • Pins: VCC, GND, SCL, SDA, ADDR
  5. ESP32 (30 pin)

    • Description: Microcontroller for processing sensor data and controlling the display.
    • Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, Vin, D23, D22, TX0, RX0, D21, D19, D18, D5, TX2, RX2, D4, D2, D15, 3V3
  6. Soil Moisture Sensor

    • Description: Sensor for measuring soil moisture.
    • Pins: positive, negative
  7. 5v 2-Relay JD-VCC

    • Description: Relay module for controlling external devices like a pump and solenoid valve.
    • Pins: JD-VCC, VCC, GND, IN1, IN2, NO, COM, NC
  8. Pump

    • Description: Device for pumping water.
    • Pins: +, -
  9. Plastic Solenoid Valve

    • Description: Valve for controlling water flow.
    • Pins: pin1, pin2
  10. Battery 12v

    • Description: Power source for the circuit.
    • Pins: +, -
  11. 5v Battery

    • Description: Power source for the relay module.
    • Pins: positive, negative
  12. Rain Sensor

    • Description: Sensor for detecting rain.
    • Pins: AO, DO, GRD, VCC
  13. TP4056

    • Description: Battery charging module.
    • Pins: OUT-, B-, B+, OUT+, IN-, IN+
  14. Solar Panel

    • Description: Power source for charging the battery.
    • Pins: +, -
  15. Soil Moisture Module

    • Description: Module for interfacing with the soil moisture sensor.
    • Pins: positive, negative, Analog, Digital, Ground, VCC

Wiring Details

BME/BMP280

Wind Vane

0.96" OLED

BH1750

ESP32 (30 pin)

Soil Moisture Sensor

5v 2-Relay JD-VCC

Pump

Plastic Solenoid Valve

Battery 12v

5v Battery

Rain Sensor

TP4056

Solar Panel

Soil Moisture Module

Code Documentation

/*
 * Smart Weather Station
 * This Arduino sketch interfaces with a BME280 sensor, BH1750 sensor, and an
 * OLED display to create a smart weather station. The BME280 sensor measures
 * temperature, humidity, and pressure. The BH1750 sensor measures light
 * intensity. The OLED display shows the sensor readings.
 */

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include <Adafruit_GFX