Dual axis solar tracking system for agriculture applications using machine learning

.


INTRODUCTION
Automation is necessary in India since human irrigation methods are ineffective there, where two thirds of the population depend on agriculture as their primary source of income.Automated irrigation can deliver precise water delivery [1].Following the path of the sun allows solar panels with tracking systems, controlled by machine learning algorithms, to produce the most power.In comparison to fixed arrays, this dual-axis solar tracker can capture the most sunshine, potentially improving solar panel yields by 30 to 60% and producing up to 40% more electricity annually [2], [3].
According to agriculture, maximum crop production is very important to make agriculture profitable [4].So, the crop recommendation to a farmer will help them increase their productivity.To know the suitable crop for their field generally need to approach soil testing laboratories to learn about the nature of the soil, its nutrients contents, pH level and moisture level [5].There may be a delay in the results of these tests because the laboratory will have too many samples to test [6].Once the results have been obtained, farmers can determine the suitable crop to grow in that soil [7].To avoid such time delays and complications, this project also has crop recommendation system will be more beneficial because it senses the pH, nutrients, temperature and humidity levels of soil using the necessary sensors and then compares these to dataset values to produce accurate results [8].By choosing renewable energy for this kind of system, electricity can be saved.They can be easily fixed in agricultural areas so that maximum power is achieved by solar trackers [9].Usually, the crop recommendation system consumes less power for accurate results, so itis very easy to run any other system connected to it.
The crop selection method (CSM) was put forth to address crop selection issues, maximize net crop production rates over the course of the season, and promote national economic growth [10]- [12].The software chooses a succession of crops that maximizes daily production throughout the entire season using plantation days and expected yield rate as inputs.The CSM calculates agricultural yield based on input conditions by using machine learning and prediction methods like multiple linear regression.The methodology was tested using data gathered from 1997 to 2014 covering all 640 districts and 5924 subdistricts in India.The use of polynomial regression produced a remarkable overall accuracy rate of 78% [13].
By enhancing the population initialization technique with time-series soil nutrients, Krizhevsky et al. [14] provided a novel method for identifying the optimal nutrients for boosting yield output while preserving soil fertility.The suggested method helps to reduce the search space and get rid of any local optimisation parameters that aren't present [15].The model uses a genetic algorithm to examine the data and offer suggestions for improving the remote environment.The ideal nutrient settings for different crops could be recommended using this study's improved genetic algorithm (IGA).Naive Bayesian, Linear Support, Vector Classification, and K Nearest neighbour algorithms were used to decide the type of fertiliser to use [16] based on the area and crop type.For this project, it is necessary to understand the many types of soil, their health and characteristics, and the relationship between various pesticides and manures and the soil types they should be associated with [17], [18].In terms of the type of fertiliser to be employed, the findings showed that KNN had the highest accuracy (0.8145), while Naive Bayesian and linear SVC had 0.759 and 0.777 accuracy, respectively [19].
At Plataforma solar de Almera (PSA), a small mockup heliostat whose STS was based on conventional computer vision algorithms was successfully tested [20].Low-cost open hardware and machine learning (deep learning) methods [21] combined with specialized software (MATLAB [22] and Mathematica [23]) have advanced the computer vision approach.This most recent method, which was tested at (PSA), demonstrated the enormous potential of intelligent STSs.Additionally, the authors of the current study have obtained a patent for a novel method of Sun tracking devices [24].The major finding of an extensive assessment and preliminary findings concur that the adoption of smart STSs is the most viable approach for the advancement of concentrated solar power and photovoltaic technology.

