jpritcha3-14 / water_flow_server

RPi based program to monitor a flow rate sensor and store/display the data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Water flow project to measure and record water flow data for agricultural applications in Python 3

Hardware Bill of Materials

  • Raspberry Pi model 3 Ver. B (Amazon)
  • Prototype Hat shield for Raspberry Pi (Amazon)
  • Bi-Directional Logic Level Converter (Sparkfun)
  • I2C OLED Module 12864 (Amazon)
  • YF-S201 1-30L/min Hall Effect Water Flow Meter (Amazon)
  • Male Pin Headers
  • Patch Wire
  • Solder

Wiring Setup

(Box = Component, Circle = Connection Point)

alt text alt text alt text

Completed Hardware Setup

alt text

Software Libraries Utilized

Running The Program

  • Before starting up the flow server for the first time, navigate to the flow_server directory and run :
    $ python3 manage.py migrate
    This will initialize the sqlite3 database. It only needs to be run once.
  • Using your favorite text editor, edit line 4 of flow_server/spinUp.py to match the ip address of your RPi.
  • To start the program, ensure you are still in the flow_server directory and run:
    $ python3 spinUp.py

Example Server Response

http://[ip_address]:[port]/display_flow/minute/

alt text

Current Features

  • Main process measures and records flow data from one or two flow sensors
  • Main process pushes data to a child process for database logging every 5 seconds
  • Separate process updates the OLED with current flow rate and maximum flow rate
  • Web sever displays current flow rate, as well as dynamically generated graphs for historical flow rates (for past minute, hour, day, and week) and the maximum flow rate over the selected interval

Planned Features

  • Allow custom settings for flow rate parameters through web server
  • Create an alert if flow goes over a threshold value (set via web server)
  • Pretty up the web interface

About

RPi based program to monitor a flow rate sensor and store/display the data


Languages

Language:Python 95.2%Language:HTML 4.8%