Back to Projects
IoT Artificial Intelligence ESP32 Python MongoDB

Smart Farming IoT and AI-Driven Crop Recommendation System

An integrated system using ESP32 sensors and AI to analyze soil conditions and market prices, providing real-time crop recommendations for small-to-medium scale farmers.

Smart Farming IoT and AI-Driven Crop Recommendation System

Project Overview

Farmers in Indonesia frequently face harvest failures and volatile market prices, leading to significant financial losses and reduced welfare. This project offers a technological solution by integrating IoT sensors with AI models to analyze soil content and predict optimal crop suitability. By combining real-time environmental data with market price information, the system empowers small-to-medium scale farmers to make informed, data-driven planting decisions. The ultimate goal is to optimize agricultural yields and improve the economic sustainability of farming practices.

System Architecture

1

ESP32 Microcontroller

Acts as the central hub for developing sensors and managing data transmission from the agricultural field.

2

Multi-Sensor Array

Includes DHT22, pH, and soil moisture sensors to collect comprehensive environmental and soil data.

3

MongoDB Atlas

Provides a scalable cloud-based NoSQL database for centralized storage of all captured sensor information.

4

AI Model (Python)

Analyzes soil content data and market price trends to predict the most suitable crops.

5

Streamlit Web App

Serves as the interactive user interface to display sensor data and crop recommendations to farmers.

Key Features

Real-Time Soil Analysis

Continuous monitoring of moisture, pH, and temperature through an integrated IoT sensor network.

AI-Powered Predictions

Utilizes machine learning to compare real-time sensor data with ideal crop growth parameters.

Market Price Integration

Real-time food price data is incorporated to ensure recommendations are economically viable for farmers.

Unified Dashboard

A centralized website displays detailed sensor metrics (NPK, Humidity, Temp) alongside specific crop results.

Multi-Device Compatibility

Designed as an improvement over manual methods, allowing integration with various hardware devices.

System Flow

1

Data Acquisition

IoT sensors deployed in the field collect real-time soil and atmospheric data via ESP32.

2

Data Classification

The collected raw sensor metrics are processed and categorized for analysis.

3

AI Comparison

The system compares categorized sensor data against AI models and integrated market price datasets.

4

Recommendation Generation

Based on the analysis, the system identifies and recommends the best crop for the current conditions.

5

Web Visualization

Final results and crop suggestions (e.g., "coffee") are displayed on the farmer's web dashboard.

Project Outcome

The project successfully delivered an end-to-end smart farming solution that replaces manual analysis with automated AI insights. Real-world testing demonstrated the system's ability to ingest data to accurately suggest crops like coffee. This tool provides farmers with a measurable unique value proposition through improved decision-making accuracy and integrated market awareness.

Screenshots

Prototype
Dashboard