Know your Water Quality using Node Red and API's
Tags: nodered, ibm, cloud
Published: 2021-05-06 12:16:35

Water is an essential resource for all of us, and it is considered to be the most threatened by climate change. Moreover when it comes to various other countries, clean water and its sanitation is a major issue.

Watch this video by [charity: water](https://www.charitywater.org) - The Spring - The charity: water story which really explains the issue in-depth and how many people are affected by this. 

[![charitywater](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bgk2gomg7r3dzzj1r623.jpg)](https://www.youtube.com/watch?v=UE9UvT5ujyg)

According to WHO (World Health Organization) 2.2B people have no access to safely managed drinking water, 4.2B people do not have safely managed sanitation, and 3B people lack basic hand washing facilities! Which is a big number considering the fact that we are in a pandemic and with such issues, there is a chance of it increasing or even mutating to other variants at the same time, which really increases the problem rather than resolving it and the efforts to resolve it would be diminished as well.

There are some amazing organizations which are looking at the problem of clear water and sanitation, as we mentioned charity: water is one of them, but there's also [UN Water](https://www.unwater.org) which is the United Nations subsidiary actively looking into the water crisis.

Recently, IBM launched Call for Code, it is a global challenge which IBM conducts every year with various themes, this years theme is focusing on three major problem areas and clean water and sanitation is one of them.

![Slide8](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kecq6k4v0ayc74wzrskt.png)

 
Recently, Asna Javed (Lead Developer Advocate, IBM Pakistan) and I (Developer Advocate, IBM UAE) conducted a workshop on Building a Water Quality Dashboard with GeoJSON and Node-RED, where we used GeoJSON data provided by USGS [NLDI API](https://labs.waterdata.usgs.gov/api/nldi/swagger-ui.html) returns a GeoJSON set of latitude / longitude coordinates and features that can be plotted on a map The NLDI API is provided by the [Open Water Data Initiative](https://acwi.gov/spatial/owdi/) and is being developed as an [open source project](https://github.com/ACWI-SSWD).

We also got water toxicity reports and values using the [Aquagenuity Developer API](https://aquagenuity.com/developer). The Aquagenuity GetWaterScore API provides water quality reports for many USA Zip Codes. Sign up for a free [Aquagenuity Developer](https://aquagenuity.com/developer) API key. Select the free plan and create an account. You will receive an email welcoming you to the Aquagenuity Developer Access Program. The email will contain your username and password credentials.

![Slide11](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1s6jlqlp9xw4awat6o2g.png)

All both of the API's were pushing information to the Node-Red instance which was running on IBM Cloud and you can also try to [Install Node-RED](https://nodered.org/docs/getting-started/) on your system or in IBM Cloud. You can create and deploy these flows and dashboards to [IBM Cloud](https://developer.ibm.com/dwwi/jsp/register.jsp?eventid=cfc2021challenge&utm_medium=Inpersondirected&utm_content=000039JL&utm_term=10008917&utm_id=May2021-callforcodebuildawaterqualitydashboardwithgeojsonandnode-red-eventid-606ebc8ea197ff40e061baee-global-devadvgrp-dubai-hybrid-workshop-dubai-cfc2021challenge) by [creating a Node-RED Starter application](/tutorials/how-to-create-a-node-red-starter-application/).

To get started, you can login/sign up for IBM Cloud [here](https://developer.ibm.com/dwwi/jsp/register.jsp?eventid=cfc2021challenge&utm_medium=Inpersondirected&utm_content=000039JL&utm_term=10008917&utm_id=May2021-callforcodebuildawaterqualitydashboardwithgeojsonandnode-red-eventid-606ebc8ea197ff40e061baee-global-devadvgrp-dubai-hybrid-workshop-dubai-cfc2021challenge)

Also, you can find the flow which we imported into the Node-Red instance here https://github.com/IBMDeveloperMEA/CFC-Water-Ridgewood.

As a final output, you will see a dashboard by going to ```https://<your node-red url>/ui``` and if the payload is sent properly you should see something like this 

![Slide22](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ce908sgzmdqky2zfafh.png)

In case you missed the workshop and need the resources and replays, please find them below 

Workshop Resources

- Login/Sign Up for IBM Cloud: https://ibm.biz/NodeRedCleanWater

- Hands-On Guide: https://ibm.biz/NRCleanWater-Guide

- Slides: https://fawazsiddiqi.github.io/CFC-Water-Ridgewood

- Workshop Replay: https://www.crowdcast.io/e/water-quality/

If you have any suggestions or queries, feel free to reach out to me, cheers!

Stay safe and keep others safe!