0% found this document useful (0 votes)
5 views

Phase 3

Uploaded by

malaravan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Phase 3

Uploaded by

malaravan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

PHASE 3

SOIL NUTRIENT MONITORING AND MANAGEMENT


IMPLEMENTATION PF PROJECT
To build a Soil Nutrient Monitoring and Management system using an Arduino Uno, you would
typically use sensors like:

• Soil Moisture Sensor – to measure the water content in the soil.


• pH Sensor – to measure the pH level (acidity/alkalinity) of the soil.
• Temperature Sensor (e.g., DHT11 or DS18B20) – to measure the soil temperature.
• Nutrient Sensors (if available, or you can estimate based on soil pH and moisture).

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.

Arduino Code for Basic Soil Nutrient Monitoring:


#include <LiquidCrystal.h> // For 16x2 LCD Display
#include <DHT.h> // For DHT sensor

#define DHTPIN 2 // Pin where DHT11 is connected

#define DHTTYPE DHT11 // Type of DHT sensor

#define moisturePin A0 // Soil Moisture sensor connected to A0

#define pHpin A1 // pH sensor connected to A1

#define buzzerPin 8 // Buzzer connected to pin 8


// LCD Pins: RS, EN, D4, D5, D6, D7

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

DHT dht(DHTPIN, DHTTYPE);

Void setup() {

Lcd.begin(16, 2); // Initialize 16x2 LCD display

Dht.begin(); // Initialize DHT11 sensor

pinMode(buzzerPin, OUTPUT);

lcd.print(“Soil Monitor”);
delay(2000);

lcd.clear();

Void loop() {

// Read Soil Moisture

Int moistureValue = analogRead(moisturePin); // Read moisture level

Float moisturePercent = map(moistureValue, 0, 1023, 0, 100);

// Read pH Value

Int pHValue = analogRead(pHpin); // Read pH sensor value

Float voltage = pHValue * (5.0 / 1023.0); // Convert to voltage

Float pHLevel = 7 + ((2.5 – voltage) / 0.18); // Convert voltage to pH level


// Read Temperature from DHT11 sensor

Float temperature = dht.readTemperature();

// Check if any reading failed

If (isnan(temperature)) {
Lcd.setCursor(0, 0);

Lcd.print(“Temp: Error “);

} else {

Lcd.setCursor(0, 0);
Lcd.print(“Temp: “);

Lcd.print(temperature);

Lcd.print(“ C “);

// Display soil moisture and pH

Lcd.setCursor(0, 1);

Lcd.print(“Moist: “);

Lcd.print(moisturePercent);
Lcd.print(“% “);

Lcd.setCursor(8, 1);

Lcd.print(“pH: “);

Lcd.print(pHLevel, 1);

// Alert if pH or Moisture is out of range

If (moisturePercent < 30 || pHLevel < 6 || pHLevel > 8) {

digitalWrite(buzzerPin, HIGH); // Turn on the buzzer

} else {

digitalWrite(buzzerPin, LOW); // Turn off the buzzer

Delay(2000); // Update every 2 seconds


}

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.

You might also like