Finding Soil Moisture In Plants Using Arduino

Introduction

In this article I explain
 about finding soil moisture in plants using ArduinoThese 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
  • Flower pot
  • Wires
Connection

It is a very simple connection for 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 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 separate wire from the Gnd to the plant.
Programming
  1. const int VAL_PROBE = 0; // Analog pin 0  
  2. const int MOISTURE_LEVEL = 250; // the value after the LED goes ON  
  3.    
  4. void setup() {  
  5.     Serial.begin(9600);  
  6. }  
  7.    
  8. void LedState(int state) {  
  9.     digitalWrite(10, state);  
  10. }  
  11.    
  12. void loop() {  
  13.     int moisture = analogRead(VAL_PROBE);  
  14.      
  15.     Serial.println(moisture);  
  16.    
  17.     if(moisture > MOISTURE_LEVEL) {  
  18.         LedState(HIGH);  
  19.     } else   {  
  20.         LedState(LOW);  
  21.     }  
  22.     delay(100);  
  23. }  
Explanation
  • 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.
 Output
 
  
                     
                                        Figure 1: Output
 
Read more articles on Arduino:

Up Next
    Ebook Download
    View all
    Learn
    View all