Group Project Final Delivery Blog Post
Kloaka
Kloaka is our group project for the IoT 2021 course @ Sapienza University of Rome.
The Core Idea
We believe there is a tight relationship between the quality of marine waters and the quality and status of those waters that directly flow into the seas.
We decided to focus on sewage waters, and in particular we developed Kloaka, a sewer pipes monitoring system that detects changes in the flow of sewage waters, which may be potentially caused by obstructions or leakages and will surely cause negative effects to sea waters (i.e. where this kind of waters flow).
The nature of the obstructions can vary, from physical objects that are thrown away by people (street garbage), to rubbish and increased amount of water caused by precipitations and bad weather in general.
For the last point, Kloaka makes use of collective intelligence gathered by weather forecasts websites like this one.
Architecture, Hardware Components, Network Diagram, Offered Services, Software Components
This is the general architecture of the Kloaka system.
Multiple boards running the Kloaka firmware are attached to the same sewage pipe. Each board measures the flow intensity using ultrasonic range finders (which comprise one transmitter and one receiver):
This technique is already used for industrial applications, as it can be seen here.
The boards send their readings to the cloud infrastructure (hosted on AWS IoT Core) using the LoRaWAN technology thanks to The Things Network.
The boards also perform edge computing in the sense that the raw flow values are normalized and classified in the two following choices: [full flow, less/no flow], and send that information to the cloud instead of the raw values they read.
Here is a description of Kloaka's network diagram:
Kloaka devices communicate with the cloud back-end (hosted on AWS) using the LoRaWAN technology thanks to The Things Network. Once the uplink messages reach TTN, they can be intercepted by the cloud infrastructure simply by subscribing to the topics created by TTN itself.
The collected data are then stored and processed by the cloud services in order to eventually be displayed on Kloaka's web dashboard, which besides showing the raw data also gives information about the encountered anomalies (if any).
The following are instead Kloaka's software components:
Each "zone" identifies one single sewage pipe, which comprises multiple boards, each board runs the Kloaka firmware, that is tasked with collecting the flow values, normalizing them in the above-mentioned [full-flow, less/no flow] range and sending the information to AWS IoT Core via TTN using the LoRaWAN technology.
Once the messages reach AWS IoT core, they are intercepted by a rule and then passed to a general lambda which is tasked with classifying each message according to the zone they belong to. Once classified, they are stored in a DynamoDB table. This table is periodically monitored by a stream, which in turn triggers a lambda that checks if some anomalous event is verified by comparing all the flow values coming from the different Kloaka devices attached to the same pipe.
If an anomalous event (problem) is verified, it is appended to an ad-hoc DynamoDB table in order to be displayed on the web dashboard to signal the sewage operators that a problem has occurred on that specific pipe.
IoT Elements
For the physical prototype, we employed a STM32 Nucleo-F401RE board, and connected an ultrasonic flow meter (namely a SRF04 Ultra-Sonic Ranger) to it, which in turn is attached to a metal pipe to measure the flow of water. Testing the device after attaching the sensor to the pipe revealed that for an empty tube a large value is returned, while for flowing water a smaller value is returned (eg: 123456 -> 3456). This measure is physically meaningless, as it not represents the pipe's flow, but it allows us to identify the two extreme cases [full flow, less/no flow].
As cloud back-end, we employed the Amazon AWS services, in particular: AWS IoT Core to create our IoT application and intercept the messages coming from Kloaka devices, AWS Lambda to process and manage the incoming data, DynamoDB to store the data and monitor them for anomalous events, AWS API Gateway to offer REST APIs to collect the data to be shown on Kloaka's web dashboard, hosted on AWS Amplify.
As communication medium, Kloaka devices communicate via the LoRaWAN technology using The Things Network (TTN). We managed to directly integrate the AWS cloud back-end and TTN following the official documentation, which consisted in creating a cloud formation stack with the needed configurations to connect our TTN application and AWS. This allowed us to receive the LoRaWAN uplink messages (i.e. the messages coming from the Kloaka devices) as standard MQTT messages, which can be easily intercepted by an AWS IoT Core rule and passed to a lambda to be processed and put inside DynamoDB.
Performance Evaluation
We evaluated our solution focusing on the following metrics: Speed, Capacity and Energy.
Speed
A sleeping phase (interval between sensig phases) lasts for 20 minutes, the sensing phase lasts about 1 minute and its repeated and the trasmitting operation requires about 10 seconds each hour thus we have that data is sended by each device with a duty cycle of 62,73 minutes.
Energy
We measured the consuptions via a voltage meter hoked up to a 1 ohm resistor though the IDD pins on the board. We get the consumption of our device multiplyng the consumption for the different states and the period of eache state and divide by the sum of periods.
Capacity
The device availability on a battery of 10.000 mAh and mean consumption of 1.3mA about 10 month and seems a good compromise for not using an RTC and don't put the device in the lowest level of sleep.
Duty Cycle
The decision of the tx duty cycle is based on battery consumption and data frequency needings, howewer our tx rate respects Lora standard and TTN policies.
Further Details
All the details about the project, comprising further documentation, design choices and the code we developed are available in Kloaka's github repository





Commenti
Posta un commento