A UAV and Blockchain-Based System for Industry 4.0 Inventory and Traceability Applications †

: Industry 4.0 has paved the way for a world where smart factories will automate and upgrade many processes through the use of some of the latest emerging technologies. One of such technology is Unmanned Aerial Vehicles (UAVs), which have evolved a great deal in the last years in terms of technology (e.g., control units, sensors, UAV frames) and have reduced signiﬁcantly their cost. UAVs can help industry in automatable and tedious tasks, like the ones performed on a regular basis for determining the inventory and for preserving the traceability of certain items. Moreover, in such tasks, it is essential to determine whether the collected information is valid or true, especially when it comes from untrusted third-parties. In such a case, blockchain, another Industry 4.0 technology that has become very popular in other ﬁelds like ﬁnance, has the potential to provide a higher level of transparency, security, trust and efﬁciency in the supply chain and enable the use of smart contracts. Thus, in this paper, the design and preliminary results are presented of a UAV-based system aimed at automating the inventory and keeping the traceability of industrial items attached to Radio-Frequency IDentiﬁcation (RFID) tags. Such a system can use a blockchain to receive the inventory data collected by UAVs, validate them, ensure their trustworthiness and make them available to the interested parties.


Introduction
The concept Industry 4.0 fosters the evolution of traditional factories towards smart factories through the use of some of the latest technologies, like 3D printing, augmented reality [1,2], cyber-physical systems [3], fog computing [4] or the Industrial Internet of Things (IIoT) [5,6].Robotics and Unmanned Aerial Vehicles (UAVs) are also considered as key technologies for the future smart factories, since they allow for carrying out repetitive and dangerous tasks without almost any human intervention or supervision.
In the last years, UAVs have proved to be really useful in fields like remote sensing (e.g., mining), real-time monitoring, disaster management, border and crowd surveillance, military applications, delivery of goods, precision agriculture, infrastructure inspection or media and entertainment, among others [7,8].In many of such fields, UAVs perform tasks that constitute one the foundations of Industry 4.0: to collect dynamically as much data as possible from multiple locations.In addition, UAVs not only collect data, but are also able to store, process and exchange such information with suppliers or with devices deployed in factories.Industry 4.0 technologies have to be integrated horizontally so that manufacturers and suppliers can cooperate.In order for a company to determine dynamically its need for supplies, it is necessary to keep track of their stock.For such a purpose, many companies carry out a periodic inventory and decide whether more supplies have to be purchased.Unfortunately, in many companies, such an inventory is performed manually, which is a really costly, time-consuming and tedious task.Software exists to automate stock control, but when it is controlled by humans, the process is prone to accounting errors and it is not carried out in real time.Therefore, the ideal inventory should be performed automatically in real time and in an efficient, flexible and safe way.
UAVs have been applied to inventory tasks in the past.In the case of the latest commercial systems [9][10][11], they deploy a scanner on the UAV platform and perform a predefined flight in order to read barcodes.In the literature, there are more ambitious solutions like the one presented in [12], which describes an autonomous UAV that makes use of Radio-Frequency IDentification (RFID) and self-positioning/mapping techniques based on a 3D Light Detection and Ranging (LIDAR) device.
Another essential technology for many industries is blockchain, which allows for storing the collected data (or a proof of such data) so that it can be exchanged in a secure way among entities that do not trust each other.Although blockchain can be considered to be still under development in many aspects [13], some of its applications for fields where trust is a necessity (e.g., finance) have been already deployed.In addition, blockchain technologies enable the creation of smart contracts, which can be defined as self-sufficient decentralized codes that are executed autonomously when certain conditions of a business process are met.Thus, the code of a smart contract translates into legal terms the control over physical or digital objects through an executable program.For instance, a smart contract may be used as a sort of communication mechanism with a supplier when certain materials run low and more incoming work is expected that would require them.
Besides recent literature on blockchain-based autonomous business activity for UAVs [14], to our knowledge, this article is the first that presents a communications architecture that includes both a blockchain and smart contracts together with a UAV development for RFID-based inventory and traceability applications.Specifically, the proposed system can use a blockchain to receive the inventory data collected by UAVs, validate them, ensure their trustworthiness and make them available to the interested parties.Moreover, the system is able to use smart contracts to automate certain processes without human intervention.

