Finding Soil Moisture In Plants Using Arduino


In this article, I explain about finding soil moisture in plants using Arduino. These days everyone is busy and no one focuses on caring for plants. For this purpose let us see how to find soil moisture in plants.
Parts of list
  • Arduino UNO
  • LED
  • Resistor
  • Flowerpot
  • Wires
It is a very simple connection to the process.
Step 1: Connection for led to Arduino board
  • Take the positive pin in the led connected to the digital pin of 10 to the Arduino board.
  • Take the negative pin in the led connected to the Gnd to the Arduino board.
Step 2: Connection for the resistor to Flower pot and Arduino
  • The positive side can be connected to the 5v of the Vcc from the Arduino board.
  • The negative side can be connected to the Analog pin of the A0. 
Step 3:
  • Finally take a separate wire from the Gnd to the plant.
  1. const int VAL_PROBE = 0; // Analog pin 0    
  2. const int MOISTURE_LEVEL = 250; // the value after the LED goes ON    
  4. void setup() {    
  5.     Serial.begin(9600);    
  6. }    
  8. void LedState(int state) {    
  9.     digitalWrite(10, state);    
  10. }    
  12. void loop() {    
  13.     int moisture = analogRead(VAL_PROBE);    
  15.     Serial.println(moisture);    
  17.     if(moisture > MOISTURE_LEVEL) {    
  18.         LedState(HIGH);    
  19.     } else   {    
  20.         LedState(LOW);    
  21.     }    
  22.     delay(100);    
  23. }   
  • In this case, the soil can be filled with water and we can check the soil level in the serial monitor.
  • We can see another way of soil level using the potentiometer.
  • In this case, it can work under the range to connect the wire in the soil and check the range.
Figure 1:Output
Read more articles on Arduino: