1 Introduction

The present world population will increase to 8 billion people in 2023. Rapid population growth according to the United Nation (UN) makes it more difficult to eradicate poverty, end hunger and malnutrition, and broaden access to healthcare and educational opportunities [1]. The UN Food and Agriculture Organisation predicts that the global food supply would need to increase by 70% by 2050 as a result of decreasing agricultural lands and the depletion of limited natural resources [2]. As a result there is a pressing need to raise farm productivity. Due to a lack of natural resources such as fresh water and cultivated land as well as trends in declining agricultural yields for several key commodities the issue has gotten worse. Another obstacle is the agricultural workforce’s changing organisational structure.

There seem to be astonishing numbers for the Indian agricultural industry. With a Gross Value Addition of US Dollar 265.51 billion it supports the livelihood of 58% of Indians. Despite employing around 58% of the working force directly and indirectly, this industry only provides about 15.87% of the nation's Gross Domestic product (GDP) [3]. The topic of agricultural productivity is brought up as a result. Agricultural Value Added per Worker is the indicator that is most frequently used to gauge agricultural output. China, India, Indonesia and other impoverished or emerging countries with large populations have the lowest agricultural value added per worker.

India has the lowest agricultural value added per worker among the top 20 economies. Water is essential to life for all creatures including plants and animals. It is a fundamental necessity of every human being. The only way that water is used in agriculture in India today is for irrigation. This proportion may increase as a result of increased food consumption and population growth. So a problem that affects most agriculture is a lack of water. By applying various water-saving strategies this can be reduced to a minimum. There are many strategies to stop or minimise water waste.

Tamil Nadu's quick development and industrialisation is responsible for the state's excessive water usage. The primary factor influencing the rapid deployment of ground water irrigation is the ongoing change in Tamil Nadu's yearly rainfall pattern. The main objective of this work is to use groundwater irrigation to decrease the negative effects of water scarcity on crop productivity in order to sustain agriculture in Tamil Nadu throughout the year. This investigation looks at temporal variations in irrigated areas between 2000 and 2014 [4]. We use spectral matching methods to map and classify the seven bands of MODIS satellite images of the land surfaces in order to show changes in rainfall at the sub-basin level.

The only way that water is used in agriculture today is for irrigation. This proportion may increase as a result of increased food consumption and population growth. Thus, one of the problems facing the planet is water scarcity. Day by day the most efficient plant monitoring systems currently in use make use of plant optical and infrared imaging. Everyone needs water including humans, animals, and plants. It is a fundamental necessity of human being. Water waste is the key problem in the majority of agriculture. By applying various water-saving strategies this can be reduced to a minimum. There are many strategies to stop or minimise water waste. Water is trickled onto the plant’s roots using drip irrigation which is the most effective method of irrigation [5]. A sprinkler system is an irrigation-based system that makes use of tubes-mounted guns, sprays, or sprinklers.

Abiotic and biotic constraints are two categories of environmental limitations that have an impact on crop production. Actually these aspects are more obvious due to climate change brought on by global warming [6]. Abiotic stresses modify a plant's morphology, physiology, biochemistry, and molecular structure which negatively affects its growth and productivity. Climate and soil characteristics (soil components, physicochemical, pH, and biological features) (drought, flood, cold, heat stress, etc.) are examples of abiotic constraints. On the other hand biotic variables include weeds, vertebrate pests, pathogens, beneficial species (pollinators, decomposers, and natural enemies), and anthropogenic evolution. To address all the environmental issues that are lowering crop yields and maintaining food security, trans- and multidisciplinary research is required.

Numerous factors present a severe risk that will lower productivity if farms are not adequately monitored and maintained. Three categories biological, environmental, and technological can be used to categorise these variables [7]. Due to the need to increase crop production and the increasing use of farming practises like irrigation, extensive inorganic fertiliser application, and synthetic chemical weed and insect control, more land has been converted to agriculture [8]. These operations have decreased the quality of the soil, the water, exacerbated soil erosion, contaminated groundwater and the quality of the food. In an effort to enhance yields on current farms while reducing the environmental effect of agriculture this has prompted programmes for sustainable development [9,10,11,12,13].

