Matlab simulation of ESP32 integration with a Raspberry PI soft-PLC via MQTT
This paper presents a MATLAB-based simulation framework for evaluating the temporal behaviour of an ESP32–MQTT–Soft-PLC integration intended for future deployment on a Raspberry Pi Soft-PLC platform. The proposed setup emulates a typical industrial IoT chain in which a virtual ESP32 node acquires synthetic ADC-like sensor data with Gaussian noise, performs preprocessing and normalisation, injects software jitter at task level, and publishes timestamped JSON messages via a Python MQTT client over a TLS-secured connection to a cloud-based MQTT broker. On the control side, a MATLAB Soft-PLC subscribes to the same MQTT topic, updates a process image at the beginning of each scan cycle and executes an ON-delay (TON) timing logic, while logging all relevant timestamps for performance analysis. End-to-end latency is defined as the time difference between publication at the ESP32 node and processing in the Soft-PLC, whereas jitter is evaluated as the deviation of the actual scan time from a nominal scan period. For a 30-second experiment with a 50 ms nominal scan time, the measured end-to-end latency exhibits a mean of 568.06 ms, with values ranging from 64.11 ms to 1144.76 ms, while the Soft-PLC scan time shows an average of 62.64 ms and a maximum of 172.03 ms. These results characterise the architecture as a soft real-time solution suitable for monitoring, data acquisition and supervisory control, but not for hard real-time applications with strict millisecond-level deadlines. The framework thus provides a practical basis for analysing latency and scan jitter before migrating the ESP32–Soft-PLC integration to real Raspberry Pi-based controllers.
Authors
- Alexandru Bârsan (ORCID: https://orcid.org/0000-0003-0076-4556)
- Timotei Morariu (ORCID: https://orcid.org/0000-0002-9639-749X)
- Paula Drașovean
- Anca Lucia Chicea
- Claudia Emilia Gîrjob
- Cristina Maria BIRIȘ
- Marosan Adrian
Institutions
- Lucian Blaga University of Sibiu (RO)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2025-09-30
- DOI
- https://doi.org/10.5281/zenodo.18723602
- Primary Topic
- Industrial Automation and Control Systems
- Type
- article
- Field-Weighted Citation Impact
- 0.00