AI-Powered Precision Agriculture & Smart Fertilizer Dispenser
SmartFert-AI is an end-to-end intelligent agricultural solution designed to optimize fertilizer usage, boost crop yields, and prevent soil degradation. By combining physical hardware sensors with Machine Learning and a modern web dashboard, SmartFert-AI analyzes real-time soil data and environmental conditions to deliver precise fertilizer recommendations.
Instead of generic application rates, our ML models predict the exact NPK (Nitrogen, Phosphorus, Potassium) requirements and application rates needed for specific crops based on live ESP32 soil sensor telemetry.
- Real-Time Soil Monitoring: Live ingestion of soil moisture, NPK levels, and environmental data via ESP32 microcontrollers.
- AI-Driven Predictions: Uses Scikit-Learn models to predict optimal fertilizer application rates and required NPK adjustments based on current soil health and selected crops.
- Smart Dispenser Control: A dedicated UI to monitor and control the automated fertilizer dispensing hardware.
- Multi-Language Support: Full i18n support including English, Tamil, and Hindi for accessibility.
- Responsive Web Dashboard: Built with React & TailwindCSS, offering dynamic charts, history logs, and instant farm insights.
- Frontend: React, TypeScript, Vite, TailwindCSS
- Backend: Python (FastAPI/Flask), Pandas, Scikit-Learn
- Database & Auth: Supabase (PostgreSQL)
- Hardware: ESP32 Microcontroller, Soil Moisture Sensors, NPK Sensors
graph LR
A[ESP32 Sensors] -->|Telemetry| B(Python Backend)
B -->|Logs| C[(Supabase DB)]
B <-->|Inference| D[ML Models]
B <-->|REST/WS| E[React Dashboard]
E -->|Commands| A
- Node.js (v18+)
- Python 3.9+
- Git LFS (Required for downloading ML models)
- A Supabase Account
Because the Machine Learning models are tracked using Git Large File Storage (LFS), ensure you have Git LFS installed before cloning.
git lfs install
git clone https://github.com/Roshanrameshhub/SmartFert-ai.git
cd SmartFert-aiNavigate to the smartfert-ai directory to run the React dashboard.
cd smartfert-ai
npm install
npm run devNavigate to the backend directory to set up the Python environment.
cd backend
python -m venv venv
# On Windows: venv\Scripts\activate
# On Mac/Linux: source venv/bin/activate
pip install -r requirements.txt
# Start your backend server (e.g., uvicorn, flask run, etc.)You will need to configure environment variables for both the frontend and backend.
Frontend (smartfert-ai/.env)
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
VITE_API_BASE_URL=http://localhost:8000Backend (backend/.env)
SUPABASE_URL=your_supabase_project_url
SUPABASE_KEY=your_supabase_service_role_keySmartFert-AI uses customized models trained on agricultural datasets to provide predictions.
model_application_rate.pkl: Determines the required amount of fertilizer per hectare.model_npk.pkl: Predicts the ideal NPK ratio deficit. Note: These models are over 100MB in size and are tracked using Git LFS to keep the repository optimized.
Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.