METHODOLOGY
As shown in the block diagram of Figure 1, the Raspberry Pi 3 Model B CPU, which controls the entire system, is used.Let's begin with crop recommendations.The PH sensor, NPK sensor, temperature and humidity sensor, and rainfall values are collected to recommend the most suitable crops based on the data [25].To produce the needed result, the collected data will be compared to the dataset downloaded from the Kaggle website.The data will be categorized using the Random Forest algorithm, a well-known supervised learning method.
This particular technique produced the highest output out of all the methods we used to train our model.The suitable crop names and sensor values are displayed on the monitor by Putty software and we can hear the results via Bluetooth speaker or head phones.We use this humidity sensor not only for crop recommending system, but also in irrigation process in the field.We are using solar power for the irrigation.This will be carried out by turning on and off the water pump according to the soil water vapor level.This will be done with the help of a motor driver circuit.In order to increase crop productivity and maintain crop health, the sensor could sense the water level and pump water at the right time.Here the panel works by the mechanism of a tracking system which can track sunlight and convert it into electrical energy.This tracker will work without light dependent sensors since the entire tracking system is designed to be controlled through a logistic regression algorithm in machine learning.
The random forest method can swiftly categorize unclassified data records and is very effective at training new models.The orientation of the solar panel in this system is changed by a servo motor in response to the angle of the sun's irradiation and the time of day.The algorithm has been set up to adjust the panel's angle based on the sun's position at various times.

ML algorithm used in solar tracker
Applying the logistic regression technique allows the dual-axis solar tracking system to rotate the panel to the desired angle.Figure 2 shows the training and testing the sun tracking model.For this model, training and testing will be done based on this logistic regression algorithm.So, it will be easy to position the solar tracker with a servo motor at the desired angle.The testing and training data will be given to input them and it computes the data with regression coefficients using Sigmoid function.After finding a relationship between training and testing data, the object position can be determined.By using this tracking system, power would be provided to the water pump for irrigation process.Once the humidity value reaches below the predetermined value, power is supplied to motor driver circuit for driving the water pump for irrigation.

ML algorithms used in crop recommendation
Figure 2 illustrates a random forest, a type of classifier that consists of a collection of treesorganized classifiers where independent random vectors are dispersed indistinguishably and each tree makes a unit decision for the most common class at input x.A random vector that is independent of earlier random vectors with the same dispersion is formed, and a tree is made using the training set.The random forest algorithm's key benefits are improved accuracy, resistance to outliers, speed compared to bagging and boosting, and simplicity and ease of parallelization.First, N decision trees are combined to generate the random forest, and then predictions are made for each tree that was produced in the first phase.Algorithm for random forest in machine learning:

RESULTS AND DISCUSSION
The system is structured around a hardware configuration outlined in a block diagram which is shown in Figure 4, effectively gathering sensor data which is then directed towards Raspberry pi for processing.The initial phase of training the model holds significant importance, as it plays a pivotal role in achieving the desired predictive accuracy.By evaluating the accuracy levels, the most appropriate machine learning (ML) algorithm is selected, with random forest emerging as the optimal choice.Upon successful training, the model undergoes testing through the utilization of putty software.During this process, collected data is meticulously cross-referenced with a pre-existing dataset that was employed for training purposes.This comparison forms the foundation for accurate crop prediction, where the model identifies and suggests the most suitable crop for the given conditions.635 that the irrigation system receives optimal solar energy through the dynamic adjustment of panel positions.Notably, the output derived from logistic regression contributes to expediting predictions made by the neural network component of the system.In its entirety, this study undertakes the task of proposing a novel and refined approach to dual-axis solar tracking systems.The core innovation lies in the integration of supervised logistic regression, with the primary objective being an augmentation of efficiency.Through this integration, the system's overall performance is projected to achieve notable enhancements in terms of accuracy and functionality.