Today wireless sensor networks play a huge role in agriculture. These systems among others include those that use Radio Frequency Identification (RFID) based traceability systems, continuously monitor the environment and preserve agricultural accuracy. For the automated irrigation system to transmit the sensor data for the soil moisture content, temperature, and humidity to the remote area, a wireless modem using LoRa is essential. Wireless sensor networks are used to remotely monitor humidity and temperature information on a regular or irregular basis utilising General Packet Radio Service (GPRS) based systems.

The aforementioned information allows us to frame the proposal’s objective as

Fabrication of monitoring device with AI analyzation of Drought Monitoring and forecasting by Normalized Difference Vegetation Index (NDVI) time series data from MODIS Satellite.

The contributions of the study are as follows

  • NDVI time series data from MODIS Satellite along with Micro climate Analysis for adapting the new cropping pattern.

  • Implementation of irrigation depends on age of crops and Micro climate using AI

  • To monitor crop growth leaf colour changes, pest control, nutrients deficiency by Spectrogram images adopting AI.

  • Also provide Fertilizer calculator to have a realistic estimate of the quality of fertilizer needed for our crop and area.

  • To proposed LoRa Technology transmit all sensors data from farm field to control unit without Global System for Mobile communication (GSM) technology and any other Internet facilities.

2 Literature review

Currently irrigation is the only usage of water in agriculture. Increased food demand and population expansion could cause this percentage to increase. Therefore a global issue is the lack of water [14]. Utilising plant optical and infrared pictures the most effective plant monitoring systems are being implemented daily [15]. Every human, animal and plant needs water to survive. Every human being has a basic need for it. Water waste is the main issue in the majority of agriculture. Utilising various water saving techniques can help to lessen this [16]. There are numerous ways to prevent or reduce water waste. The first one is the ditch irrigation system, in which rows of seeds are placed in ditches that have been dug out. For the passage from the main ditch to the canals there are tubes resembling syphon tubes. The most effective technique of irrigation is drip irrigation which involves pouring water onto the plant's roots [17, 18]. Sprinkler systems are another type of irrigation-based system that employ sprinklers, sprays or guns mounted on tubes. The tubes carry water and some of the ends include sprinklers to apply water where it is needed. The sprinkler won’t activate until the temperature and humidity sensor in the root zone surpasses the threshold value. The rotary system is the best irrigation technique for large regions. The rotary system uses mechanically driven sprinklers that travel in a round motion due to its 100-foot range. As a result the device sprinkles over time in a larger area while using less water. For the purpose of watering cotton crops, infrared thermometers are utilised to measure the temperature of the remote canopy [19]. A temperature threshold is upheld during this process. When the canopy temperature rises above a certain threshold the mechanism activates. The majority of irrigation systems are automated rather than manual in order to maximise cotton production and water usage. An alternative parameter to calculate agricultural irrigation requirements is plant Evapotranspiration (ET). When two terms are combined as in evaporation and plant transpiration the result is called ET. Evaporation is the vaporisation of water from soil, water bodies and canopy interception [20] into the atmosphere. Water vaporises from stems, flowers, and leaves during the process of transpiration. Water reductions of up to 42% are possible with ET-based systems [21]. Due to uses like vehicle monitoring and robot control, Wireless Sensor Network (WSN) nodes have grown in popularity in recent years. IRIS nodes built on TINY OS are used to measure the soil moisture content of paddy fields [15]. The most popular method for measuring the data in irrigation fields is the ZigBee transmission of data from end devices. However the distance between the two nodes is only 10 to 100 m when these devices are used. As a result the majority of applications transport data to faraway locations using GPRS-based technologies [17]. ZigBee-based transmission is used in the agricultural sector to collect data from numerous sensor nodes. In today's world wireless sensor networks are essential to agriculture and the food industry. These systems among others, include those that use RFID-based traceability systems, continuously monitor the environment and uphold agricultural precision [16].A wireless modem using GSM/GPRS is called the SIM900A. It is crucial for the automated irrigation system to communicate the values from the soil moisture [12] content sensor as well as the temperature, humidity and other sensor data to the remote area. The AT commands can be used to do this. The microcontroller unit and GSM/GPRS modem are interfaced [12]. Wireless sensor networks are used for remote monitoring using GPRS-based systems to continuously or sporadically monitor temperature and humidity data in industry and even in agricultural [18].Various models and limitations of existing systems are discussed in the Table 1.

