![Logo](Architecture Docs/favicon.png)
MeWater is a water conservation solution that uses IoT Devices (Solenoid Valves, Flow Meters, etc) to detect and monitor water leakages in realtime. The system auto-shuts down detected leakage lines thus saving on water.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
I would ideally share this architecture via Infrastructure as Code such as AWS Cloudformation or Terraform. But I'll deliver that sometime in the future as I iterate and improve on the architecture.
There are 4 major functions that this architecture serves:
- Getting IoT Data from IoT Core and Storing it in an S3 Bucket (Raw)
- Processing the raw data into something useful to display to end-users
- Sending alerts to users in case a leak is detected
- Sending 'valve shutdown' command to IoT Devices in case a leak is detected
We use an IoT rule provided by AWS IoT Core to push data from a subscribed MQTT topic to an S3 Bucket.
A lambda function sits at the heart of our solution. It takes the data from S3 via a trigger event (anytime data is pushed into the bucket, it's immediately processed) -> we were aiming for a realtime solution
The processed data is stored in a DynamoDB Table, which allows for near-realtime queries.
We've then set up an EC2 Instance to serve our web application where users can view a live dashboard allowing them to monitor the system status. The web-app access our DynamoDB Table via the Python Boto3 SDK.
The current leakage detection algorithm is a poor man's version, in that we only subtract output water volumes from the input. We are working on a more sophisticated algorithm.
leaked_volume = inlet_volume - (outlet1_volume + outlet2_volume)
Once a leakage is detected, the lambda pushes a message with the leakage info to an AWS SNS Topic.
- Another Lambda function is subscribed to this topic and this function sends a command to the IoT Devices via AWS IoT Core to shutdown the valves thus stopping the water leak
- An SMS is sent to the user informing them of the detected leak
- An Email is sent to the user informing them of the detected leak
- Use AWS Secrets Manager to securely store environment variables
- Use Kinesis Data Analytics to analyze IoT realtime events
- Build an API to query the Raw Data -> AWS API Gateway
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Lenny Ng'ang'a - @codewithlenny - [email protected]
Project Link: https://github.com/codewithlennylen/mewater-cloud
- Fanuel Conrad - IoT Lead