Solar tracking system
The prototype of the proposed system using a machine learning algorithm is shown in Figure 4.In order to generate a workable model, a logistic regression algorithm (LR) is connected to solar panels.The proposed model's fundamental idea is to rotate the solar panel automatically based on the direction of sunlight, hence removing the requirement for manual rotation, a key problem in this industry.To detect greater sunlight emissions, the suggested model includes a light dependent resistor (LDR), and this data is then submitted to the machine learning algorithm for analysis.The suggested method took into consideration a 12 V, 30 W solar panel for experimental reasons.The study's results and conclusions section compare the effectiveness of the current system with that of the suggested approach.The usefulness and benefits of using machine learning in the solar panel tracking system are illustrated in Table 1 by a comparison of solar power output with and without the LR algorithm.
Numerous factors were taken into account in this study, with solar power generation receiving the most attention.Different scenarios, including time periods, power usage, and waste management, were compared.Solar power generation with and without the logistic regression (LR) algorithm is shown in Table 1 along with a comparison.
Monitoring was done from 9 am to 5 pm every day, with the comparison time interval set at one hour.The average power generated was found to be 17.125 watts per hour using the current methodology.The average power production rose to 23.125 watts per hour with the proposed LR technique, nevertheless.This notable improvement demonstrates how the LR algorithm is excellent at increasing solar power generation and maximizing energy use.

Crop recommendations
Our proposed model uses a data set from Kaggle that contains various factors that contribute to crop growth.These factors have been thoroughly analyzed.Our predictions were based on various inferences generated from the results.Temperature, humidity, pH of soil, nitrogen in soil, phosphorous in soil, potassium in soil and rainfall in soil are considered.Figure 5 shows the model training results for crop recommendation.
Six methods were used and tested for crop recommendation: SVM, KNN, Naive Bayes, logistic regression, decision tree classifier, and random forest classifier.A comparison of the effectiveness of the various algorithms in this situation is shown in Table 2. Surprisingly, the random forest classifier produced excellent outcomes, obtaining a remarkable accuracy of 99.54%.The Random Forest method builds several decision trees and integrates the outputs of each to produce forecasts, producing suggestions for crops that are very accurate and trustworthy.Based on the soil nature (PH value, nitrogen, phosphorus and potassium, temperature and humidity value), proposed system using random forest classifier suggest the suitable crop to cultivate in the respective area.The rainfall data's are also collected to recommend the most suitable crops based on the data experimental results shows that for sample a soil, the recommended crop to cultivate is Muskmelon.F or sample B and Sample C the suggested crop are banana and coffee which are shown in Figures 6-8.
To give farmers more precise and fruitful crop recommendations, the system uses a supervised machine learning algorithm.Table 3 provides information and findings from the framework to help farmers choose appropriate crops based on soil conditions.In the end, it gives farmers more freedom to decide which crops to sow in their land.

CONCLUSION
We have been successful in creating a smart crop recommendation system that is available to farmers all over India.Using the random forest algorithm, this system helps farmers choose crops wisely depending on important factors including nitrogen, phosphorus, potassium, PH value, humidity, temperature, and rainfall.The system also includes humidity and temperature sensors to track soil water content and automatically control water flow through a water pump.Additionally, using a Dual-axis solar tracking system in conjunction with the LR Algorithm has increased power generation by an astounding more than 25.94%.In addition to helping the environment, the solar-powered farm improves the habitat for plants and animals, addresses recurring drought problems, lowers electricity costs, and raises the farm's total worth.Utilizing a smart irrigation system also has the added benefit of saving water and money on labor.By fusing these cutting-edge technologies, we hope to transform agriculture by giving farmers effective, sustainable solutions while also supporting economic growth and environmental sustainability.

Figure 1 .
Figure 1.Block diagram of proposed method Figure 2. Training and testing the tracking model

Step 1 :Figure 3 .
Figure 3. Flowchart for random forest algorithm for crop recommendation

Figure 4 .
Figure 4. Prototype of the proposed system

Figure 5 .Figure 7 .
Figure 5. Model training results Figure 6.Sample A soil result

Table 1 .
Solar power output (with and without LR algorithm)

Table 2 .
Comparison of different algorithm for crop recommendation Int J Pow Elec & Dri Syst, Vol. 15, No. 1, March 2024: 631-638 636 Different soil samples are considered for crop recommendation.

Table 3 .
Output for crop recommendation