Wiznet makers

mason

Published August 18, 2025 ©

87 UCC

21 WCC

28 VAR

0 Contests

0 Followers

0 Following

Original Link

STM32_Weather_Server

STM32_Weather_Server

COMPONENTS Hardware components

WIZnet - W5500

x 1


PROJECT DESCRIPTION

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)


2. Main Features & Structure

main.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 Summary

main.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 Stack

Languages: 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.

Documents
  • STM32_Weather_Server

  • STM32_Weather_Server ioLibrary

  • STM32CubeMX file

Comments Write