Skip to content

RMNorbert/AquaTherm

Repository files navigation

AquaTherm

Python Tkinter SQLAlchemy Flask Prometheus Grafana

jQuery SQLite Docker Arduino Raspberry Pi Digi

usb

License: MIT Last Commit

AquaTherm


Table of content:


Description

AquaTherm is a project that designed to revolutionize aquarium management by ensuring precise control over temperature and water levels. While offering both Desktop and Web GUIs, involves sensor readings, collecting sensor reading data, performing analysis, taking appropriate actions according to collected data and communicating with other systems for further processing, by utilizing and connecting multiple Arduino and Raspberry-related products to multiple devices through USB, Wi-Fi or Radio communication.


Used Technologies And Packages


Features

AquaTherm offers a range of features that make it a powerful tool for managing sensor data and automating actions:

  • Temperature and Humidity Reading, Displaying, and Management

  • Automated Actions for Specific Scenarios:

    • Decreasing Temperature, Increasing Aquarium Water Level

Used Sensors

  • DHT22 : A pre-calibrated, SWI digital sensor with fast response time used to measure temperature and humidity.

    Measurement capabilities with a high degree of accuracy:

    • Temperature with a range of -40°C to 80°C (-40°F to 176°F).
    • Relative humidity within a range of 0% to 100% RH.

    Operating voltage:

    • Compatible with 3.3V or 5V power supplies.
  • SR04 AKA HC-SR04: An Ultrasonic Sensor used to measure distance.

    Measurement capabilities:

    • Used for measuring distances in the range of 2 cm (0.79 inches) to 400 cm (157.5 inches).
    • Typical accuracy of about ±1 cm.

    Operating voltage:

    • Compatible with 3.3V or 5V power supplies.

Getting Started

- The Arduino Software (IDE) was used during the creation of the sensor controlling releated codes.

To upload the codes to the board('s) :

  1. Download and install the Arduino Software IDE.
  2. Connect your Arduino board to your device.
  3. Open the Arduino Software (IDE).

The Arduino Integrated Development Environment - or Arduino Software (IDE) - connects to the Arduino boards to upload programs and communicate with them. Programs written using Arduino Software (IDE) are called sketches. These sketches are written in the text editor and are saved with the file extension .ino.

  1. Select the right board & port. This is done from the toolbar. Make sure you select the board that you are using. If you cannot find your board, you can add it from the board manager in the sidebar.
  2. To upload the code to your board, simply click on the arrow in the top left corner. This process takes a few seconds, and it is important to not disconnect the board during this process. If the upload is successful, the message "Done uploading" will appear in the bottom output area.
  3. Once the upload is complete, you can use the board with the sensors specified in the Used Sensor section.

- For Raspberry Pi: To upload the codes to the board('s) :

  1. Download and install the Raspberry Pi Imager and follow the instructions provided on the official page.
  2. After the installation you can use the board with the sensors specified in the Used Sensor section.

In either cases both the pin in the sensor controller files and baud rate can be customized in both the sensor controller files and the python files in ./sensor/arduino directory and the ./sensor/raspberry directory if the values i used are not adequate. The pins(2 - temperature and humidity, 13 - distance, 3 - fan , 5 - tap) the baud rate 115200

- For Radio Communication :

  1. 2 Xbee Radios modell, to program the radios, a SparkFun USB Explorer needed and finally an Xbee Shield. The shield allows you to plug the Xbee radio into the Arduino.
  2. Download and install the XCTU software to program the radios. AES encryption can be created during the configuration of the connected radio.
  3. Set the port and the baud rate .

- To get started with AquaTherm, make sure you meet the following prerequisites:

  • Python installed on your machine. Download Python from the official website and follow the installation instructions.

If you plan to deploy AquaTherm using Docker containers, follow these steps:

Install Docker:

After installing Docker, ensure it's running by opening a terminal or command prompt and running the command docker --version.

Note: Docker is optional and recommended for deployment scenarios. If you're using Docker, it can help manage dependencies and ensure consistent environments.


Installation

1. Clone the repository:

Start by cloning the AquaTherm repository to your local machine. Open a terminal or command prompt and run the following command:

git clone https://github.com/RMNorbert/AquaTherm.git

install the required packages with the following command:

pip install -r requirements.txt

if raspberry sensors used install the the required package with the following command: bash

pip install adafruit-circuitpython-dht

C library for interacting with Linux GPIO device:

sudo apt-get install libgpiod2

2. A, Run the Desktop app with:

bash

python3 main.py

2. B, Run the Web app with:

python3 web_app.py

Access the application: Once the Web app is running, you can access it in your web browser at http://localhost:5000.

2. C, Run the dockerized version with:

  • Navigate to the project directory containing the docker-deploy.yml file.
  • Run the command docker-compose up --build to build and start the project.

The docker-deploy.yml file defines the services and configurations needed for running your application in a Docker container. It simplifies deployment and ensures consistent setups across environments.

Access the application:

Once the Web app is running, you can access it in your web browser at http://localhost:5000.

Access Prometheus at http://localhost:9090

Grafana at http://localhost:3000


License

This project is licensed under the MIT License - see the License file for details.

Then sensor controller files can be simulated on https://wokwi.com/ or with the VS code extension named : Wokwi Simulator