The Project OMEGA Sensor Module is a key component of the larger project titled "Hydroponics Based Precision Farming with Feature Optimization." This project aims to automate and optimize the farming process in hydroponic systems using the ESP8266 microcontroller. The OMEGA Sensor Module focuses on gathering critical environmental data, including temperature, humidity, light intensity, and water levels, to monitor and maintain optimal growing conditions in real-time.
The primary objective of this module is to collect real-time sensor data and transmit it to the ThingSpeak cloud platform, enabling remote monitoring and analysis of environmental conditions in a hydroponic system. The data collected is essential for making informed decisions to enhance crop yield and optimize resource usage in a controlled environment.
Wemos D1 Mini: The main microcontroller board (based on ESP8266) used to collect and transmit sensor data.
DHT11 Sensor: Used for measuring temperature and humidity inside the hydroponic environment.
Water Level Sensor: Monitors the water levels in the hydroponic reservoir, providing feedback to prevent water shortage or overflow.
LDR (Light Dependent Resistor): Measures the light intensity, ensuring that plants receive adequate lighting for photosynthesis.
The project is developed using PlatformIO and includes the following libraries:
WiFiManager: Simplifies the WiFi connection process, automatically connecting to saved networks or starting an access point for manual setup.
ESP8266WiFi: Provides WiFi functionality for the ESP8266 microcontroller to establish network connections.
DHT: Used to interface with the DHT11 sensor to retrieve temperature and humidity data.
ThingSpeak: Enables seamless communication with the ThingSpeak cloud platform to transmit sensor data for real-time monitoring.
Automatically connects to a WiFi network using WiFiManager or starts an AP for manual configuration.
Reads temperature and humidity data from the DHT11 sensor and checks for reading errors.
Monitors light intensity using the LDR sensor connected to the analog pin A0.
Detects water levels using the Water Level Sensor connected to a digital pin.
Transmits all the collected data to the ThingSpeak cloud for real-time monitoring and analysis.
Built-in LED provides visual feedback on WiFi connection status and data transmission.
To view the data from this module on ThingSpeak:
Create a ThingSpeak account and set up a new channel.
Configure fields to receive the following data:
Field 1: Temperature (in Celsius)
Field 2: Humidity (in %)
Field 3: Light Intensity (from LDR)
Field 4: Water Level (0 for low, 1 for high)
Use the provided API key to send data to ThingSpeak.
This module is an early prototype of a larger hydroponic farming automation system. Future iterations of this project will involve:
Adding automated nutrient dosing and pH adjustment based on sensor feedback.
Implementing predictive analytics using historical data from ThingSpeak to optimize growing conditions.
Extending support for additional sensors and actuators to further automate the farming process.
The Project OMEGA Actuator Module controls various actuators (such as pumps, lights, or fans) in a precision farming environment. The system reads data from the cloud (ThingSpeak), such as water levels, humidity, temperature, or nutrient concentrations, and operates the actuators accordingly. It connects to WiFi automatically, either using saved credentials or by allowing the user to configure the WiFi via an access point (AP).
Connects to a WiFi network using WiFiManager. If no network is configured, it creates an access point for manual configuration.
Communicates with the ThingSpeak cloud platform to retrieve sensor readings and update actuator states.
Reads values from multiple ThingSpeak channel fields and controls actuators based on the data:
Field 5: Controls PWM output on GPIO 5 (analog output).
Field 6: Controls PWM output on GPIO 4 (analog output).
Field 7: Controls PWM output on GPIO 0 (analog output).
Field 8: Controls digital output on GPIO D7 or D8 (actuator triggering).
If the actuator is triggered (based on Field 8), the status is updated back to ThingSpeak for tracking.
Automatically restarts and attempts reconnection to the WiFi network in case of failure.
Wemos D1 Mini as the microcontroller (based on ESP8266).
L293D Motor Drivers for controlling motors and actuators.
Opto Isolators for ensuring electrical isolation between the control signals and high-power components.
WiFiManager is used to simplify the process of connecting the ESP8266 to a WiFi network. With this library, the device automatically connects to the last known WiFi network. If the device is unable to connect (e.g., incorrect credentials or network change), it will set up an access point, allowing you to configure the WiFi network manually through a web portal.
Key Features of WiFiManager:
Automatically connects to saved WiFi credentials or provides an access point for manual configuration.
Eliminates the need to hardcode WiFi credentials into the program, allowing easy updates.
If a connection fails, the system restarts and attempts to connect again, ensuring reliability.
Supports setting custom SSID and password for the access point, enhancing security.
ThingSpeak is an open IoT platform that allows easy data communication between devices and the cloud. In this project, the ThingSpeak library is used to read data from specific fields of a ThingSpeak channel and control actuators accordingly. The actuators could be various devices like water pumps, lights, fans, etc., depending on the requirements of the hydroponic farming system.
Key Features of ThingSpeak Library:
Enables ESP8266 to read data from multiple fields of a ThingSpeak channel (e.g., sensor readings).
Allows writing data back to the ThingSpeak channel to log actuator status or update fields.
Uses a WiFi client for seamless communication with the cloud.
Provides simple APIs for reading and writing long integer values (used for actuator control in this project).