Communications Architecture
Figure 2 depicts the proposed communications architecture.In such an architecture, a UAV carries a Single-Board Computer (SBC) and an RFID reader.The RFID reader is used for collecting data from RFID tags that are attached to items or tools, or are carried by industrial operators.The SBC obtains such data from the RFID reader, processes them and sends them through a wireless communications interface to a ground station.The SBC can send the collected information to two possible destinations: to a Cyber-Physical System (CPS) or to a blockchain.
In the case of sending the data to a blockchain, the SBC makes use of a software module that acts as blockchain client.Therefore, the SBC is able to store in a secure way the collected data (or their hashes) into the remote blockchain, which also allows the proposed system to participate in smart contracts.Such a blockchain may be:

•
Public.It is not required the approval of an entity to join the blockchain.Anyone can publish and validate transactions.Public blockchains can be useful in certain industrial scenarios where a high level of transparency is necessary or where massive device interaction is required.

•
Private.The participation in the blockchain is regulated by the owner.Therefore, such an owner decides on issues like the mining rewards or who can access the network.
• Consortium or federated.In this type of blockchain, a group of owners operate the blockchain.They restrict user access to the network and the actions performed by the participants.
In fact, the consensus algorithm is usually run by a pre-selected group of nodes, which increases transaction privacy and accelerates transaction validation.This can be the case of groups of industrial companies (e.g., suppliers) that work on the same field and that have to exchange and validate transactions: each entity may have its own validation node and when a minimum amount of nodes approves a transaction, it is added to the blockchain.

UAV Implementation
UAVs vary widely in size, materials, components and configuration.In the design of the proposed UAV, the main objective was to develop a cost-effective, simple and modular initial prototype that can be easily adapted to different applications, scenarios and/or performance criteria.
Figure 2 depicts the main components of the designed UAV.It is composed of a flight controller PixHawk 2.4.8 flashed with the well-known open-source firmware Ardupilot [15] mounted in an Hexacopter frame of 550 mm of diameter mostly made of carbon fiber except for the arms, which are made of plastic reinforced by carbon fiber rods in the interior.
The thrust to move the UAV is generated by six 920 Kv brushless motors controlled by six 30 A Electronic Speed Control (ESCs) powered by a four-cell Li-Po battery of 5 Ah of capacity that also provides power to all the on-board electronics through a voltage conversion module.Besides the built-in sensors of flight controller board, a UBLOX M8N GPS module was included to provide autonomous flight outdoors.
In order to perform the inventory, an RFID reader system has been used that consists of a commercial RFID reader (NPR Active Track-2, RF Code, Austin, United States) that has been modified to reduce its weight by replacing its steel case with a lighter one made of foam, which protects the reader and reduces vibrations.The reader is connected through Ethernet to the SBC that processes all the readings and communicates wirelessly with the ground station.Table 1 shows a summary of the main components of the designed UAV.

Experiments
In order to test the proposed system, it was tested in a big industrial warehouse (approximately 120 m long and 40 m wide) where 13 different tags were attached to items scattered throughout the warehouse (actually, for security reasons, the tags were deployed in a 50 m × 40 m isolated subarea).Figure 3 illustrates the experimental setup, while Figure 4 shows one of the moments during the experiments.As it can be observed, in these preliminary tests, the drone was operated in manual mode in order to avoid possible security problems and it followed a circular movement around the test area where the RFID-tagged items were placed.In the future, such an operation will be automatic through prefixed waypoints.Figure 5 shows the percentage of the read tags through time.It can be observed that all the tags were read in less than two minutes.In addition, the significant reading range of the reader can be observed, since, in the first 11 seconds (as the drone rises from the ground), it is able to read roughly 30% of the tags.These results are really promising, since the time required by a human operator to collect the same information is at least five times greater than when using the proposed system, since it has to walk through the area, locate the items and identify them manually.

Conclusions
In this paper, the design and preliminary results of a UAV and blockchain-based system for Industry 4.0 inventory and traceability applications were presented.Such an RFID-based system is able to collect inventory data five times faster than a human operator.The real-time collected data are processed in an SBC that can send the information to a CPS or to a public, private or consortium blockchain.Further work will focus on additional experiments and the implementation of a specific blockchain with IoT-based smart contracts.

Figure 2 .
Figure 2. UAV used by the inventory and traceability system.

Figure 5 .
Figure 5. Percentage of read tags during a specific inventory flight.

Table 1 .
Main features of the UAV components.