Water Monitoring System : A Blockchain IoT Approach
Water is the elixir of life. The design is distinctly divided into two parts, one is the IoT water parameter monitoring environment and the other is the Blockchain distributed ledger technology. The complete monitoring system should have appropriate data storage capacity, low power consumption and proper battery life expansion methods like solar power units.
Under physical environment temperature, humidity and turbidity are monitored, under chemical environment acidity (pH) parameter is monitored and total dissolve solid TDS is monitored. The sensors are interfaced with a microcontroller and wifi module for data transmission.
pH of water is a measure of how acidic/ basic water is pH of 7 is considered neutral, pH less than 7 indicates acidic and more than 7 is alkaline. The pH of potable water should be between 6.5 to 8.5. TL 42 industrial pH sensor of combined electrode type is used to monitor pH of water. A pH sensor circuit board is used with the sensor which is powered by 9V DC supply and the output pins of the board is connected to the microcontroller.
The second parameter monitored is temperature. In this work DHT11 is used for measuring temperature of water, by interfacing to the wifi based microcontroller unit. The third parameter is turbidity which is the indicator of the amount of suspended sediments in water, which can block sunlight to the aquatic life. Therefore turbidity sensor SKU: SEN0189 is used to measure the amount of light scattered by suspended solids in water which is proportional to the turbidity.
The fourth parameter is TDS which indicates the amount of dissolved solidities in milligrams per litre of water. Higher TDS value indicates less clean water and vice versa. The probe cannot be used in water above 55o C. The TDS sensor V1.0 is used to monitor the parameter. The sensor has a range of 0 to 1000 ppm.
RFID module RC522 is used to identify the water source location. Each unit will have one RFID reader unit. The tag contains microchip that processes the information from the Electromagnetic field. RC522 RFID generates 13.56 MHz EM field. The power of the complete IoT sensor unit is managed by rechargeable batteries or Solar power supply to increase the battery life of the sensors.
To monitor the power consumption of the sensor network the tool Powerstat is used in the Ubuntu environment, which is used in industry also. It depicts power in watts/second depending on the system power consumption. The second power tool used is PowerTop to measure analyse and minimize the power consumption of the sensor network.
Blynk app is used on the IoT platform to display the data on the mobile phone. The Blynk app is interfaced with the Blynk server and associated libraries. The key officials can possess this app to monitor the water parameters anywhere and everywhere.
The data from these sensors is acquired by the influxdB database. The microcontroller unit is interfaced with the telegraf platform for sensor data acquisition. Blockchain system design follows the Iot frame work suite. The properties of Blockchain technology are the data is secure, transparent, immutable and residing on the distributed ledger technology. The transaction records are between the clients(sensor devices) and the recipient (Water monitoring unit). Since the Blockchain data is immutable and timestamped, it cannot be changed or manipulated by anybody.
This real time approach to water monitoring unit has ushered a new level of security. Hyperledger Sawtooth platform is used to build the water monitoring and display unit. Visualization software Graphs of the temperature data, TDS data, turbidity pH are visualized using Grafana tool.
The distributed ledger application for Blockchain is built using the Docker. Docker is a mini visualization system environment of the entire OS. The Hyperledger Sawtooth software components are formed as containers in the Docker system for deployment of the application. These components are defined in the docker.yaml file. The Docker engine runs on the Ubuntu platform. A Docker image is created to run the system. The containers should be defined according to the application specific design. In this design, influxdB, Grafana, shell, settings TP, rest api, validator, IoT platform sensors, water monitoring unit RFID and water transaction family. Docker compose is a tool to run.
Smart contracts are written for the water monitoring unit in Python to design the application specific transaction processor. These contracts are written in a subfolder of the npm service folder. The validator uses the Proof of Elapsed time consensus algorithm to validate the transaction which arrives from the clients. Once the transaction arrives the validator probes the transaction processor and handler in specific using the apply() arguments to change the state of the transactions accordingly. Hyperledger sawtooth transactions are bundled into Batches and then into Blocks linked by the hash cryptographic Hex addresses. To invoke appropriate actions, a transaction with some payload has to be submitted. The payload will decide the action to be taken.
The integration of the Water monitoring IoT unit with the Blockchain technology brings a new horizon to the application scenario in the state of the art technology.