Welcome to the Smart Plant Monitoring System, an IoT-based solution that uses the NodeMCU ESP8266 to monitor and manage plant health. This project measures soil moisture, temperature, and humidity and automatically waters the plant when needed. The system displays real-time data on an LCD display and also features manual control via a push button for watering.
- π‘ IoT-enabled Monitoring: Real-time data collection using DHT11/DHT22 (for temperature & humidity) and Soil Moisture Sensor.
- π§ Automated Watering System: Activates a water pump when soil moisture is low.
- π Live Data Display: Displays temperature, humidity, and soil moisture levels on a 16x2 LCD display.
- π Manual Control: Press the button to manually activate the watering system.
- π Cloud Integration (Future Scope): Plan to integrate with Blynk/ThingSpeak for remote monitoring and control.
- NodeMCU ESP8266
- DHT11/DHT22 Temperature & Humidity Sensor
- Soil Moisture Sensor
- Relay Module
- Water Pump
- 16x2 LCD Display with I2C
- Push Button
- Jumper Wires & Breadboard
- Arduino IDE (Download from Arduino Official Website)
- ESP8266 Board Manager in Arduino IDE
- DHT Sensor Library (by Adafruit)
- LiquidCrystal_I2C Library (by Marco Schwartz)
- Blynk Library (for cloud integration)
The circuit connects the sensors to the NodeMCU as follows:
- Soil Moisture Sensor: A0
- PIR Motion Sensor: D6
- Relay Module: D7
- Push Button: D5
- DHT11 Sensor: D4 Below is the circuit diagram:
- Install Arduino IDE from Arduino Official Website.
- Add ESP8266 Board Manager:
- Open Arduino IDE β Go to File > Preferences
- Add this URL in Additional Board Manager URLs:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
- Install ESP8266 by ESP8266 Community from Board Manager.
Go to Sketch > Include Library > Manage Libraries, then install:
- DHT sensor library by Adafruit
- LiquidCrystal_I2C by Marco Schwartz
- Blynk Library by Blynk
- Connect NodeMCU ESP8266 to your PC via USB.
- Select Board: NodeMCU 1.0 in Tools > Board.
- Select the correct COM Port.
- Upload the
SmartPlant.ino
file.
- Download the Blynk app from Google Play Store or App Store.
- Create a new project in the app, select NodeMCU as the device, and note the Auth Token.
- Replace the
auth[]
variable in the code with your Auth Token from Blynk.
- Power up the system.
- The LCD will display temperature, humidity, and soil moisture.
- If the soil moisture falls below the threshold, the relay will activate the water pump.
- Press the manual button to water the plant manually.
updateDHTSensor()
: Reads temperature and humidity from the DHT11 sensor and displays them on the LCD and sends them to the Blynk app.updateSoilMoisture()
: Reads the soil moisture level and displays it on the LCD.updatePIRSensor()
: Detects motion via PIR sensor and triggers the LED in the Blynk app.checkButtonState()
: Monitors the push button and toggles the relay for manual watering control.
void loop() {
int moisture = analogRead(A0); // Read soil moisture sensor
float temp = dht.readTemperature(); // Read temperature from DHT sensor
float humidity = dht.readHumidity(); // Read humidity from DHT sensor
lcd.setCursor(0, 0);
lcd.print("Temp: "); lcd.print(temp);
lcd.setCursor(0, 1);
lcd.print("Moisture: "); lcd.print(moisture);
if (moisture < threshold) {
digitalWrite(pump, HIGH); // Activate pump if soil moisture is low
} else {
digitalWrite(pump, LOW); // Deactivate pump if soil moisture is sufficient
}
}
(Attach images or a YouTube link of your project in action.)
- π‘ Cloud Integration: Send data to Blynk/ThingSpeak for remote monitoring.
- π± Mobile App Support: Create an app for real-time monitoring.
- πΏ AI-based Recommendations: Suggest optimal watering schedules based on weather data.
Contributions are welcome! Feel free to fork this repository, create a new branch, and submit a pull request.
This project is open-source and licensed under the MIT License.
For any questions or improvements, feel free to reach out!
- Email: hcsarker2002@gmail.com
- GitHub: hcsarker