Table 1 Comparison of existing systems

The main objective of this article is to develop an automatic watering system using AI and sensors linked to a microcontroller. This study made use of the DHT11 sensor for temperature and humidity as well as the VH400 sensor for soil moisture. These sensors are interfaced with the microcontroller unit which was buried beneath the root zone of the plant. Sending an SMS to a mobile phone of a remote owner is the main goal of using a microcontroller. SMS messages are delivered using the SIM900A module which is coupled to the microcontroller unit. The irrigation system is put to the test with various plants at various humidity and temperature levels in both dry and typical situations. To keep the water content in those specific regions soil moisture sensors are used. All results acquired under wet and normal conditions have been shown to be logical.

2.1 LoRa technology

A LoRa-enabled architecture for precise irrigation and monitoring has been demonstrated [28] with each sensor node being able to connect to another LoRa-enabled receiver and create a communication channel. A low-power operating method called LoRa allows for transmission and reception over a vast communication range. Despite the fact that LoRa technology makes it simple to transfer sensor data from farm fields to a control unit. Field-installed sensors gather information about things like soil moisture, temperature, and humidity. These sensors broadcast the data in discrete packets using low-power, long-range wireless technology called LoRa.

The packets are sent by LoRa-capable sensors to LoRa gateways placed around the farm. Gateways accept the packets and use the LoRaWAN (LoRa Wide Area Network) protocol to send them to a central control unit.

The control unit gathers and analyses the incoming data to produce actionable insights. Real-time updates on crop conditions may be included in this data, enabling knowledgeable decisions on pest management, fertilisation, and irrigation.

2.2 Challenges of AI

Although implementing AI in the agricultural sector faces significant obstacles it is a logical step towards smart agriculture for efficient, cost-effective, and sustainable farming. The agricultural sector and the field of AI research are not connected. Therefore AI researchers are not well-versed in the issues that farmers confront, and farmers are also not well-versed in the AI technologies that are currently available. It will take more interdisciplinary cooperation to find a solution to this dual issue. The use of AI in agriculture is still in its early stages, hence there aren't any established norms or regulations. As a result there are several legal questions surrounding smartt farming. Because the majority of AI-IoT solutions were cloud-based until recently, farmers were reluctant to adopt AI methods due to worries about cyber attacks, data security, and privacy. A new IoT option called "Edge AI" has emerged to address this problem. Edge AI handles sensor data locally and offers better data protection and privacy as well as reduced latency and cost. Another challenge for AI in agriculture is a lack of data. AI is a data-driven technology. The absence of pertinent data makes it difficult to deploy certain AI algorithms. In remote, rural areas with no higher speed mobile networks but where agriculture is the main industry, edge AI has the potential to transform the game. The potential for intelligent agriculture is increased. Convolution Neural Networks (CNN) were used in [29] to compress sensor image data at the edge layer before transmitting the compressed data to the fog layer using LoRa technology.

3 System architecture

The three layers of the proposed system architecture are depicted in Fig. 1. Layer 1: A farming device The foundation layer of the smart farm architecture is called layer. It consists of numerous components, including sensors which are dispersed across the agricultural ground. These devices also known as distributed source nodes, are simply LoRa wireless sensor networks. They recognise the physical parameters continuously collect data in real-time and send it to the gateway node at the following layer. The data received by several sensors and cameras in various smart agriculture applications is shown in Fig. 2. For instance data is gathered by on Unmanned Aerial Vehicle (UAV) sensors and cameras in a field of rice and relayed to the edge where subsurface soil sensors process it.

Fig. 1
figure 1

System architecture

Fig. 2
figure 2

Product over view

Layer-2: The Edge Computing Layer is included in Layer 2. There are several edge nodes in this. Depending on the particular smart agriculture system, different nodes may be present. Here, layer-1 data is processed, filtered and encrypted. Due of resource constraints at the edge layer the prognostic and solution components were previously completed at the following layer. Trained machine learning models can perform prognostics and provide suggestions at this layer, nevertheless thanks to recent hardware advancements and initiatives for AI at the edge. However if the task requires a lot of resources or is not time-sensitive, prognosis and inference can both be done in the following layer. For instance the ESP8266 for integrating smart agricultural components to manage environmental conditions [25] and the ESP32 for smart irrigation [26].

