By Ashish Rana
This project is an IoT-based weather station tailored for farmers to monitor their fields remotely. It collects comprehensive environmental data from Home, including wind speed, wind direction, temperature, humidity, pressure, gas levels, altitude, and rainfall. Using a BME680 sensor and other specialized sensors, all data is captured by the ESP32-Wroom module. Through Wi-Fi connectivity, the data is transmitted to the ThingSpeak server. The ESP32-S3 box at the farmer’s Home location then retrieves this data using ThingSpeak’s read API and displays it on the screen, providing real-time insights into the field conditions.
Problem Overview
Most farmers still rely on approximate weather forecasts or nearby weather stations that do not represent the actual conditions of their fields. Due to the lack of real-time, field-level weather data, farmers face difficulties in making correct farming decisions.
Key Problems:
- Lack of accurate local weather monitoring
- Inefficient irrigation planning, leading to water and power wastage
- Sudden weather changes causing crop damage
- Incorrect timing of fertilizer and pesticide application
- Late detection of crop diseases caused by high humidity
- High-cost and complex weather monitoring systems are not affordable for small farmers
- As a result, farmers experience reduced crop yield, higher operational costs, and financial losses.
Circuit Diagram
Circuit Connection:

1 BME680 Sensor:
- VCC (Vin) is connected to the ESP32’s 5V pin.
- GND is connected to the ESP32’s ground.
- SCL is connected to GPIO22 on the ESP32.
- SDA is connected to GPIO21 on the ESP32.
2 Wind Speed Sensor:
- Positive wire is connected to the ESP32’s 3.3V pin.
- Ground is connected to the ESP32’s ground.
- Signal wire is connected to GPIO27 on the ESP32.
3 Wind Direction Sensor:
- Positive wire is connected to the ESP32’s 3.3V pin.
- Ground is connected to the ESP32’s ground.
- Signal wire is connected to GPIO34 on the ESP32.
4 Gravity Rain Bucket Sensor:
- Positive wire is connected to the ESP32’s 3.3V pin.
- Ground is connected to the ESP32’s ground.
- TX is connected to GPIO16 on the ESP32.
- RX is connected to GPIO17 on the ESP32.
5 Power Supply and Boosting:
- A TP4056 module is used for charging the LiPo 3.3V battery.
- The output from the TP4056 is then fed into an MT3608 boost converter, which increases the voltage to 5V to power the ESP32.
Hardware Assembly
First, I designed and prepared the ground station unit that would be installed directly in the field for real-time environmental data collection. For this purpose, I used a zero PCB and carefully assembled all the required hardware components using an ESP32 microcontroller. Multiple sensors, including wind speed sensor, wind direction sensor, rainfall sensor, and the BME680 sensor for temperature, humidity, pressure, and air quality measurement, were integrated into the system.
All components were soldered securely onto the PCB using a soldering iron to ensure proper electrical connections and long-term reliability. After completing the circuitry, I mounted the sensors on an acrylic sheet to provide mechanical support and protection. This acrylic sheet was then fixed onto a sturdy tripod stand, allowing the sensors to be positioned at an appropriate height for accurate measurements.
This complete assembly resulted in a compact, stable, and weather-ready ground station setup suitable for installation in agricultural fields and outdoor environments.





Working Demostration
This working demonstration, the complete operation of the IoT-based weather station is explained. First, data is collected from various sensors connected to the ESP32, including temperature, humidity, pressure, wind speed, wind direction, rainfall, gas level, and altitude. This collected data is then transmitted to the ThingSpeak server using Wi-Fi and HTTP communication at regular intervals. After the data is successfully uploaded to the server, the ESP32-S3 box installed at the user’s location reads the latest data from ThingSpeak using its API and displays it on the built-in screen. To make the working process easier to understand, images have been included in the demonstration to visually show data collection, server communication, and real-time data display on the ESP32-S3 box.

Proposed Solution – Smart Weather Station
The proposed Smart Weather Station is a low-cost, IoT-based system that continuously monitors real-time weather parameters directly from the farmer’s field.
Solution Features:
- Measures temperature, humidity, rainfall, wind speed, wind direction, and pressure
- Provides real-time field-level data
- Displays data on a local display and mobile application
- Enables data-driven decisions for irrigation, crop planning, and spraying
- Helps in early warning and preventive action against extreme weather
- Affordable and easy to use for small and marginal farmers
Code Explanation
Project Code Overview:
Feild Station Code 1

- The provide Arduino sketch isdesigned for IOT Weather Station. The include essential all the required Librarys

- ESP32 connects to WiFi using provided SSID and password, and uploads data to ThingSpeak using the defined API key and server URL.

- In 3rd picture defines pins for the anemometer and wind direction sensor, sets up the BME680 sensor, and initializes the rainfall sensor for data collection

- WiFi Connection: It connects the ESP32 to the specified WiFi network and prints the local IP once connected.
- Anemometer Setup: It configures the anemometer pin and sets up an interrupt to count wind pulses.
- Wind Direction Setup: It adjusts the analog read resolution and attenuation for the wind direction sensor.
- I2C Initialization: It begins I2C communication on the specified pins and checks if the BME680 sensor is detected.

- In this picture sends all sensor readings to ThingSpeak using WiFi and an HTTP GET request, then confirms successful data upload.
Home Station Code 2

This code is for an ESP32-S3 weather station that connects to Wi-Fi, fetches weather data from an online server, and displays parameters like temperature, humidity, pressure, wind, and rainfall on a TFT screen. It manages data updates at fixed intervals and shows the information across multiple display pages.

The ESP32-S3 Box connects to Wi-Fi and reads weather data from the ThingSpeak server using HTTP requests. The received data is processed and displayed on the ESP32-S3 screen, enabling real-time field monitoring from home.
Software Data Visualization Overview:

The software uses the ThingSpeak IoT platform to store, visualize, and analyze weather station data. Sensor data sent from the ESP32 is uploaded to a private ThingSpeak channel, where it is displayed as real-time graphs for parameters like temperature and humidity. This allows remote monitoring, data logging, and easy analysis through web dashboards and MATLAB tools.

In this picture ThingSpeak platform displays real-time graphical data for multiple weather parameters. Separate charts show pressure, wind speed, wind direction, rainfall, gas level, and altitude over time. These visualizations help in analyzing weather trends, detecting changes, and enabling remote monitoring of field conditions through a web-based dashboard.
GitHub Repository