IoT ESP8266 Weather Station

Overview

This project is an IoT weather station built using the ESP8266 microcontroller, designed to collect temperature and humidity data and publish it online for logging and graphing. It is an upgrade from a previous Arduino-based weather station, adding Wi-Fi connectivity and the ability to use an outdoor-rated sensor probe.

Key Components

  • ESP8266 development board — Low-power microcontroller with built-in Wi-Fi
  • AM2315 Temperature & Humidity Sensor — Water-resistant probe suitable for outdoor use
  • 4x Female-to-female jumper wires

ESP8266 NodeMCU board

Wiring

The wiring is simple with only 4 connections:

Wire Color ESP8266 Pin Function
Red 3.3V Power
Black GND Ground
White D1 Data
Yellow D2 Clock

Jumper wires for AM2315 sensor

Attach one end of the 4 jumper wires to the 4 connections coming out of the AM2315 sensor… plug the other ends into the ESP8266.

Software Setup

The project uses two code files:

  • ESP8266Weather.ino — Handles data collection and transmission
  • config.h — Stores Wi-Fi credentials and Adafruit IO keys

Arduino IDE with ESP8266Weather.ino and config.h

Code available on GitHub repository

Adafruit IO Configuration

To use this project, you need:

  1. Adafruit IO account — Sign up at accounts.adafruit.com
  2. API Key & Username — Found under “My Key” section; paste into config.h
  3. Wi-Fi credentials — SSID and password entered in config.h

Required Feeds

Create two feeds on Adafruit IO:

  • Temperature_AM2315
  • Humidity_AM2315

Dashboard Setup

  • Go to Dashboards → View All → New Dashboard
  • Add Line Chart Blocks for each feed
  • Customize time frame (e.g., 24 hours)

Deployment

  • Connect ESP8266 to PC via USB
  • Select correct COM port in Arduino IDE (Tools → Port)
  • Upload code
  • Power via phone charger or USB connection

ESP8266 weather station deployed on windowsill

The small wires coming out of the sensor are thin enough to fit through the side of my window so I didn’t need to put the sensitive stuff outside.

Live Data

View the live weather data on the Adafruit IO Dashboard.

Related Projects

Leave a Comment