Layer-3: The third or uppermost layer in the bottom-up design of the smart agriculture system is cloud computing. This virtual layer is often located in data centres and is accessible via the Internet from any location in the world [27]. Massive amounts of data generated by cameras or sensors in agricultural farms are required.

4 Data

4.1 Satellite data

The seven bands of MODIS are used to measure surface reflectance. Blue wavelengths between 459 and 479 nm, green between 545 and 565 nm, red between 620 and 670 nm, near-infrared between 841 and 875 nm, and short-wave infrared between 1628 and 2155 nm, are used to examine vegetation and land surfaces. For monitoring the vegetation at a continental scale [30] using the Terra platform's MODIS 500-m resolution and 8-day surface reflectance. Scientific Data Set documentation for MOD09A1 [31] is given. The study also included secondary data in addition to the original data set, which came from MODIS time-series data as shown in Fig. 3a

Fig. 3
figure 3

a Rainfall fluctuations over time in different irrigated agricultural areas in Tamil Nadu. b Tamil Nadu agricultural land classification, by source, with major river basins

4.2 River basins and their irrigated area

There are 40,000 tanks, 1 million wells, and 61 large reservoirs that rely extensively (17.5 BCM) on surface water. Surface irrigation is not as important as ground water irrigation (15. 3 BCM). Table 2 provides information on the basin's irrigation condition for 39 years, from 1976 to 2014, together with 54 years' worth of rainfall data, from 1961 to 2014 shown in Fig. 3b also. At the sub-national level, which is similar to a state, county or district, statistics on the total amount of irrigated agriculture and irrigated area of the country were gathered. The Department of Economics and Statistics of the Tamil Nadu government provided data on irrigated areas. Daily rainfall data from 2000 to 2014 were collected from the India Meteorological Department's (IMD) Hydro Met Division website at http://imd.gov.in. The monsoon was the subject of our investigation. We focused our research on the monsoon season (kharif season) from May to December because all the agricultural activities are done during this season and image analysis also carried out for that season.

Table 2 Characteristics of the major river basins

4.3 Spectral matching techniques for identifying changes in irrigated area using NDVI

The NDVI, which is a combination of near infrared and red bands, is frequently used to discern vegetation conditions such as density and vigour. NDVI values range from − 1 to + 1, with higher values indicating more vigorous vegetation and lower values indicating less vigorous vegetation. The total area irrigated from 2000–2001 to 2014–2015 and the annual irrigated area differ significantly. The change in the irrigated area was discovered using spectral matching techniques. The highest mean NDVI value in Tamil Nadu was 0.79 during the kharif season. From this result along with the micro climate analysis (Temperature, Air quality index and Humidity) suggest the right crop for the season.

4.4 Crop management

Crop management is the process of evaluating the sociological, ecological and economic factors that play a significant role in the choice, growing and selling of crops. Cropping patterns are influenced by crop growth, the availability of water resources, labour, insurance, and environmental conditions using MODIS satellite and AI. Cropping patterns might change according to ecological variables. For instance traditional crops like paddy agriculture, which require extensive water resources, cannot be supported in places with diminishing water supplies and groundwater tables. Crop choice is also influenced by the agricultural product's market as well as the export and import regulations of other nations.

4.5 Soil monitoring

In the overall farming process, soil moisture is crucial. During the course of a plant’s growth, it is in charge of photosynthesis, respiration, transpiration and the transfer of minerals [30]. In making decisions for farms, soil monitoring is crucial. Cropping patterns are influenced by a number of variables, including soil salinity, pests, precipitation, pH, and humidity. These elements support the evaluation of soil health. Field-based sensors track the temperature and humidity of the soil, and the cloud receives through LoRa Transmitter and the process the data. Farmers will be informed about a variety of issues, and planting patterns are evaluated and chosen depending on salinity content, soil nutrient level, humidity, and temperature. A wide range of topics will be discussed with farmers, and planting patterns will be considered and selected based on factors like salinity content, soil nutrient level, humidity, and temperature. Water is essential for photosynthesis, regulates temperature, and transports food and nutrients for plant growth, making soil moisture a crucial element in plant growth. Humidity controls the food supply and transpiration rate for ideal plant growth. A humidity of 50% to 60% is ideal for the growth of vegetable plants [32]. To ensure the best possible use of water resources, soil moisture sensors are inserted into plant roots and analyse soil moisture level measurements [33, 34].

