The GrowHub IoT Documentation is licensed under Creative Commons
CC BY-NC-SA 4.0.
GrowHub IoT System is an advanced platform for real-time monitoring and management of hydroponic crops. It captures and processes four critical variablesโtemperature, pH, Total Dissolved Solids (TDS), and Electrical Conductivity (EC)โessential for maintaining optimal growing conditions. The system integrates data mining techniques to transform raw analog signals from sensors into structured JSON objects, ready for analysis and decision-making.
Sensor readings are dynamically processed in C++ and encapsulated into JSON objects, transmitted via MQTT every 4โ8 seconds. These objects undergo serialization, deserialization, cleaning, and standardization to ensure data consistency and reliability. A Python microservice, built with Flask, manages the data pipeline, storing the cleaned JSON objects into NoSQL databases hosted on AWS (Mongo) and GCP (Firebase).
GrowHub's modular architecture and real-time visualizations powered by Plotly enable farmers to monitor trends, identify issues, and optimize their operations. This seamless integration of IoT, cloud technologies, and data processing establishes GrowHub as a key tool for precision and sustainable agriculture.
GrowHub IoT tackles challenges in modern agriculture through its core capabilities:
๐ Real-Time Data Collection
GrowHub IoT monitors key hydroponic variables such as temperature, pH, TDS, and EC using high-precision sensors. These readings are processed and displayed on dynamic dashboards for actionable insights.๐ Secure Data Transmission
GrowHub IoT employs MQTT for reliable data transfer. While TLS encryption is supported, the current implementation focuses on device authentication using "bcrypt" for secure access to topics.โ๏ธ Cloud Integration
Data is stored and managed in MongoDB (AWS) and Firestore (Google Cloud Platform), allowing scalable and redundant storage with real-time synchronization.๐ Interactive Visualization
The system's dashboards, built with Plotly, provide intuitive, real-time charts that help users analyze trends and optimize hydroponic performance.๐ง Modular Architecture
Designed to scale with your needs, GrowHub IoT allows for seamless integration of new sensors and functionalities without interrupting operations.Functional = ๐ฉ | Partially Functional = ๐จ | Non-Functional = ๐ฅ | Future Implementations = ๐ฆ |
---|
Feature | Description | ๐ฉ | ๐จ | ๐ฅ | ๐ฆ |
---|---|---|---|---|---|
Real-Time Data Collection | Collects sensor data in real-time | ๐ฉ | |||
Additional Sensor Types | Support for more sensor types | ๐ฆ | |||
Secure Data Transmission | Securely transmits data | ๐จ | |||
TLS Encryption | Adds TLS encryption for security | ๐ฅ | |||
Cloud Integration | Stores data in the cloud | ๐ฉ | |||
Multi-Cloud Support | Supports multiple cloud providers | ๐ฅ | |||
Interactive Visualization | Real-time data visualization | ๐ฉ | |||
Advanced Analytics | Provides advanced data analytics | ๐ฆ | |||
Modular Architecture | Easily integrates new components | ๐จ | |||
Automatization & Control | Multi-variable control mechanization | ๐ฆ |
GrowHub IoT is the culmination of a long and intensive journey of research, learning, and development. As a one-man army, I have single-handedly designed, implemented, and tested every aspect of this project. This public release represents a polished version derived from a private repository with over 100+ commits, reflecting countless hours of experimentation, coding, debugging, and iteration.
While many functionalities are operational, not all have been developed to the level of refinement I originally envisioned. Some features remain partially implemented due to time constraints, while others are potential ideas that I couldn't explore, such as predictive analytics through neural networks to provide recommendations for crop management. The result is a functional and modular system, but also a testament to the challenges and opportunities in working as a solo developer on a multidisciplinary project.
GrowHub is not just a software solution; it is a Research and Development (R&D) project with environmental and social goals. Throughout this process, I delved into topics far beyond software development, studying agricultural sciences and biotechnology to understand the intricacies of hydroponic systems. This learning journey included evaluating technologies that ultimately did not make it into GrowHub due to compatibility or feasibility issues. The system you see today is the outcome of this explorationโa balance between ambition, technical constraints, and a commitment to creating a meaningful tool for sustainable agriculture.
Ensure the following are available for deploy:
- We strongly recommend to use Linux machine and a Conda environment with Python 3.7 or higher.
- Booteable MicroSD with Raspberry Pi OS (or any other 32-bit ARM Debian-based distribution, like 'Twister OS')
- At least one ESP8266MOD compatible with Arduino IDE to flashing GrowHub firmware (more information on 'Hardware Setup' below).
- Network infrastructure with a dedicated Access Point or a physical router acting as a switch to ensure robust MQTT communication between devices.
-
Clone the Repository
git clone https://github.com/rmardonesa/growhub.git cd growhub
-
Set Up Virtual Environment and Install Dependencies
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Configure Environment Variables
cp .env.example .env nano .env
-
Initialize the Database
python init_db.py
-
Run the Application
python app.py
Access the application at
http://localhost:5000
.
๐ก Advanced Configuration
To check the status of the Flask application and run it with specific options, use the following commands
View Flask Logs:
tail -f flask.log
Run Flask:
flask run --host=0.0.0.0 --port=5000
Database Configuration
The default SQLite database provided by the software is basic and just a template. Users can enhance its complexity after running init_db.py. For example, you can add more tables, indexes, or migrate to a more robust database system like PostgreSQL or MySQL.
Migrate to PostgreSQL:
pg_dump -U postgres -d old_db > old_db.sql
psql -U postgres -d new_db < old_db.sql
- Open
sensors.ino
in Arduino IDE. - Update WiFi and MQTT broker settings.
- Flash the ESP8266 with the updated code.
๐ Sensor Calibration Details
Calibrate sensors for pH, TDS, and temperature to ensure precision.
Watch this tutorial for pH sensor calibration (most important sensor of GrowHub IoT System):
https://youtu.be/zUEl3Y3yKL4 (credits to Electronic Clinic, the video uploader)
Module | ESP8266MOD Pin | Description |
---|---|---|
OneWire (DS18B20) | GPIO2 (D4) | Analog input |
OneWire (DS18B20) | 3.3V | Power supply |
OneWire (DS18B20) | GND | Ground |
pH Sensor (Analog) | A0 | Analog input |
3.3V | Power supply | |
pH Sensor (Analog) | GND | Ground |
pH Sensor (Digital) | GPIO0 (D3) | Digital input |
pH Sensor (Digital) | 3.3V | Power supply |
pH Sensor (Digital) | GND | Ground |
EC/TDS Sensor (Analog) | GPIO4 (D2) | Analog input |
EC/TDS Sensor (Analog) | 3.3V | Power supply |
EC/TDS Sensor (Analog) | GND | Ground |
- Install Mosquitto MQTT broker:
sudo apt-get update sudo apt-get install mosquitto mosquitto-clients
- Configure using
mqtt.sh
script:./mqtt.sh
๐ก MQTT Broker Customization
Customize the MQTT broker settings to fit your network infrastructure. You can configure the Mosquitto MQTT broker using the provided
Set up Firewall Rules:
sudo ufw allow 5000/tcp
sudo ufw allow 1883/tcp
sudo ufw enable
Start Mosquitto Service:
sudo systemctl start mosquitto
Check Mosquitto Status:
sudo systemctl status mosquitto
View Mosquitto Logs:
sudo journalctl -u mosquitto -f
Execute GrowHub MQTT Manager:
sudo bash
cd <GrowHub BashScript directory>
./mqtt.sh
We welcome contributions! Follow these steps:
-
Fork the Repository
git checkout -b feature/your-feature
-
Implement Your Changes
-
Commit and Push
git push origin feature/your-feature
-
Open a Pull Request
๐งญ Contribution Guidelines
Rule | Description |
---|---|
I | Adhere to Coding Standards: Ensure your code follows the project's coding standards and style guidelines. Use linters and formatters where applicable. |
II | Document Your Changes: Update the documentation to reflect your changes. This includes comments in the code, updates to README.md, and any other relevant documentation files. |
III | Update CHANGELOG.md: Add a summary of your changes to the CHANGELOG.md file, including any new features, bug fixes, or breaking changes. |
IV | Perform Thorough Testing: Before submitting your pull request, thoroughly test your changes to ensure they work as expected and do not introduce new issues. |
V | Follow Commit Message Guidelines: Write clear and concise commit messages that describe the changes made. Use the imperative mood and present tense. |
VI | Engage in Code Reviews: Be responsive to feedback during the code review process. Address any comments or requested changes promptly and engage in constructive discussions. |
VII | Respect the Project's License: Ensure that your contributions comply with the project's licensing terms and do not introduce any incompatible licenses. |
This project is released under two licenses:
๐ BSD 3-Clause License
Copyright (c) 2024, Rodrigo MardonesType | Description |
---|---|
โ Commercial Use | This software can be used for commercial purposes. |
โ Modification | You can modify the software and create derivative works. |
โ Distribution | You can distribute the original or modified versions of the software. |
โ Private Use | You can use the software for private purposes. |
โ Liability | The authors are not liable for any damages arising from the use of the software. |
โ Warranty | The software is provided "as is", without any warranty. |
You must give appropriate credit, provide a link to the license, and indicate if changes were made. |
๐ Creative Commons BY-NC-SA 4.0
CC Attribution-NonCommercial-ShareAlike 4.0 International LicenseType | Description |
---|---|
โ Sharing | You can copy and redistribute the material in any medium or format. |
โ Commercial Use | You may not use the material for commercial purposes. |
โ Modification | You can remix, transform, or build upon the material, as long as you distribute your contributions under the same license as the original. |
You must give appropriate credit, provide a link to the license, and indicate if changes were made. | |
You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. |
This project integrates open source technologies, thanks to all developers of those tools, libraries and frameworks that make GrowHub possible
๐ Additional Credits
Diego Salas, Digital Designer of GrowHub's logo, he did a great job!
Sometimes communication between developers and designers is not easy, but you understood my project's identity pretty well, I wish to you the best as a professional, I'm glad to have collaborated with you.
Jorge Arenas, Hydroponics Specialist, with more than 15 years of experience!
In addition to being a successful businessman, he is a promoter of clean energy, creator of jobs for people, and has maintained a social role throughout his admirable career.