scieee AI-readable full text Open interactive document viewer

A Microcontroller-Based Approach to Optimizing Soil Moisture for Increased Agricultural Productivity

International Journal on AdHoc Networking Systems (IJANS)

Abstract

Agriculture is a fundamental sector in Bangladesh, playing a crucial role in employment generation and driving key economic objectives such as poverty reduction, human capital development, and food security. Despite its significance, many smallholder farmers face challenges with inefficient irrigation methods, primarily due to the absence of precise soil moisture monitoring. This often leads to improper water usage and lower crop productivity. To tackle this issue, this paper presents an affordable and practical automated soil moisture detection system tailored for small-scale farmers. Utilizing a buzzer and LED indicators, the system provides real-time updates on soil moisture levels, enabling farmers to make well-informed irrigation decisions. By optimizing water use, it enhances crop health and boosts overall agricultural efficiency. The system is built on an Arduino-based framework featuring the ATmega328 microcontroller, which receives data from soil moisture sensors that continuously assess soil conditions. This innovation not only improves resource management but also fosters sustainable farming practices. Due to its affordability and ease of implementation, the system serves as a valuable tool for farmers in resource-limited settings.

Full text

International Journal on AdHoc Networking Systems (IJANS) Vol. 15, No.1/2, April 2025 DOI:10.5121/ijans.2025.15202 11 A MICROCONTROLLER-BASED APPROACH TO OPTIMIZING SOIL MOISTURE FOR INCREASED AGRICULTURAL PRODUCTIVITY Md. Faysal Ahmed 1, Md. Firoz Ahmed 1, M. Hasnat Kabir 1, Md. Arifur Rahman 2, Mirza A.F.M. Rashidul Hasan 1, Aurangzib Md. Abdur Rahman 1, Md. Matiqul Islam 1 and Mst. Shahida Akter 3 1 Department of Information and Communication Engineering, University of Rajshahi, Rajshahi 6205, Bangladesh 2 Department of Electrical and Electronic Engineering, First Capital University of Bangladesh 3 Department of ICT, Upazila Office, Mohanpur, Rajshahi, Bangladesh ABSTRACT Agriculture is a fundamental sector in Bangladesh, playing a crucial role in employment generation and driving key economic objectives such as poverty reduction, human capital development, and food security. Despite its significance, many smallholder farmers face challenges with inefficient irrigation methods, primarily due to the absence of precise soil moisture monitoring. This often leads to improper water usage and lower crop productivity. To tackle this issue, this paper presents an affordable and practical automated soil moisture detection system tailored for small-scale farmers. Utilizing a buzzer and LED indicators, the system provides real-time updates on soil moisture levels, enabling farmers to make well-informed irrigation decisions. By optimizing water use, it enhances crop health and boosts overall agricultural efficiency. The system is built on an Arduino-based framework featuring the ATmega328 microcontroller, which receives data from soil moisture sensors that continuously assess soil conditions. This innovation not only improves resource management but also fosters sustainable farming practices. Due to its affordability and ease of implementation, the system serves as a valuable tool for farmers in resource-limited settings. KEYWORDS Agriculture, Buzzer, LED, ATmega328 microcontroller 1. INTRODUCTION In recent years, the agricultural landscape in Bangladesh has faced significant challenges due to climate variability, intensifying the importance of adopting innovative technologies to enhance productivity. Agriculture plays a crucial role in Bangladesh's economy, making it vital to optimize practices amid increasing food and water demand, particularly as approximately 61.2% of land remains cultivable despite ongoing declines influenced by urbanization and population pressures. Advanced approaches, such as microcontroller-based soil moisture management systems, have garnered attention as effective solutions for improving irrigation efficiency and ensuring crop resilience against adverse weather phenomena (Majumder et al., 2023; Kanimozhi & Vadivel, 2024). The current state of agricultural practices necessitates a paradigm shift toward precision agriculture, where real-time data collection and automated irrigation systems come into play. International Journal on AdHoc Networking Systems (IJANS) Vol. 15, No.1/2, April 2025 12 Studies emphasize that integrating soil moisture sensors and IoT technology can significantly enhance decision-making regarding irrigation timing and volume, directly correlating with increased crop yield and resource savings (Pramanik et al., 2023; Duangsuwan & Promwong, 2023; Surve et al., 2024). For instance, the implementation of automated systems utilizing Arduino microcontrollers has demonstrated tangible benefits in optimizing water usage while minimizing waste during irrigation cycles (Sambasivarao et al., 2023; Dong et al., 2024). These systems can precisely determine when to irrigate, which is crucial in mitigating the effects of extreme weather events that threaten agricultural output in regions like Bangladesh (Sangeetha et al., 2024; Dong et al., 2024). Recent advancements illustrate how intelligent irrigation systems can also incorporate various sensors, such as temperature and humidity monitors, that collectively provide a comprehensive understanding of the agronomic environment. This integrative approach aids in optimizing water use and promotes sustainable farming practices (Wilczek et al., 2023; Hugeng et al., 2023). Additionally, ongoing research highlights the economization of agricultural practices through low-cost, efficient soil moisture monitoring solutions tailored for smallholder farmers, thereby securing higher productivity levels without imposing heavy financial burdens (Zhao et al., 2023; Rifky et al., 2024). This paper presents a cost-effective, field-ready automated soil moisture detection system aimed at small-scale farmers, ensuring efficient water management and improved crop yields. The proposed system leverages an Arduino microcontroller (ATmega328) to process data from soil moisture sensors, triggering buzzer and LED indicators to alert farmers about irrigation needs in real time. By combining low-cost components with efficient monitoring, this system enhances crop quality, promotes sustainable irrigation, and empowers farmers with data-driven agricultural decision-making tools. This work makes several notable contributions to the field of precision agriculture. It introduces a cost-effective soil moisture detection system built around the Arduino platform, specifically designed to support smallholder farmers in managing irrigation more efficiently. The system incorporates real-time feedback mechanisms using a buzzer and LED indicators, allowing users to instantly understand the current soil condition without the need for external displays or complex interfaces. Additionally, a fail-safe mechanism is implemented to reduce the impact of erroneous sensor readings, which significantly enhances the overall reliability and accuracy of the system. This combination of features ensures that the solution is both accessible and practical for everyday agricultural use. 2. SYSTEM DESIGN AND WORKING PRINCIPLE The soil moisture detection system, depicted in Figure 1, is designed to provide real-time monitoring and adaptive threshold adjustments based on soil type. This ensures precise irrigation control, enhancing crop efficiency while preventing overwatering or drought stress. The system incorporates a fail-safe mechanism, mitigating errors caused by faulty sensor readings. The system components and their interaction are illustrated in Figure 1. 2.1. System Components  Controller (Arduino Board): Serves as the processing unit, executing control operations and managing real-time data.  Power Supply Unit: Delivers a stable 9V power source to the entire system.  Moisture Sensor: Measures soil moisture levels and transmits data to the controller. International Journal on AdHoc Networking Systems (IJANS) Vol. 15, No.1/2, April 2025 13  LCD Display: Provides continuous updates on soil moisture status.  Buzzer: Issues an audible warning when the soil moisture falls below critical levels.  LED Indicators (Red and Green): Offer visual status updates on soil dryness and optimal moisture levels.  Breadboard: Facilitates the interconnection and prototyping of components.  Soil: Acts as the primary medium where moisture monitoring is conducted.  Variable Resistor: Enables manual adjustment of LCD brightness for better readability in varying lighting conditions. Figure 1. Block Diagram of Soil Moisture Detection System 2.2. Working Principle i. System Powering  The Arduino board, acting as the primary controller, is powered by a 9V supply, ensuring reliable operation. ii. Soil Moisture Detection  The moisture sensor is embedded in the soil, continuously monitoring moisture levels.  Upon activation, it transmits an analog signal to the Arduino, which interprets the moisture status based on predefined thresholds. iii. Dynamic Data Processing and Adaptive Thresholding  The Arduino processes sensor output, dynamically adjusting moisture thresholds based on soil type and environmental conditions.  If the soil moisture reaches a critical dryness level, the system triggers alerts. iv. High Moisture Deficiency (Dry Soil Condition)  If the sensor reading surpasses the preset dryness threshold, the Arduino activates the buzzer and turns on the red LED. International Journal on AdHoc Networking Systems (IJANS) Vol. 15, No.1/2, April 2025 14  The LCD displays a warning, notifying the user that immediate irrigation is required. v. Optimal Moisture Level  When moisture remains within the safe range (between minimum and maximum dryness limits), the system ensures balanced operation.  The red LED turns off, the green LED activates, and the LCD continues displaying real-time moisture data. vi. User Interface and Display  The LCD display provides instant soil moisture readings, ensuring timely decisionmaking.  Users can adjust LCD visibility using a variable resistor, ensuring clear readability under different lighting conditions. vii. Fail-Safe Mechanism for Sensor Errors  The system incorporates a fault detection mechanism, mitigating false readings due to sensor drift or malfunction.  If an anomalous reading is detected (e.g., sudden extreme dryness despite recent irrigation), the fail-safe algorithm filters the error, preventing unnecessary alerts. viii. System Alerts and User Notifications  Buzzer and LED indicators provide audible and visual alerts, ensuring timely corrective action.  Real-time monitoring prevents crop stress and irrigation inefficiencies, allowing farmers to optimize water usage. This enhanced soil moisture detection system leverages adaptive threshold control based on soil type, ensuring precision irrigation. Additionally, the fail-safe mechanism mitigates sensor errors, preventing false alarms and ensuring reliable soil moisture assessment. By integrating real-time feedback, audible alerts, and user-friendly display adjustments, the system empowers farmers to make datadriven irrigation decisions, promoting efficient water utilization and healthier crop yields. 3. MATERIALS NEEDED This section details the hardware and software used in the development of the soil moisture detection system, and the methodology used to evaluate its performance. 3.1. Hardware Components The following hardware components were used:  Microcontroller: An ATmega328-based microcontroller is the core of the system. Microcontrollers are compact computing units found in many electronic devices, providing efficient data storage and execution (Ramu et al., 2022; Pao-Ling et al., 2020; Ryan, 2020). International Journal on AdHoc Networking Systems (IJANS) Vol. 15, No.1/2, April 2025 15  Arduino Uno: The Arduino Uno board, featuring the ATmega328, provides a userfriendly platform for developing microcontroller-based projects. It offers digital and analog input/output pins, a 16 MHz crystal oscillator, a USB port, and power supply flexibility (Albi et al., 2023; Kusanti, 2023). Figure 2 shows the Arduino Uno board. Figure 2. Arduino Uno  Soil Moisture Sensor: This sensor measures the volumetric water content in the soil, providing data for irrigation management. These sensors help determine the appropriate timing for irrigation, thereby optimizing water usage and promoting healthy crop development (Khanna et al. 2014). Figure 3 illustrates the moisture sensor. Figure 3. Moisture Sensor  16 × 2 LCD (Liquid Crystal Display): A Liquid Crystal Display (LCD) is an adaptable electronic module commonly used for visual output in embedded systems. The 16×2 LCD, displaying 16 characters per line across two rows, offers superior functionality over traditional seven-segment displays by supporting special characters, custom symbols, and animations. Utilizing a 5×7-pixel matrix, it ensures clear text representation, with its Command and Data registers managing display control and character storage. Its costeffectiveness and ease of programming make it a preferred choice in various electronic applications (Karimovich & Ogli, 2020). Figure 4 shows the LCD. The pin descriptions for the LCD are provided in Table 1. Figure 4. LCD (Liquid Crystal Display) International Journal on AdHoc Networking Systems (IJANS) Vol. 15, No.1/2, April 2025 16 Table1: Pin Description Pin No. Function Name 1 Ground (0V) Ground 2 Supply voltage; 5V (4.7V – 5.3V) Vcc 3 Contrast adjustment; through a variable resistor VEE 4 Selects command register when low; and data register when high Register Select 5 Low to write to the register; High to read from the register Read/write 6 Sends data to data pins when a high to low pulse is given Enable 7 8-bit data pins DB0 8 DB1 9 DB2 10 DB3 11 DB4 12 DB5 13 DB6 14 DB7 15 Backlight VCC (5V) Led+ 16 Backlight Ground (0V) Led-  Buzzer: A buzzer is an electronic device that signals events with sound, commonly used in appliances, vehicles, and entertainment systems. Early models were electromechanical, using surfaces to amplify sound, while modern versions use compact, efficient piezoelectric ceramics for reliable, high-pitched tones and adjustable frequencies, replacing older designs due to their superior performance (Baumann, 2022). Figure 5 shows the buzzer. Figure 5. Buzzers  Variable Resistor: A variable resistor, or potentiometer, adjusts resistance in circuits to regulate voltage or current, often by moving a wiper across a resistive path. Used with three terminals, it acts as a voltage divider; with two, it functions as a rheostat. Digital variants allow electronic control without physical movement. Common in audio controls, display brightness, and sensor calibration, the mechanical potentiometer remains widely used for its simplicity and effectiveness (Lalkishore et al., 1987). Figure 6 illustrates a variable resistor. Figure 6. Variable Resistor International Journal on AdHoc Networking Systems (IJANS) Vol. 15, No.1/2, April 2025 17  Wire: A wire is a thin metal strand used for conducting electricity, supporting loads, or enabling communication, typically manufactured by drawing metal through a die. Types include multistranded wires for flexibility and jump wires for temporary connections in testing circuits like breadboards (Self, 2012). Figure 7 shows an example of wires. Figure 7. Wire  Light-Emitting Diode (LED): An LED is a semiconductor device that produces light through electroluminescence when voltage is applied. The emitted color depends on the semiconductor's band gap, a principle first observed in the twentieth century. Initially, Infrared LEDs had low intensity but remain widely used in consumer electronics like remote controls. Today, LEDs come in various sizes and are essential in applications such as LED matrices and display systems (Held, 2016). Figure 8 shows an LED. Figure 8. The light emitting diode electrical symbol and practical structure diagram  Battery: A battery converts chemical energy into electrical energy through multiple voltaic cells, where redox reactions occur between electrolytes and electrodes. Electron transfer at the cathode and anode generates a steady current, facilitated by an electrolyte that enables ion movement while preventing mixing, ensuring efficient device operation (Cook, 2015). Figure 9 shows a battery. Figure 9. Battery 3.2. Software The Arduino IDE (version 1.6.2) was utilized to program the Arduino Uno board. This integrated development environment supports writing, compiling, and uploading code to the International Journal on AdHoc Networking Systems (IJANS) Vol. 15, No.1/2, April 2025 18 microcontroller, providing a user-friendly interface for both beginners and experienced developers. Figure 10. Code written in the Arduino IDE (version 1.6.2) 3.3. System Algorithm and Flowchart  Algorithm: The algorithm for the Arduino code is as follows: Step 1 involves specifying the input and output pins. Step 2 entails setting a threshold value for soil moisture. Step 3 includes initializing the LCD library and pin mode. Step 4 involves initializing variables and pin mode. Step 5 is about establishing a serial connection at 9600 bits per second. Step 6 consists of reading the sensor value from the analog pin. Step 7 dictates If sensor value >=Maximum Dryness SENSORPIN is high i.e. LED1 and Buzzer is on Else if sensor value <=Maximum Dryness && Sensor value >=Minimum Dryness SENSORPIN is low, stop Buzzer and LED1 and start LED2 International Journal on AdHoc Networking Systems (IJANS) Vol. 15, No.1/2, April 2025 19 Else SENSORPIN is low and stops Buzzer  Flow Chart The flowchart outlining the process of uploading code to an Arduino device is presented below: Figure 11. Flow Chart for the code to be uploaded to Arduino 4. RESULTS AND DISCUSSION The system integrates all hardware components, with each module positioned to ensure optimal performance. The system effectively monitors soil moisture levels and provides timely alerts. 4.1. System Overview and Operation After setting up the circuit, the code was uploaded to the Arduino Uno board. The code includes a specific threshold value that determines the critical moisture level in the soil. The moisture sensor continuously measures the soil's moisture level.  System Response to Soil Moisture Levels:  Below Threshold: If the moisture level falls below the predefined threshold, the moisture sensor sends a signal to the Arduino board, triggering the following actions:  The buzzer is activated to provide an audible alert.  The red LED lights up, signaling that the soil is too dry and requires watering.  Above Threshold: Once the soil is watered and reaches the desired moisture level, the system responds by:  Turning off the buzzer and red LED.  Lighting up the green LED, indicating that the soil moisture is adequate.  Display of Sensor Readings:  The moisture sensor's readings are consistently displayed on an LCD screen, providing real-time information on the soil's moisture content. This allows for continuous monitoring and immediate feedback on soil conditions.  System Testing and Validation: The entire system underwent thorough testing to ensure its functionality. The testing process verified that the system effectively monitors soil