4.6 Smart irrigation

Smart irrigation is the practise of enhancing the quality and quantity of production while making the most use of available water resources. By giving the plants the right amount of water, it saves water. Irrigation systems can be classified as either soil moisture sensor-based or weather-based. A controller controls the irrigation in weather-based irrigation systems, which collect temperature and rainfall data from a nearby small weather station. In irrigation systems using soil moisture sensors, sensors buried in tree grass provide precise measurements of the soil's moisture content. In order to irrigate the field with this sort of irrigation, precise humidity and air temperature measurements, weather monitoring, and cropping patterns are all necessary with AI. Sprinkler actuators and data are delivered to the cloud together [35]. The data from the soil moisture sensor determine the irrigation schedule for each farm area. Maximum crop growth and 100% water utilisation efficiency are guaranteed by micro level analysis, scheduling, and effective actuation [36]. From a mobile application built for smart phones, farmers can monitor and may control the irrigation system. This irrigation system is based on information collected from field-installed temperature, humidity, soil moisture, and ultrasonic sensors [37]. Farmers can execute actuation by turning on the irrigation pumps to water the farm using a user-friendly mobile application that is built for smart phones and connected to the cloud for analysis.

4.7 Plant growth monitoring

The key step after selecting a crop is crop cultivation. Modern technology is available to farmers and sensors installed in the field monitor plant growth. For instance, ultrasonic sensors. For instance, to track the presence of insects and pests that hinder plant growth, ultrasonic sensors are deployed in the field. When pests are found, high frequency sound waves are produced to eliminate them, and the farmer is also made aware of their presence for additional assistance [31].

5 Methodology and implementation

Applied Machine Learning and Artificial Intelligence Machine intelligence that resembles human intelligence is known as artificial intelligence. Many industries, including e-commerce and marketing [38], human resources [39], computer vision [40], multimedia forensics [41, 42], healthcare [43], social media [44, 45], gaming [46, 47] and agriculture have showed great potential as a result of advancements in AI and ML. In agriculture, artificial intelligence (AI) is used to improve productivity, crop yield, and profitability as well as to track livestock, monitor the weather, optimise supply chains, manage irrigation systems, manage pesticide and fertiliser use, and control weeds. Researchers are using fuzzy logic, other AI/ML techniques like classification and logistic regression, as well as Neuro-Fuzzy logic, to improve agricultural decision-making, predictive analytics, and mobile expert systems [48].

Real-time monitoring of the environment in agricultural areas is made possible by integrating sensors with a microcontroller unit. The system can identify the presence of pests or unusual variables linked to pest attacks by deploying sensors like temperature, humidity and pest-specific sensors. Early identification is made possible by this allowing farmers to act right away and minimise any crop damage.

The system may analyse sensor data and detect certain pest species or patterns linked to pest infestations by incorporating AI algorithms. The accuracy of pest identification can be increased over time by using AI models that have been taught to detect pests. The manual effort needed for pest monitoring is decreased thanks to this automated identification procedure which also provides prompt and precise detection.

By utilizing LoRa the system can transmit data even in areas with poor or no network coverage. This is particularly valuable in rural or remote agricultural locations where traditional network connectivity may be limited. The agricultural system can transmit pest detection data via LoRa to a central server or cloud platform.

Using LoRa technology alerts can be sent to the farmer’s mobile device as soon as the system detects and identifies a pest attack. These notices may contain details on the individual pest the intensity of the attack and suggested pest control measures. This makes it possible for farmers to act quickly and protect their crops no matter where they are. Farmers can keep informed and make informed decisions wherever they are thanks to remote accessibility via mobile alerts.

According to the Indian Council of Agricultural Research, pests lose between 30 and 35 percent of India's annual agricultural yield. By applying cutting edge AI solutions to this issue there is a tremendous possibility to raise our yield. Early pest detection allows for the use of appropriate and less-excessive pesticides to protect the crop, increasing crop output.

