Phase 3
Phase 3
Components:
1. Arduino Uno.
2. Soil Moisture Sensor.
3. pH Sensor.
4. DHT11 Temperature and Humidity Sensor.
5. 16x2 LCD Display (optional, for real-time monitoring).
6. Buzzer/LED (to alert for specific nutrient requirements).
7. Relay Module (if you plan to manage soil by turning on water pumps or nutrient
injectors).
Features:
• Measure and display soil moisture, pH, and temperature.
• Trigger an alert when soil moisture is low or pH is outside the desired range.
• Automate watering based on moisture levels.
Void setup() {
pinMode(buzzerPin, OUTPUT);
lcd.print(“Soil Monitor”);
delay(2000);
lcd.clear();
Void loop() {
// Read pH Value
If (isnan(temperature)) {
Lcd.setCursor(0, 0);
} else {
Lcd.setCursor(0, 0);
Lcd.print(“Temp: “);
Lcd.print(temperature);
Lcd.print(“ C “);
Lcd.setCursor(0, 1);
Lcd.print(“Moist: “);
Lcd.print(moisturePercent);
Lcd.print(“% “);
Lcd.setCursor(8, 1);
Lcd.print(“pH: “);
Lcd.print(pHLevel, 1);
} else {
Website: https://wokwi.com/projects/410657659180727297
Code Explanation:
1. Moisture Sensor: The moisture sensor outputs an analog value (0-1023), which is mapped
to a percentage (0-100%).
2. pH Sensor: Converts the analog signal to a voltage and then estimates the pH value.
3. DHT11 Sensor: Reads the temperature to monitor the soil condition.
4. Buzzer: Alerts when the soil is either too dry or the pH is outside the desired range.
5. LCD Display: Shows real-time values of temperature, moisture, and pH.