If you work in the agriculture sector, you understand how challenging it can be to determine the right time to water your plants and whether the soil has enough moisture to stop watering. The irrigation system you use plays a crucial role in the healthy growth of your plants. This is why implementing a smart irrigation system is essential for modern agriculture.
- Detecting the amount of water which is inside the soil.
- Turn on and off the irrigation system depending on the water needed in soil.
- MPK kit
- Capacitive Soil moisture sensor
- 12V Adapter supply
- 12V Pump
Figure: Schematic soil moisture sensor and relay connection
Figure: Components used to make connection on the board
moisture sensor
This Arduino code is designed to control a water pump based on soil moisture levels. Here’s a breakdown of how it works, step-by-step:
Code Breakdown:
- If the moisture value is above the threshold, the code considers the soil dry and:
- Prints “The soil is DRY => turn pump ON” to the Serial Monitor.
- Activates the pump by setting RELAY_PIN to HIGH.
- If the moisture value is below the threshold, the soil is considered wet, and:
- Prints “The soil is WET => turn pump OFF” to the Serial Monitor.
- Deactivates the pump by setting RELAY_PIN to LOW.