Water Usage Statistics Using Edison & Xively (Intel IoT)

I'm going to showcase our upcoming product NeerAssure which helps in Water Statistics Management & Control with help of Intel Edison. For this instructable, I'd like to thank Digit Makers Lab & Intel for giving me an Intel IoT DevKit and the wonderful opportunity to present a prototype on the IoT Solution NeerAssure: Water Usage Statistics & Control. I'd like to discuss the Objective of this Project:

To Analyze Water usage of individual on a hourly/daily basis and predict the time for the tank refill and compute the true demand and consumption of water for an individual to an entire city. And from the collected data, What needs to be done is to run analytics on the data and look for usage patterns and predictive analytics for water consumption for next week.

This solves Water Scarcity problems and helps build a Smart City.

Step 1: Configuring Edison & Sensor for Arduino IDE

We need to configure the Edison before we can continue with the project. We can choose Yocto over Ubilinux because it supports Arduino IDE. For that we can refer various instructables or Intel Communities which guide how to connect with the board.

After setting up Edison, Test the Arduino IDE connection running the example sketches for LED blink & WiFi Connectivity.

Since this is a prototype, We'll be using HC-SR04 Ultrasonic Sensor for Water Level Detection and logging the data on the Cloud. Ultrasonic Sensor works well with the Arduino IDE and Edison does not has supporting libraries for NodeJS & Python etc. Hence Yocto is the Suitable choice for the OS.

Step 2: Configure Xively Account

Sign Up as a Developer for Personal Account and create a Device For Device Connectivity.

Create a channel Named WaterLevel as shown in the Picture. We can create several channel as temperature, humidity etc and log various sensor data. Give a proper Description with units of Measurement.

Generate API Keys for READ,UPDATE,CREATE permissions. After we have API KEYS, FEED ID, We're all set to GO!!!

Step 3: System Connections & Set Up

Connect the Wires of the Sensor as Specified in the Sketch. Then Connect Edison with the PC using Power cable for Virtual COM Port to work with Arduino IDE. Update/Install Intel Boards Support in the IDE using the Boards Manager.

Working: The Ultrasonic Sensor gets the distance between the sensor & level of water. As we already know the water tank specifications we can calculate the volume of water remaining in it.The Sensor is accurate for 2~4 meters of distance.

We can change the API KEY & Feed Id to suite our requirements.

Upload the Sketch & see the logging of sensor data on your Xively Dashboard.

You've Successfully Set up the Xively Cloud Connection with the Intel Edison Board for Sensor Data Collection.

Step 5: Solution As an Application: Twitter Bot

To build this Project an IoT solution, We can come up with different ideas like:

Twitter Bot

Mobile or Web App

IFTTT

Automatic Motor-Pump Starter, & many more

We can choose Twitter Bot as it is easier & Faster to build.

Get the CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN_KEY, ACCESS_TOKEN_SECRET for the Twitter App and choose one Development Environment like Python or Node JS.

Deploy the Python or NodeJS app to Heroku Cloud Sever or Openshift Cloud which tweets whenever there is a depletion in the water level of the Water Tank (For Now! Until we integrate the Predictive Analytics after enough data aggregation).

Check the Attached File.

This was just an example prototype for Building an IoT solution. I'll keep you all posted on further enhancements like sensor addition and different Solutions as IFTTT etc. Please share your thoughts on how to simplify or enhance the Solution or if you have any queries regarding this prototype please comment!