Three steps make up the Process Flow module: Data gathering, Keras-RetinaNet-based pest detection and Pest attack density detection as shown in Fig. 4

Fig. 4
figure 4

AI process flow for pest detection

5.1 Training the model

We utilised a Keras-RetinaNet model to identify pest photos because deep learning for visual identification is becoming increasingly successful.

  • Keras-RetinaNet With ResNet + FPN as the backbone for feature extraction and two task-specific subnetworks for classification and bounding box regression, Keras-RetinaNet, developed by Facebook AI Research (FAIR), achieves state-of-the-art performance and outperforms Faster RCNN, the well-known two-stage detector [49].

  • Recent studies have shown that adopting pre-trained networks and applying them to other datasets significantly improves performance compared to developing new models from scratch. This was made possible by the models’ capacity to discover general features applicable to a variety of computer vision tasks. On the COCO dataset, we used a pre-trained model with a ResNet50 backbone, and we trained it using our own data. To train our model, we utilised the weights “resnet50_coco_best_v2.1.0.h5”. We have tested a number of models throughout the course of this project and updated them as we discovered models that performed better.

5.2 Features

  • Pest Detection: Detects pests through Keras-RetinaNet object detection model. (As explained above)

  • Pest affect Density: The amount of pests found in each image is counted by the model. It serves as a criterion to determine how much damage has already been done and provides an estimate of how many pests are present on a leaf.

The sensors and AI will begin to function according to the power supply given to the Arduino board in the proposed approach. A soil moisture sensor coupled to a microcontroller unit delivers the corresponding readings on a periodic basis, and the DHT11 sensor detects the temperature and humidity in the crop roots on the other end. An air index sensor is also used to determine the air index. The microcontroller unit's primary goal is to get the data values sent by the sensors and ESP32, which was configured to save the data in the cloud. These values are shown on the LCD screen by the data that is delivered to the microcontroller. For timely irrigation, which supplies the necessary amount of water to the receptive crops according to the stages, a Direct Current (DC) Pump and a Microcontroller are employed. If the Arduino is turned on and all the sensors are controlled by Arduino, then all of the aforementioned sensors will start working at once. The Raspberry PI, AI, and camera that are housed in the other portion of the gadget are utilised to detect both pest and disease attacks. The farmer is informed if the camera detects the insect attack. We also offer a fertiliser calculator to help you determine how much fertiliser is necessary for each crop in order to control insect attacks. Therefore, farmers may apply the proper amount of fertilisers to the crops using our fertiliser calculator. We now offer a mobile application that allows you to examine real-time farm data in addition to the fertiliser calculator feature. Our mobile application pulls data from the cloud and displays it in accordance with what farmers are asking for.

Micro climate analysis, harnessed through AI algorithms, offers a data-driven approach to optimize crop selection. Through continuous monitoring of temperature, air quality index, and humidity, AI employs decision trees algorithm to correlate environmental variables with crop preferences. For instance, decision trees analyze historical and real-time data to identify temperature thresholds where specific crops flourish, ensuring ideal growing conditions. Air quality insights guide choices, as AI recognizes crops resilient to pollutants or sensitive to air composition changes. Humidity data guides water-intensive crop selection in suitable conditions. Additionally, AI can perform clustering analysis, grouping areas with similar micro climates, enabling regional-specific crop recommendations. AI's adaptive learning capabilities fine-tune crop recommendations over time, enhancing accuracy with each season’s data.

5.3 Implementing a fertilizer calculator with AI involves several steps

  1. 1.

    Collect data on crop types, soil characteristics, growth stages, and historical pest incidents.

  2. 2.

    Apply regression algorithms to analyze this data, correlating nutrient levels with pest occurrences.

  3. 3.

    Train the AI model using historical data to predict optimal nutrient requirements based on crop and soil conditions. Incorporate real-time data such as weather forecasts and pest population trends to dynamically adjust recommendations.

  4. 4.

    Create a user-friendly Mobile App interface where farmers input crop details and receive AI-generated fertiliser suggestions. Integrate data from IoT devices and sensors for accurate, up-to-date information.

  5. 5.

    Regularly update and refine the AI model with new data to improve accuracy.

6 Results

