Greenhouse Companion
An Android app that monitors and controls greenhouse environmental conditions via ESP8266.
Greenhouse Companion
Greenhouse Companion is an Android application written in Kotlin that allows users to monitor and control environmental conditions in their greenhouse. The app connects to an ESP8266 microcontroller equipped with sensors for temperature, humidity, and soil moisture, as well as actuators including a water pump and fan. The application provides a simple, user-friendly interface to view sensor data and control the actuators remotely.
Project Overview
This project demonstrates the integration of mobile app development with IoT hardware control. The ESP8266 serves as a web server that exposes sensor data and actuator controls through HTTP endpoints, while the Android app communicates with these endpoints to provide real-time monitoring and remote control capabilities.
System Architecture
Hardware Components
The greenhouse system is built around an ESP8266 microcontroller that manages multiple sensors and actuators:
- DHT11 Sensor: Temperature and humidity monitoring
- Soil Moisture Sensor: Real-time soil moisture detection
- Water Pump: Automated irrigation control
- Cooler Fan: Temperature regulation and ventilation
- ESP8266 Microcontroller: Central control unit with WiFi connectivity and built-in web server
Android Application
The Kotlin Android application features:
- Real-time Monitoring: Live temperature, humidity, and soil moisture level display
- Remote Control: Direct control of fan and water pump from the app
- Notifications: Alerts for extreme environmental conditions
- Modern UI: Built with Jetpack Compose for a clean, intuitive interface
- HTTP Communication: Uses Retrofit for efficient API communication
Key Features
Real-time Monitoring
- Live Sensor Data: View current temperature, humidity, and soil moisture levels
- Data Visualization: Clean interface displaying all environmental parameters
- Status Indicators: Visual feedback for system status and sensor readings
Remote Control
- Actuator Control: Direct control of water pump and fan from the mobile app
- Manual Override: Ability to manually trigger watering or ventilation
- Real-time Response: Immediate feedback when controls are activated
Smart Notifications
- Condition Alerts: Automatic notifications for extreme environmental conditions
- Threshold Monitoring: Pre-set thresholds for temperature, humidity, and moisture
- Proactive Alerts: Early warning system for potential plant health issues
Technical Implementation
ESP8266 Web Server
The ESP8266 runs an async web server that handles:
- Sensor Data Endpoints: GET requests to retrieve current sensor readings
- Actuator Control: POST requests to control water pump and fan
- WiFi Connectivity: Automatic connection to local network
- Real-time Updates: Continuous sensor monitoring and data serving
Android Development
The Kotlin application utilizes:
- Jetpack Compose: Modern declarative UI framework
- Retrofit: Type-safe HTTP client for API communication
- Material Design: Clean, intuitive user interface
- Background Services: Continuous monitoring and notification delivery
Communication Protocol
The system uses a simple HTTP-based communication protocol:
- GET Requests: Retrieve current sensor data from ESP8266
- POST Requests: Send control commands to actuators
- JSON Data Format: Structured data exchange between app and hardware
- Local Network: Direct communication over WiFi without external dependencies
Requirements
Hardware Requirements
- ESP8266 microcontroller
- DHT11 temperature and humidity sensor
- Soil moisture sensor
- Water pump for irrigation
- Cooler fan for ventilation
- Matching WiFi network connection
Software Requirements
- Android device or Android Studio emulator
- Kotlin development environment
- Arduino IDE for ESP8266 programming
Project Impact
Greenhouse Companion demonstrates practical IoT development skills, combining embedded systems programming with modern mobile app development. The project showcases the ability to create end-to-end solutions that bridge hardware and software, making advanced plant care accessible through intuitive mobile interfaces.
This project highlights skills in Kotlin development, Jetpack Compose UI design, HTTP API integration, Arduino programming, and IoT system architecture.