A professional, cloud-connected ecosystem for precision greenhouse management.
Greenhouse Tender is a robust IoT solution designed to monitor and control your greenhouse environment in real-time. By bridging low-level hardware sensors with a high-performance Flutter mobile application via Firebase, it provides a seamless, "mission-control" experience for the modern gardener.
- Dark Mode UI: A sleek, battery-friendly interface designed for high contrast and readability.
- Real-Time Data: Instant updates for Temperature, Humidity, Soil Moisture, and pH levels using Firestore real-time listeners.
- Visual Health Indicators: Cards change color (Green/Red) dynamically based on user-defined safety thresholds.
- Bi-Directional Control: Toggle Fans, Vents, and Heaters directly from the app.
- State Feedback: Buttons glow green only when the device confirms it is active, ensuring true state synchronization.
- Live Video Feed: Integrated low-latency video streaming from an ESP32-CAM to keep an eye on your plants from anywhere.
- Data Aggregation: Cloud Functions merge incoming MQTT sensor streams into a single "latest status" document to prevent UI flickering.
- Smart Alerts: Automated Firebase Cloud Messaging (FCM) push notifications when environmental conditions drift out of safe ranges.
- History Logging: Separate scalable storage for historical sensor data to support future analytics.
The system follows a reactive, event-driven architecture:
graph LR
subgraph Greenhouse
ESP32[ESP32 Controller] -- MQTT --> Broker[HiveMQ Broker]
Cam[ESP32-CAM] -- HTTP Stream --> App
end
subgraph Cloud
Broker -- Webhook --> Func[Cloud Functions]
Func -- Write --> Firestore[(Firestore DB)]
Firestore -- Listen --> App[Flutter App]
App -- Write Command --> Firestore
Firestore -- Trigger --> Func
Func -- Publish Command --> Broker
Broker -- Subscribe --> ESP32
end
- Microcontroller: ESP32 DevKit V1
- Video: ESP32-CAM (AI-Thinker)
- Sensors: DHT22 (Temp/Hum), Capacitive Soil Moisture, Analog pH Sensor (SEN0161), DS18B20 (Probe)
- Actuators: 4-Channel 5V Relay Module
- Language: C++
- Framework: Arduino / PlatformIO
- Libraries:
PubSubClient(MQTT),Adafruit_SSD1306(OLED),DHT
- Runtime: Node.js (Firebase Cloud Functions)
- Database: Google Cloud Firestore (NoSQL)
- Messaging: HiveMQ (MQTT Broker) + Firebase Cloud Messaging (FCM)
- Framework: Flutter (Dart)
- Dependencies:
cloud_firestore,flutter_vlc_player,fl_chart,google_fonts,font_awesome_flutter
greenhouse-monitoring/
โโโ esp32-firmware/ # C++ firmware for sensor reading & relay control
โโโ esp32-cam-firmware/ # C++ firmware for video streaming server
โโโ cloud-functions/ # Node.js backend logic (triggers, aggregation)
โโโ flutter-app/ # Production-ready mobile application
โ โโโ lib/
โ โ โโโ widgets/ # Reusable UI components (SensorCard, ControlRow)
โ โ โโโ main.dart # Main entry point & dashboard logic
โโโ docs/ # Wiring diagrams and datasheets
โโโ README.md # Project documentation- Open
esp32-firmwarein VS Code with the PlatformIO extension. - Rename
include/config.h.templatetoinclude/config.hand add your WiFi/MQTT credentials.- Note: The firmware is configured for Secure MQTT (SSL/TLS) on port 8883. Ensure your broker supports this (e.g., HiveMQ Cloud).
- Build and Upload to your ESP32.
- Repeat for
esp32-cam-firmware.
- Navigate to
cloud-functions:cd cloud-functions npm install - Deploy to Firebase:
firebase deploy --only functions
- Navigate to
flutter-app:cd flutter-app flutter pub get - Update the camera IP in
lib/main.dart(line 60). - Run the app:
flutter run
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Pat Ryan - GitHub Profile
Project Link: https://github.com/secretengineer/Greenhouse-Tender-2