Understand your plant needs with soil moisture sensor 🌱

A soil moisture sensor is a device that measures the amount of water in the soil. The sensor consists of a metal probe that is inserted into the soil and a meter that measures the conductivity of the soil. The more water in the soil, the more conductive it is.

Overview


The soil humidity sensor will help you to know who much water is in the soil so you can know when is the best time to water the plants.

Imagine if you also used a water pump with this sensor, then each time the plant is thirsty, the pump will automatically water the plant. while you relax and drink your karak! 

Getting the items


For this project you will need the following components: 

Sale Off
Voltaat Arduino Uno R3 (Voltaat Version)
45 QAR
Sale Off
Voltaat Soil Moisture Sensor
16 QAR

Make sure you also have a breadboard and jumper wires to connect everything together

Sale Off
Voltaat Full-size Breadboard
20 QAR
Sale Off
Voltaat Jumper Wires - Male to Male (40 Pack)
10 QAR
Sale Off
Voltaat Jumper Wires - Male to Female (40 Pack)
10 QAR

Wiring it up


The wiring here is a piece of cake! First, make sure you have the following below and connect is shown in the picture:


Connections:

- Arduino pin GND → Soil moisture sensor GND pin

- Arduino pin 5V → Soil moisture sensor VCC pin

- Arduino pin A0 → Soil moisture sensor A0 pin

Coding


This is a simple sketch to read humidity/moisture level of the soil and display is on a the serial monitor on Arduino IDE.

Learn from this code how to read from the soil sensor and then use it in your gardening project!


  1. /*
  2.   Knowing how much water is in the soil of a plant
  3.  
  4.   Tutorial link: https://www.voltaat.com/blogs/tutorials/understand-your-plant-needs-with-soil-moisture-s
  5.   sketch was written by Voltaat Store
  6.  
  7.   This is a simple sketch to read humidity/moisture level of the soil and display is on a the serial monitor on Arduino IDE
  8.  
  9.   Components Needed: 1. Soil moisture...x1
  10.  
  11.   Connections:
  12.   - Arduino pin GND → Soil moisture sensor GND pin
  13.   - Arduino pin 5V → Soil moisture sensor VCC pin
  14.   - Arduino pin A0 → Soil moisture sensor A0 pin
  15.  
  16. */
  17.  
  18. int soilMoisturePin = A0;// The pin that DHT11 is connected to: Pin A0
  19.  
  20. int moistureLevel ;// To store the moisture level of the soil
  21.  
  22. // This routine run once
  23. void setup()
  24. {
  25. Serial.begin(9600);//opening the serial monitor
  26. }
  27.  
  28. // This routine loops forever
  29. void loop()
  30. {
  31. moistureLevel = analogRead(soilMoisturePin);//read from the sensor and store in the moistureLevel variable
  32.  
  33. Serial.print("Moisture Sensor Value: ");
  34. Serial.println(moistureLevel);//display on the serial monitor the moisture level
  35.  
  36. delay(200);// delay for 200 mili sec and then read again
  37. }
  38.  

Testing it out


The code is written in such a way that it will display the moisture level of the soil on the serial monitor of the Arduino IDE. The code makes use of the analog input pin to read the value from the sensor and then displays it on the monitor.


If you open the serial monitor you will find the readings as follows

Resources 


Arduino Code

Fritzing Wiring file

LCD Library

How to become very good 

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et 

How to become very good 

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et 

How to become very good 

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et 

Liquid error: Could not find asset snippets/zend_pre_order_theme_snippet.liquid
Liquid error: Could not find asset snippets/uploadkit.liquid