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.