Inspiration

Agriculture remains the backbone of our economy, yet many farmers still rely on guesswork when deciding what crops to plant. We were inspired by the struggles of smallholder farmers who often face poor yields due to unpredictable weather, unsuitable soil conditions, and lack of access to expert advice. CropIQ was born out of a desire to merge technology and data-driven insights to empower farmers with smart, localized, and actionable farming decisions.

What it does

CropIQ is a smart, data-driven crop recommendation and soil analysis system designed to help farmers make informed agricultural decisions. It combines Machine Learning (ML) and Internet of Things (IoT) to analyze soil and environmental data, then recommends:

The most suitable crop to grow, based on soil nutrient composition and environmental conditions.

The appropriate fertilizer type and quantity, tailored to the soil’s current nutrient balance.

Real-time monitoring of soil temperature, humidity, and pH using sensors connected to an ESP32 microcontroller for continuous data collection and on-field feedback. Example Use Case

A farmer enters: N = 90, P = 42, K = 43, Temperature = 26°C, Humidity = 80%, pH = 6.5, Rainfall = 200 mm CropIQ processes this and outputs: Recommended Crop: Rice Fertilizer Suggestion: Urea – 50 kg/acre

With IoT sensors installed, the farmer can continuously monitor conditions, and CropIQ updates recommendations dynamically if weather or soil metrics change.

How we built it

We started by defining the key agricultural problem — farmers lacking accurate, real-time data to decide which crops to plant. We collected sample soil and environmental datasets (Nitrogen, Phosphorus, Potassium, temperature, humidity, pH, and rainfall) and trained a Machine Learning classification model using scikit-learn.

For the user interface, we developed a web app that allows farmers to input soil parameters and instantly receive predictions for the most suitable crop and fertilizer recommendation.

To make the system more practical, we integrated IoT sensors (DHT11, soil moisture, and pH sensors) connected to an ESP32 microcontroller, which continuously transmits data to the model for real-time updates.

The result is a hybrid system that combines AI intelligence and IoT-based sensing, enabling precision farming that’s affordable and easy to deploy.

Challenges we ran into

Sensor calibration issues: We lacked a pH sensor to measure values and had to use mock data.

Integration delays: Synchronizing the IoT data stream with the web app’s backend proved difficult, especially under unstable network conditions.

Accomplishments that we're proud of

Successfully trained and deployed a crop recommendation model that predicts the most suitable crop with high accuracy.

Integrated IoT sensors to provide real-time soil and environmental feedback.

Designed a simple, clean, and intuitive user interface accessible even to small-scale farmers.

Built an end-to-end prototype that demonstrates how AI and IoT can merge to revolutionize agriculture for developing regions

What we learned

How to build and deploy an ML model that can generalize to real-world, noisy data.

How to integrate IoT devices with cloud and web platforms, managing live data transmission.

What's next for CropIQ

Expand the dataset with localized soil samples from different Kenyan regions for higher accuracy.

Develop a mobile-friendly app that works offline and syncs automatically when internet access returns.

Partner with agricultural agencies to deploy CropIQ on pilot farms and gather user feedback for scaling.

Built With

Share this project:

Updates