You can still modify the code and use its architecture as a reference.
Water scarcity is one of the most pressing problems in the world right now. According to the World Wildlife Fund (WWF), 70% of our planet is covered by water. However, only 3% of it is fresh water, and only one-third of that is available for consumption. Many water systems are stressed due to the growing human population and over-consumption. Agriculture consumes more water than any other source. Much of the water used in agriculture is wasted due to inefficient irrigation systems. To alleviate this problem, many governments impose restrictions on water usage, especially in drought-stricken states like California. However, these bans are difficult to enforce. For example, some people can afford to violate the restrictions and simply pay the fines.
To improve irrigation efficiency and properly enforce water usage restrictions, this starter kit is a prototype for a smarter, connected sprinkler system.
The starter kit demonstrates the reference architecture of using Apache Edgent and how it can work in conjunction with a centralized analytics system.
This system consists of two main analytics components:
For rapid application development, we leveraged other IBM Bluemix services. These services handle the infrastructure and connectivity, allowing us to focus on developing the analytics and business logic of the application. For the device to communicate with the centralized analytics system, we used the Watson Internet of Things Platform. This service handles application connectivity for us, allowing the Apache Edgent application to communicate with the IBM Streams application easily via MQTT.
To visualize the data, we implemented a visualization server using the SDK for Node.js service, and we used React.js to implement a web-based dashboard.
This smart sprinkler system now enables more efficient water irrigation based on current soil conditions. The prototype only takes the moisture level into account, but the system could be extended to monitor and analyze other important factors like moisture evaporation rate, soil mineral content, or irrigation requirements based on the type of vegetation being planted. Controlling the sprinklers in a centralized manner enabled us to implement business rules for managing water resources and properly enforcing water restrictions when necessary.
See the Google+ Hangout Event for more detail.
NOTE: The jobs in the centralized streaming analytics system are configured to run for one hour only. You can start or stop the jobs manually under the 'Settings' menu.
The moisture sensing simulator application is written using Apache Edgent. The simulator can be run on any workstation. It can also be run with a moisture sensor and buzzer on a Raspberry Pi.
*Apache Edgent is an effort undergoing Incubation at The Apache Software Foundation (ASF), sponsored by the Incubator.
The centralized streaming analytics system uses the following Bluemix services:
An demonstration of the centralized analytics system is hosted here: http://waterconservation.mybluemix.net/.
To try out this starter kit:
Create a Bluemix account.
Click the button below to fork into IBM DevOps Services and deploy your own copy of this application on Bluemix, with a DevOps toolchain already configured.
We are deploying a number of applications onto Bluemix. This process will take about 15 minutes to complete.
In Bluemix:
Streaming-Analytics
Weather-Company-Data
Internet-of-Things-Platform
Then:
cd nodejs
npm install
npm run build
cd ..
cf push -n <host prefix>
cd nodejs
npm install
npm start
By default, the server starts on localhost:3000
Refer to com.ibm.streamsx.smartsprinkler.edgent/README.md for further information.
root
│ manifest.yml (Bluemix deployment configuration file)
| README.md (The file you are reading now)
| LICENSE.md (License Terms)
| copysabs.sh (Scripts for copying streams SAB files into nodejs folder)
│
├───.bluemix (Bluemix pipeline configuration file)
├───readmeImg (Image files for README.md)
├───com.ibm.streamsx.smartsprinkler.iot (Streams project for connecting to IOT)
├───com.ibm.streamsx.smartsprinkler.streams (Streams project for making water decisions)
├───com.ibm.streamsx.smartsprinkler.edgent (Java project for gathering sensor data on Raspberry Pi)
└───nodejs (Node.js project for dashboard)
The Java application running on Raspberry Pi require:
The components required by the Node.js app are documented in the package.json in the nodejs
directory. The list include:
The source code for the app is available under the Apache license, which is found in LICENSE in the root of this repository.