Abstract:
Agriculture is critical to global food security and sustainability. To maximize crop output, understanding the soil and weather conditions of the farm is a crucial stage that can lead to the maximization of crops yields. In this context, this study develop an intelligent Soil Analysis and Crop Selection System that makes use of the Internet of Things (IoT) and Machine Learning, notably the Random Forest algorithm to help the local farmers of southern province of Zanzibar perform the selection of the most suitable crop for their pieces of land based on the measurement of nitrogen, phosphorous, potassium, pH, humidity and temperature before commencing to cultivate. We collected the field real-time data by deploying IoT sensors in the field area to collect soil and environmental data, our device collected nitrogen, phosphorous and potassium using NPK sensor, soil pH level using pH sensor and environmental humidity and temperature using DHT11 sensor, then, the microcontroller preprocessed the data and uploaded it to the cloud database. The data was collected from two different field zones (zone A and B). Afterward we analyzed and tested both samples using our crop selection model. We used Random Forest algorithm to develop crop selection model that can assess the soil's compatibility for various crops and rank the crops based on their growing probability. We trained the model using crops ecological requirements dataset and attained the accuracy of 96%. Then we tested the model using new unseen data collected from field area. After we tested the data collected from farm area during the time of seven days the outcome result suggested by the model was; In zone A, Banana got 78% growing probability, where maize got 20% and rice 2%. This suggests that banana best recommended crop to cultivate over the area. In Zone B, maize has the highest likelihood of successful growth at 61%, followed by watermelon at 17%, orange at 12%, mango at 9%, and papaya at 1%. This data-driven method is expected dramatically improve farmers' decision-making processes, allowing them to make informed decisions about crop selection approach. Not only that, but also this technological approach can increase the production output to agricultural society and cutoff unnecessary cost like purchasing fertilizer by cultivating the right crop based on the available ecological requirements. The solution would also help farmer to assess the nutrient level and take treatment measure to restore the deficient nutrients. The method improves precision agriculture and adds to the general improvement of modern farming practices to the society.