Mod edit, see also:
Description: A system that monitors soil moisture and environmental conditions to ensure optimal plant health.
Improvements:
Improvements Over Traditional Plant Monitors:
- IoT connectivity to view data online or in a mobile app (e.g., Blynk or IFTTT webhook).
- Automated watering via soil moisture readings.
- Shows both temperature and humidity with a DHT11 sensor.
- Can be solar-powered for outdoor use (optional upgrade).
Required Components:
Component | Quantity |
---|---|
Arduino Uno | 1 |
DHT11 Temperature/Humidity Sensor | 1 |
Soil Moisture Sensor | 1 |
ESP8266 Wi-Fi Module | 1 |
Relay Module (5V) | 1 |
Mini Water Pump | 1 |
Jumper Wires & Breadboard | as needed |
5V Power Source | 1 |
Circuit Diagram (Explanation):
hereβs how to wire it:
Soil Moisture Sensor:
- VCC β 5V on Arduino
- GND β GND
- A0 β A0 on Arduino
DHT11 Sensor:
- VCC β 5V
- GND β GND
- OUT β Pin 2
Relay Module:
- VCC β 5V
- GND β GND
- IN β Pin 7
- COM β One side of pump power line
- NO (Normally Open) β Pump +ve terminal
- Pump -ve β GND / external battery
ESP8266 Wi-Fi Module:
- VCC β 3.3V (Use 3.3V regulator if needed)
- GND β GND
- TX β RX (via voltage divider)
- RX β TX
Arduino Code (Blynk/Serial Version):
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
int soilMoisturePin = A0;
int relayPin = 7;
int moistureThreshold = 500; // Tune this value as per soil sensor range
void setup() {
Serial.begin(9600);
dht.begin();
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, LOW); // Ensure pump is off at startup
}
void loop() {
float temp = dht.readTemperature();
float humidity = dht.readHumidity();
int soilMoisture = analogRead(soilMoisturePin);
Serial.print("Temperature: "); Serial.print(temp); Serial.println("Β°C");
Serial.print("Humidity: "); Serial.print(humidity); Serial.println("%");
Serial.print("Soil Moisture: "); Serial.println(soilMoisture);
if (soilMoisture > moistureThreshold) {
digitalWrite(relayPin, HIGH); // Turn on water pump
Serial.println("Soil is dry - Watering Plant...");
delay(5000); // Water for 5 seconds
digitalWrite(relayPin, LOW);
} else {
Serial.println("Soil is moist - No watering needed.");
}
delay(10000); // Wait 10 seconds before next reading
}
Optional: Blynk / IoT Platform Integration
You can use this system with Blynk or IFTTT Webhooks to view data in a mobile app. Let me know if you want the version with full Blynk code and setup!
How to Use:
- Upload the code to your Arduino Uno.
- Connect components as per the wiring above.
- Power on the system and open the Serial Monitor (9600 baud).
- Watering will automatically happen if soil is dry.
- (Optional) Connect ESP8266 and send data online.