A smart storm water irrigation barrel calculating optimal amounts of water to release from weather and sensor data
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


H2Whoah Smart Irrigation Barrel

What is this?

This is the back end framework for a smart stormwater irrigation barrel, or a class project I went a little (actually, more like a lot) overboard on. This code helps analyze raw sensor measurements (height and water level) sent from a Particle Photon and, using Dark Sky's API, return a result for how long a valve should open to release a sufficient amount of water. Additionally, there will be a webapp using a Flask server to help plot sensor data and more.

img_8436 2

See https://www.youtube.com/watch?v=7rMWMYl7sOk for a demo.



This file contains code for a Particle Photon to read measurements from an ultrasonic sensor and a soil moisture sensor. Additionally, the Photon can read and write to an InfluxDB hosted with AWS and communicate with the server-side script and web application.

This file uses

  • C
  • Photon HTTP requests
  • InfluxDB API calls


This is the back-end for the Python Flask application, also containing templates. This page displays data measured by the Photon pulled from the InfluxDB database and also has a button to set a custom new water level through a POST request writing to the database.

This file uses

  • Python Flask
  • InfluxDB's Python library
  • jQuery and Bootstrap
  • Chart.js


This is the server-side script that pulls weather data from Dark Sky's API and measurements from the database to calculate a new optimal water level. This is controlled by a cronjob to run every hour.

This file uses

  • Python
  • Python's Request library
  • Dark Sky's API
  • InfluxDB's Python library
  • A crojob