Framework of proposed work is variety of environmental factors including temperature, humidity, soil moisture and nutrient is defined. Next, select and fabricate the necessary hardware components, including sensors and IoT devices. Then, set up data collection and management, ensuring secure storage and preprocessing. Develop AI models for real-time analysis and visualization of data, enabling actionable insights for farmers.

According to the suggested algorithm as depicted in Fig. 2, the sensors will start operating in accordance with the power supply provided to the Arduino board. The microcontroller unit and the soil moisture sensor are both interfaced, and the microcontroller unit periodically receives the corresponding readings from the soil moisture sensor. Along with the temperature and humidity of the microenvironment detected by the temperature sensor, the air index is also monitored using an air index sensor and NDVI time series data from MODIS Satellite for adapting the new cropping pattern. The main objective of the microcontroller unit is to receive the data values transmitted by the sensors and the LoRa transmitter, which is set up to save the data in the cloud. The microcontroller receives the data from the LoRa receiver and displays the information in the LCD screen.

For timely irrigation, which supplies the necessary amount of water to the receptive crops according to the stages, a DC Pump and a Microcontroller are employed. If the Arduino is turned on and all the sensors are controlled by Arduino, then all of the aforementioned sensors will start working at once. The Raspberry PI, AI and camera that are located in the other portion of the gadget are utilised to detect both insect and disease attacks. The farmer is informed if the camera detects the insect attack. We also offer a fertiliser calculator to help you determine how much fertiliser is necessary for each crop in order to control pest attacks. So, according to our fertilizer calculator farmers can feed the correct quantity of fertilizers to the crops. Along with fertilizer calculator facility we also provide Mobile Application to view the live data of the farm.

Our mobile application retrieves data from the cloud and shows it in accordance with what farmers are asking for (multilingual). Google Firebase, where the database is located and the web server is hosted on Apache Web Server, receives the data. Figures 5, 6, 7, 8, 9, 10 and 11 display the entire prototype output screenshot of Mobile Application.

Fig. 5
figure 5

Output of micro climate analysis humidity

Fig. 6
figure 6

Output of micro climate analysis temperature

Fig. 7
figure 7

Output of micro climate analysis air quality

Fig. 8
figure 8

Output of soil nutrients—nitrogen value

Fig. 9
figure 9

Output of soil nutrients—potassium value

Fig. 10
figure 10

Output of soil nutrients—phosperous value

Fig. 11
figure 11

Output of pest attack identification

7 Conclusion

Technology advancements and the meteoric expansion of ICT have transformed traditional agriculture into a smart, intelligent, automated agriculture. Smart agriculture reduces its carbon footprint by implementing sustainable, green farming, limiting the use of pesticides and fertilisers, and increasing the use of natural resources. As was already said, smart agriculture has various challenges. To get around these challenges, both new and old technologies must be used.

In this work, cloud-based AI models for smart agriculture are used. The use of advanced microcontrollers in hardware has expedited the shift in computing paradigm. Giving IoT devices intelligence is the most recent development. LoRa technology enables network accessibility. If the sensor data exceeds a predetermined threshold value, the microcontroller unit continuously examines the sensor data using AI and sends an alarm SMS to the mobile phone of an owner who is in a faraway place.

The relevant data obtained from measuring the DHT11 sensor's varied readings in a range of climatic conditions are used to determine the threshold value. By employing WSN nodes like LoRa for data transmission and database systems for local data storage, this system can be improved. Technology advancements and the meteoric emergence of AI have transformed traditional agriculture into a smart, intelligent, automated agriculture. Smart agriculture reduces its carbon footprint by implementing sustainable, green farming, limiting the use of pesticides and fertilisers, and increasing the use of natural resources. The agricultural industry will soon include Agriculture 5.0 [48]. By doing this, the system's sustainability will be preserved as yields rise. Both industrialised and developing countries will follow a similar trend. From an economic and environmental standpoint, humanity will embrace efficient food production and delivery more than ever [50].

Future work of the work should prioritize sensor technology advancements, enhancing AI models for precision agriculture, optimizing energy efficiency, expanding user-friendly interfaces, promoting scalability and cost-efficiency. These efforts will contribute to more accurate data collection, better decision-making for farmers, sustainable IoT implementations, improved accessibility, and wider adoption of this technology, ultimately fostering increased agricultural productivity and sustainability.