Can the IOTA technology help to monitor water distribution securely?
When the well’s dry, we know the worth of water.
– Benjamin Franklin
Water is an essential ingredient in our life. Almost all lifeforms need it to exist and to survive — especially humans. We need it to grow plants, to drink it, to clean things, and many more. In our day to day life, water is always available, thus we often forget how important it is. However, there are many regions in the world with no working water supply. People are forced to use contaminated water from improvised wells or rivers. Fortunately, several organizations try to support these regions and developing countries by funding water pumping stations. But, as these regions are often areas of conflict, war or post ware areas, organizations often hesitate to send people to these regions to monitor the status of the pumps. Due to this reason, organizations often have to trust local operators monitor the status manually, which is often unreliable due to several reasons. Imagine how correct these reports might be if you take corruption or regional interests of certain groups, like war lords, into account. Thus, assessing the effectiveness of the funding is almost impossible. This is where Internet of Things (IoT) and IOTA technology come into the game.
Want to read this story later? Save it in Journal.
How IOTA can contribute to secure water supply in developing countries
Monitoring machinery and industrial compounds is a well know domain of IoT. Using various sensors which measure certain values, do some processing and transmit them to a (central) monitoring service can be found everywhere. In most of these scenarios, the transmission, data storage and ultimately the data are part of the organization and trustworthy. Fraud and manipulation of the data afterwards is somehow neglectable. Thus, some kind of secure provisioning and security layer can be applied easily. However, this approach might not be suitable for the water pumping stations in areas of conflict. Here, regional pressure groups might have interest in manipulating the sensor data to their favor. A common example to fraud the funders is gaining power over the local people and force them to control the water flow and send manipulated data to the funders, while pretending everything is fine. Such data manipulation can be mitigated with cryptographic technology.
Imagining that we not only have one pump with some sensors attached, instead we have hundreds, maybe thousands or more leading to a large number of sensors and ultimately, a large amount of sensor data generated in a high frequency. These data have to be handled by the system. Beside the amount of data, we must consider that the pumping stations are on remote locations, with only limited internet connectivity and power supply. In addition, the computational power onsite is rather low. These aspects must be taken into account during the selection of the technology.
We suppose that classic blockchain technologies like Bitcoin or Ethereum do not suite this scenario well. Therefore, we started an evaluation project to find out, if the IOTA technology is suitable in this context. According to the IOTA Foundation is IOTA “the first open-source distributed ledger that is being built to power the future of the Internet of Things with feeless microtransactions and data integrity for machines“. Key element is the Tangle, a directed acyclic graph which stores the individual transaction instead of a classic chain of transaction blocks use by blockchain-based systems. Writing and verifying data on the Tangle is fast and can be performed in a distributed way. Since its open source nature, you can deploy our own private/isolated Tangle. You can learn more about the Tangle in the article “On the Tangle, White Papers, Proofs, Airplanes, and Local Modifiers”. With so called Masked Authenticated Messages (MAM) IOTA provides a data streaming layer which, on paper, suites our purpose of rapid IoT data exchange well. These messages are arranged in channels. They are somewhat similar to a linked list. Starting from the root message, you can walk through the channel message by message.
Our smart and secure water pumping station
For our project, we decided to setup a private Tangle running in a Kubernetes cluster deployed to the Azure cloud. To investigate the capabilities on the pump and sensor side, we built a hardware demonstrator. For fast prototyping we used a Raspberry Pi acting as an internet gateway and IOTA controller. The pump and flow sensor are interfaced with an Arduino from the Pi. Both communicate through the serial interface. The Arduino controls a relay which controls the power supply of a small fish tank pump. We added a water flow sensor which is monitored by the Arduino as well. Finally, we integrated a temperature and humidity sensor with our demonstrator. The Raspberry Pi takes the data from the Arduino and attaches them to the MAM channel and ultimately to the Tangle. To handle loss of connectivity, the outgoing data is cached in a queue and sent once connectivity is available. In order to control the pump, we use the MQTT capabilities of our IoT-Platform. To monitor the pump, we also added a webcam for live streaming.
To evaluate the performance in detail we developed a pumping station simulator based on NodeRed. The simulator runs in a docker container and thus is easy deployable. With this simulator it is easy to scale the participants in the Tangle and reveal hidden shortcomings in the technology. During our evaluation we noticed that the performance of MAM attachments was rather bad. After some investigations we noticed a fairly high load on the coordinator node. Blocking some ports in our Azure instance solved the issues. After that modification, we could easily simulate dozens of pumps sending data to the Tangle.
To evaluate the performance in detail we developed a pumping station simulator based on NodeRed. The simulator runs in a docker container and thus is easy deployable. With this simulator it is easy to scale the participants in the Tangle and reveal hidden shortcomings in the technology. During our evaluation we found out that the performance of MAM attachments was rather bad. After some investigations we noticed a fairly high load on the coordinator node. Blocking some ports in our Azure instance solved the issues. After that modification, we could easily simulate dozens of pumps sending data to the Tangle.
To evaluate the whole application flow we also developed an easy to use prototype dashboard system. The frontend reads the data from the Tangle in real-time and plots vital information for each real or simulated pump. Beside telemetry data like water flow or temperature, is also shows if a pump is offline or has a fault.
Beside the pump station overview page, we also created detail pages for each used pump. Additional to the status information, this page shows base data like pump manufacture, last maintenance or some usage statistics.
We found that the IOTA technology offers some promising features. Within our evaluation project we got everything running as expected. However, we noticed that the MAM channels might be a bit immature for productive use. Would you like to share your experiences and thoughts with the community? Fortunately, a new version v1.1 is around the corner. To ease the load on the Tangle, we found that bundling high frequent data in a larger message is necessary. In such a case, additional data compression can be used which is beneficial in areas with low data connectivity. If real time monitoring is important to you, we suggest using an off-chain MQTT channel to communicate with the pump directly. To verify the data, you can then run a check against the data in the Tangle periodically.
Overall, we are satisfied with the performance and capabilities of IOTA in our evaluation project. We are eager to see how the upcoming MAM v1.1 will perform. Especially, we need to further investigate the performance in a large scale scenario. Finally, we consider to integrate IOTA into our IoT-Platform and consulting services. If you are interested in our demonstrator or other IoT-related topics, do not hesitate to contact me.