Modbus2Chain is an IoT project that uses the Modbus protocol to acquire environmental data from sensors and send it securely to the blockchain via a TCP
connection. This choice was made because Modbus TCP
is very popular for implementing IoT communications in industrial environments, due to its wide adoption, compatibility with Ethernet networks, adequate security and real-time communication capabilities
To achieve the goal of creating an efficient system for collecting and sharing critical environmental data, the project uses a number of technologies:
- The Modbus protocol back-end and device management is implemented in
Python
, using themicropython-modbus
library for communication with sensors. - The blockchain that is used is
Geth
, a Go implementation of the Ethereum protocol. Geth is an Ethereum execution client meaning it handles transactions, deployment and execution of smart contracts and contains an embedded computer known as the Ethereum Virtual Machine. - The user interface is developed in
React
, a JavaScript framework for creating responsive and dynamic user interfaces.
The system workflow begins with the collection of environmental data from sensors using the Modbus TCP protocol. The acquired data is then sent to the Python back-end, which processes it and sends it to the Geth
blockchain using the web3.py
library. The blockchain guarantees the integrity and immutability of data, which can be easily shared with other authorized users.
⬇️Below, a graphic diagram of the workflow in order to make it easier to understand and interact between the different components of the system⬇️.
Thanks to Modbus2Chain, it is possible to create an efficient system for collecting and sharing critical environmental data, guaranteeing their security and integrity through the Geth
blockchain. Furthermore, thanks to the use of modern technologies such as React
and Python
, the project is highly flexible and easily scalable to meet the needs of any IoT application.
Being an exam project, for pure study purposes, very simple and easily configurable IoT devices were used, connected to each other on a breadboard.
The IoT devices are also connected to a slave
device (MCU) (in our case a Raspberry Pi Pico W
), which allows us to manage the Modbus TCP
requests arriving from our master (a BeagleBone Black
) and save the data on Modbus registers (HREGS
Holding Registers and COILS
registers were used in our project).
For more details on Modbus registers you can consult this simple guide: Modbus_Registers
⬇️Below is a photo of the connections made⬇️.