---
title: "STM32_Weather_Server"
url: "https://maker.wiznet.io/mason/projects/stm32-weather-server/"
markdown_url: "https://maker.wiznet.io/mason/projects/stm32-weather-server/md"
type: "UCC: User Created Content"
author: "Utku Boran Unal"
author_url: "https://github.com/boranunal/STM32_Weather_Server"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Utku Boran Unal"
original_url: "https://github.com/boranunal/STM32_Weather_Server"
published: "2025-08-18"
language: "en"
tags: ["W5500", "STM32"]
hardware: ["WIZnet W5500"]
likes: 0
views: 5796
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# STM32_Weather_Server

> STM32_Weather_Server

Original author: Utku Boran Unal (source: https://github.com/boranunal/STM32_Weather_Server)

## Components

- **WIZnet W5500** x 1 ([docs](https://docs.wiznet.io/Product/Chip/Ethernet/W5500))

WIZnet parts: W5500 ([Datasheet](https://docs.wiznet.io/Product/Chip/Ethernet/W5500/datasheet?utm_source=maker&utm_medium=project&utm_campaign=w5500), [product hub](https://maker.wiznet.io/products/w5500/))

## Documents and links

- [STM32_Weather_Server](https://github.com/boranunal/STM32_Weather_Server) (code)
- [STM32_Weather_Server ioLibrary](https://github.com/wiznet-mason/STM32_Weather_Server_ioLibrary) (code)
- [STM32CubeMX file](https://maker.wiznet.io/_lib/download.asp?path=project/20&downfile=STM32%5FWeather%5FServer%5FioLibrary%2Eioc) (code)

## Article

### 1. **Project Overview**

The **STM32 Weather Server** is an embedded systems example project that demonstrates how to create a simple **HTTP server** running on an STM32 platform.
It measures **temperature and pressure using the BMP180 sensor** and serves the data through the **W5500 Ethernet controller**.

Key components:

**STM32F401RE Nucleo board** (MCU)

**BMP180 I2C sensor** (temperature/pressure measurement)

**W5500 SPI Ethernet controller** (TCP/IP communication)
([GitHub Repo](https://github.com/boranunal/STM32_Weather_Server?utm_source=chatgpt.com))

---

### 2. **Main Features & Structuremain.c**: System initialization and main loop

**BMP180 driver (BMP180.c / .h)**: Non-blocking state machine using I2C interrupts

**W5500 driver (w5500_dma.c / .h)**: DMA-based SPI communication and TCP server logic

**HTTP server (httpserver.c / .h)**: Simple HTML template and HTTP response handling

**UART debug (uartCom.c / .h)**: Optional debugging output

---

### 3. **How It Works**

The project is built on **two main state machines**:

**BMP180 State Machine** – Handles step-by-step readings of temperature and pressure using I2C interrupts and timers.

**W5500 State Machine** – Runs the TCP server workflow: initialization → listen → send data → reset to initial state.

This architecture enables reliable integration of **sensor measurement** and **Ethernet communication**.

---

### 4. **File Structure Summarymain.c** – Project entry point

**BMP180.c/h** – Sensor driver

**w5500_dma.c/h** – Ethernet driver

**httpserver.c/h** – HTTP server logic

**uartCom.c/h** – Optional UART debugging

---

### 5. **Tech StackLanguages**: C (87.4%), Assembly (12.6%)

**Development Tools**: STM32CubeIDE

**Libraries**: HAL Drivers

---

### 6. **Applications & Extensions**

Building an **IoT weather station**

Creating a **real-time sensor monitoring server**

Learning **embedded HTTP server development on STM32**

Extensible to support more sensors, UI enhancements, or cloud integration

---

## **Additional Note**

In addition to source code examples, this project also provides:

**STM32CubeMX project files** for easy setup and regeneration

A **Keil project** built with **WIZnet ioLibrary** integration for W5500

This makes the project suitable for both **STM32CubeIDE** and **Keil environments**, offering flexibility for developers to build and run the example across different toolchains.

---

Source: https://maker.wiznet.io/mason/projects/stm32-weather-server/
