Skip to content

AlexandriaLittle/AutoAquaponics

 
 

Repository files navigation

AutoAquaponics Prototype 2.0

Overview

The AutoAquaponics software program is a graphical user interface (GUI) program that allows the user to monitor and control an automated aquaponic system remotely. AutoAquaponics is compatible with Raspberry Pi only, and it has so far been developed for Raspbian Buster 10. It also requires the use of the latest versions (as of December of 2020) of Python 3, Matplotlib, NumPy, Pillow, OpenCV, and a variety of libraries for the sensors and electronics incorporated into AutoAquaponics (full list of libraries will come once the system is completed).

This edition of the AutoAquaponics software is meant to complement our existing hardware to serve as a comprehensive environmental monitoring system that gives the user real-time visualizations of the trends of a variety of parameters (pH, water temperature, total dissolved solids, air temperature, water level, and relative humidity). It also allows the user to see a live video of the aquaponic system through a Raspberry Pi camera module, and send specified users warning messages via text when certain parameters exceed their user-defined bounds. For more information about the overall AutoAquaponics project, go here. Below is a brief outline of what each of the pages (Dashboard, Settings, Video Stream, Control Panel) in the GUI does:

Dashboard

The Dashboard page is the homepage of the AutoAquaponics GUI. It contains a number of live graphs in a scrollable frame (Linux and Windows compatible) that display the recent values of the six parameters mentioned above. One the left hand side of the page is a summary table of what the last logged values of each parameter were, giving the user an easy way to see the numerical values of each parameter. When the detected value of a parameter is within a certain bound defined in the Settings page, the graph for that parameter will be shaded green and the text of that parameter's last value in the table will be in black, signifying that everything is going smoothly. However, if the detected value of a parameter exceeds the bounds defined in Settings, the graph and text color of that parameter will turn red, signifying that the user needs to fix the system to get the detected values back into the "safe" range. When the detected value exceeds the bound, the user will also get a warning message via text, which is described in more detail in the Settings section. To maneuver to any page on the GUI, the user can simply click "Menu" on the top left hand corner of the window and choose which page they wish to view. To export data from Dashboard, one could press the "Export Selected Data" button and use the pop-up window to specify the exact parameters one want to graph or save as a CSV, making more advanced data analysis and getting a snapshot of system performance fast and easy. There is also a "Quit" button on the bottom of the menu bar should the user decide to close the GUI.

Settings

The Settings page contains a number of entry boxes (two for each parameter) that the user can utilize to set the desired "safe" range of each parameter. If the user wishes to be alerted if the temperature of the water drops below 10°C or exceeds 30°C, the user would simply input "10" into the "Min Water Temp (°C):" entry box and "30" into the "Max Water Temp (°C):" entry box. To save these values so that they officially register with the program, all one needs to do is to press "Save" then confirm by clicking "Yes" in the popup window. This newly saved value will now be the new bound that decides whether the graph and text in Dashboard shows up as red or not, and it will also be stored in config.csv to prevent the user from needing to re-enter all of the bounds if the program restarts. If the user wishes to change all of the inputted values in the entry boxes back to what the saved values were (e.g. if they made changes that they don't want to save or accidentally changed a number), all they need to do is to press the Discard button, which resets all of the entry boxes back to what their last saved values were.

The bottom of the Settings page contains entry boxes that the user can fill in with the phone numbers that they want warning messages to be sent to. Care should be taken to also select the correct phone carrier for the respective numbers, as the process needed to send text messages is a little different for every phone carrier. When a detected sensor value exceeds the parameter bounds specified in config.csv (which are just the values saved from the entry boxes in Settings), all of the numbers inputted in Settings will receive a text message that informs the users of the following:

  • Which parameter is out of bound
  • What the lower and upper bound of that parameter should be
  • What the actual value of that parameter was when it exceeded the bound

The warning message will only be sent once, and a separate message stating that the parameter is back within the safe level will be sent once the detected sensor value is within the bound again. If the users don't get a second message stating that the parameter is now back within the safe level, they should assume that it remained at a dangerous level and check Dashboard to stay updated on what the latest values are. The warning message functionality can be disabled by unchecking the "Enable Emergency Texts" box in the middle of the Settings page.

Video Stream

The Video Stream page contains a canvas in the middle that shows a live stream view from the Raspberry Pi camera module. The video is OFF when the program first starts (the static image displayed is a picture of the camera view when GUI.py first opens), and can be toggled on by pressing the red "Video OFF" button on the bottom of the page. After pressing that button, it should turn green and say "Video ON", and a live stream video should be displayed in the middle. If the user presses the button again, it will turn back to red and freeze the camera view to a static image of whatever the last frame of the camera module was. It is recommended for the user to keep the video off if they are not watching it to preserve CPU on the Raspberry Pi. The amount of CPU the overall program uses at different states of the GUI is roughly the following:

  • Video ON and GUI is displaying the Video Stream page (most CPU, ~57%)
  • Video ON and GUI is displaying a page other than Video Stream (less CPU, ~37%)
  • Video OFF and GUI is displaying any page (least CPU, ~10-20%)

Note: AutoAquaponics Prototype 2.0 was developed on a Raspberry Pi 4, and the amount of CPUs used by the program might not be the same on other versions of Raspberry Pi.

Control Panel

Currently a work in progress and non-functional. The UI of Control Panel will be replaced by something similar to the UI in the Alternate Control Panel page, which is also non-functional at the moment. Prototype 2.0 currently only serves as a monitoring system, and does not allow the user to actuate anything. The controlling aspects of AutoAquaponics will come in future iterations of the program, so stay tuned!

About

NU AutoAquaponics system code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 44.1%
  • Jupyter Notebook 43.3%
  • C++ 11.9%
  • Processing 0.7%