STM32_Modbus_AnalogRead
STM32 BluePill-based analog monitoring system using the WIZnet W5500 Ethernet module. Measures temperature, voltage, and current with external high-resolution A
Summary
STM32 BluePill-based analog monitoring system using the WIZnet W5500 Ethernet module. Measures temperature, voltage, and current with external high-resolution ADCs and delivers real-time data to a PC over Modbus TCP for reliable industrial-style monitoring.
Project Overview
This project demonstrates an Ethernet-enabled analog measurement system built on the STM32F103C8T6 BluePill. The device collects temperature, voltage, and current data from external sensors and ADCs, then transmits the results to a PC using Modbus TCP over the WIZnet W5500 Ethernet controller.
By combining precise analog acquisition with stable wired networking, the project is well suited for lab instrumentation, industrial monitoring, and custom data acquisition applications.
Key Features
- W5500-based Ethernet communication for stable Modbus TCP data transfer to a host PC.
- Multi-parameter sensing including temperature, voltage, and current in a single embedded node.
- High-resolution measurement architecture using ADS1115 16-bit ADCs for voltage channels and ADS1220 24-bit ADC for temperature acquisition.
- PT1000 4-wire temperature sensing for improved precision in resistance-based temperature measurement.
- PC-side Modbus monitoring tool written in Python for real-time visualization and offset-based temperature zeroing.
- Why WIZnet W5500
The W5500 plays a central role in this project by turning the STM32 measurement node into a network-accessible Modbus TCP device. Instead of sending values over UART or displaying them locally only, the system publishes structured register data through Ethernet, making it easier to integrate with PC software, SCADA-style tools, or custom industrial dashboards.
This gives the project better interoperability and a more practical deployment model for real monitoring systems.
Hardware Setup

Main hardware used in the repository:
STM32F103C8T6 BluePill – main controller
WIZnet W5500 Ethernet module – TCP/IP Ethernet connectivity
ADS1115 (x2) – differential voltage measurement channels
ADS1220 – high-resolution temperature measurement
PT1000 4-wire sensor – precision temperature sensing
ACS712 up to 5A – current measurement sensor
Software Implementation
The firmware initializes Ethernet with a fixed IP address and creates six Modbus holding registers. Four registers store analog voltage-related values, while two registers store a 32-bit temperature value split into high and low words.
On the sensing side, the ADS1220 is read through SPI for temperature conversion, while two ADS1115 devices are accessed over I2C for differential voltage measurements. On the host side, a Python script uses pyModbusTCP to read the registers, decode signed values, apply scaling/calibration factors, and display the measured results in real time.
Network Architecture
The architecture is straightforward and effective:
Sensors/ADCs → STM32 BluePill → W5500 Ethernet → Modbus TCP → PC Python Client.
This design separates measurement, transport, and visualization cleanly, making the project easy to extend toward data logging, dashboards, or industrial control systems.
Technical Value
A strong point of this project is that it combines precision analog measurement with standard industrial communication. Many embedded examples stop at local sensor reading, but this design goes further by exposing the data as Modbus TCP registers over Ethernet.
That makes the project useful not only as a hardware prototype but also as a practical reference for building custom Ethernet measurement devices with WIZnet products.
Applicable Applications
This project is well suited for applications that require analog measurement with reliable Ethernet-based remote monitoring.
Industrial equipment monitoring
It can monitor the current, voltage, and temperature of motors, pumps, heaters, power supplies, and other industrial equipment. With Modbus TCP over W5500, the measured data can be sent directly to a PC, PLC, or SCADA system.
Power and battery system analysis
The project is useful for DC power supply testing, battery monitoring, and load analysis. By measuring both voltage and current, it can help evaluate power behavior, operating conditions, and system stability.
Thermal and heater control systems
Because it combines temperature and current sensing, it fits applications such as heaters, hot plates, thermal chambers, and cooling systems, where both electrical load and thermal response need to be checked together.
Remote Modbus TCP I/O node
This design can also work as a custom Ethernet-based remote measurement node. It is suitable for systems that need sensor data to be shared through standard industrial communication without relying on wireless links.
Q1. What is the STM32 Modbus Analog Monitoring project?
A: It is an embedded monitoring system that measures current, voltage, and temperature using STM32 and external ADCs. The measured data is transmitted over Ethernet using the WIZnet W5500 and Modbus TCP, allowing real-time monitoring from a PC or industrial system.
Q2. Why is the WIZnet W5500 used in this project?
A: The W5500 provides a hardware TCP/IP stack and Ethernet interface, allowing the STM32 to communicate over Modbus TCP with minimal processing overhead. This enables stable wired networking suitable for industrial monitoring applications.
Q3. What sensors are used for measurement in this project?
A: The system uses ACS712 for current sensing, ADS1115 16-bit ADCs for voltage measurement, and ADS1220 24-bit ADC for PT1000 temperature sensing. These components allow precise analog measurements for electrical and thermal monitoring.
Q4. How is current measured in this system?
A: Current is measured using the ACS712 Hall-effect current sensor, which outputs an analog voltage proportional to current. The signal is digitized by the ADS1115 ADC, then converted into amperes using the sensor sensitivity (185 mV/A).
Q5. What communication protocol does the project use?
A: The device communicates using Modbus TCP over Ethernet. Measurement values are stored in Modbus holding registers, allowing external systems such as PCs, PLCs, or SCADA software to read the data easily.


