This project provides a comprehensive monitoring and notification system for an aquaponics setup, including sensor data collection, logging, web streaming, and automated email alerts.
- bme680_ts.py: Reads temperature, humidity, and barometric pressure from a Bosch BME680 sensor via I2C.
- liquid_level_sensor_ts.py: Detects water/liquid level using a GPIO-connected sensor.
- temp_water_sensor_ts.py: Measures water temperature.
- ph_sensor_ts.py: Reads and calibrates pH sensor data, with command-line options for calibration and testing.
- sensors_ts.py: Main script for collecting sensor data, averaging readings, sending data to ThingSpeak, and managing email notifications.
- sensors_with_scheduled_emails.py: Enhanced version of
sensors_ts.py
with scheduled email capabilities and improved error handling. - scheduled_status_update.py: Sends scheduled or daily summary status updates via email.
- log_manager.py: Interactive utility for managing, viewing, and cleaning log files.
- email_notification.py: Handles sending email notifications and alerts.
- aquaponics_config.py: Stores configuration constants (intervals, email settings, etc.).
- api_key_ts.py: Stores API keys (e.g., for ThingSpeak).
- ph_calibrate.py: Utility for calibrating the pH sensor and saving calibration data.
- web_stream.py: Runs a web server to stream live video from a camera using MJPEG.
- ph_calibration.json: Stores calibration data for the pH sensor.
- html_templates/: Contains HTML templates for email notifications and status reports.
- logs/: Directory for log files generated by the system.
- Run
sensors_ts.py
to start sensor monitoring and notifications. - Use
web_stream.py
to start the live camera stream. - Use
log_manager.py
to view and manage logs. - Calibrate the pH sensor with
ph_calibrate.py
.
Our set up uses a Raspberry Pi 5 with Bookworm 64-bit.
-
Install latest Raspberry Pi OS using these steps: Raspberry Pi Getting Started Guide (Bookworm)
-
sudo raspi-config
-
- Interface Options
- Enable i2c
- Enable 1-Wire interface
-
-
Clone the repository.
# Change to the home directory.
cd ~
# Clone the repository.
git clone https://github.com/wnccnasa/FishCam.git
- Create a virtual environment.
cd FishCam
python -m venv .venv
source .venv/bin/activate
- Update pip.
python -m pip install --upgrade pip
- Install requests for ThingSpeak uploads.
pip install requests
- Install sensor libraries
# Install bme680 for temperature, humidity and barometric pressure sensor.
pip install bme680
# Water temperature sensor.
pip install w1thermsensor
# Install GPIO Zero library for GPIO access for liquid level sensor.
pip install gpiozero lgpio pigpio RPi.GPIO
- Install sensor_ts.service
sudo bash install-sensors_ts-server.sh
# Look at the logs to see if there are any issues.
sudo systemctl status sensors_ts.service
sudo journalctl -u sensor_ts.service -n 200
# Restart service
sudo systemctl restart sensors_ts.service
- Set journald limits to conserve diskspace
sudo bash install_journald_limits.sh
# Install opencv for camera streaming.
pip install opencv-python
# Update code
cd FishCam
git pull https://github.com/wnccnasa/FishCam.git