FarmAssist: Free AI Crop Doctor for Smallholder Farmers

by Anuraaag in Circuits > Computers

94 Views, 1 Favorites, 0 Comments

FarmAssist: Free AI Crop Doctor for Smallholder Farmers

farm_hero.png
Screenshot_20260608_153759_Chrome.jpg
Screenshot_20260608_154210_Chrome.jpg
Screenshot_20260608_154247_Chrome.jpg

The Problem

800 million people go hungry every year. One major reason: crop diseases that farmers can't identify in time.

This project grew out of conversations about why crop disease diagnosis is so inaccessible for the people who need it most. In India alone, over 100 million smallholder farmers lose up to 40% of their harvest annually to preventable crop diseases. The solution — an agronomist — costs money most of them simply don't have. A single farm visit can cost more than a week's income.


The Solution

FarmAssist puts a free crop doctor in every farmer's pocket. Take a photo of a diseased crop leaf. In seconds, get a diagnosis: what disease it is, how severe, and exactly how to treat it — with both organic and chemical options.

Free. Forever. No app store. Works on any smartphone.

This is AI being used the way it should be — not for entertainment, but to protect livelihoods and feed people.


How It Contributes to a Better World

  1. Reduces crop loss → more food, less hunger
  2. Protects farmer income → less rural poverty
  3. Democratizes expert knowledge → accessible to anyone with a smartphone
  4. Reduces unnecessary pesticide use → healthier soil and environment


Live app: FarmAssist Live

Watch it in action: Project Video

Source code: Github Repo

Future hardware design: Tinkercad Design

Supplies

  1. Computer with Node.js 18+
  2. Groq account (free AI API) — https://console.groq.com
  3. GitHub account — https://github.com
  4. Vercel account (free frontend hosting) — https://vercel.com
  5. Railway account (free backend hosting) — https://railway.app
  6. Any smartphone (Android gets full install experience; iPhone works via Safari)
  7. Autodesk Tinkercad (free, browser-based) — https://tinkercad.com


Total Monthly Cost: $0

Get Your Free AI Key

2026-06-08_15-53.png

The app uses Groq's free AI API to analyze crop photos. No credit card required.

  1. Go to console.groq.com and sign up with your Google account
  2. Click API Keys in the left sidebar
  3. Click Create API Key, give it a name like "FarmAssist"
  4. Copy the key — it starts with gsk_...
  5. Keep it safe, you'll need it in Step 3

Groq gives you 1,500 free image analyses per day — enough for an entire farming village.

Get the Code

2026-06-08_16-03.png

The full source code is on GitHub. Open a terminal and run:

git clone https://github.com/Anuraaag/FarmAssist.git
cd FarmAssist

The project has two folders:

  1. backend/ — Node.js + Express API server
  2. frontend/ — Angular PWA (Progressive Web App)

Set Up the Backend

backend-terminal.png

Set Up the Backend


Navigate into the backend folder and create your environment file:

cd backend
cp .env.example .env


Open the .env file and paste your Groq API key:

GROQ_API_KEY=gsk_your_key_here
PORT=3000
FRONTEND_URL=http://localhost:4200


Then install dependencies and start the server:

npm install
npm run dev


You should see: FarmAssist backend running on http://localhost:3000

Set Up the Frontend

2026-06-08_16-06.png

Open a new terminal window and run:

cd frontend
npm install
npm start


Open http://localhost:4200 in your browser. You should see the FarmAssist app running locally.

Test It Locally

Screenshot_20260608_153933_Chrome.jpg
Screenshot_20260608_154129_Chrome.jpg
Screenshot_20260608_154138_Chrome.jpg
Screenshot_20260608_154210_Chrome.jpg
Screenshot_20260608_154247_Chrome.jpg
  1. Click the camera/upload box
  2. Select a photo of a crop leaf — or search Google Images for "tomato leaf blight" and save one
  3. Click Diagnose


Within a few seconds you'll see:

  1. Disease name — red if diseased, green if healthy
  2. Confidence badge — High / Medium / Low
  3. Severity badge — None / Early / Moderate / Severe
  4. Organic treatment — uses locally available material
  5. Chemical treatment — generic compound names any agri shop will stock
  6. Isolate plant warning when the disease can spread


Result: Here are two real diagnoses (refer attached screenshots) FarmAssist performed during testing, one diseased leaf, and one healthy. The AI correctly identified iron deficiency Chlorosis with high confidence and provided specific organic and chemical treatment options.


Deploy the Backend (Railway)

2026-06-08_16-12.png
2026-06-08_16-14.png
2026-06-09_11-35.png
  1. Go to railway.app and sign up with GitHub
  2. Click New Project → Deploy from GitHub
  3. Select your forked repo
  4. Set Root Directory to backend
  5. Set Build command: npm install && npm run build
  6. Set Start command: npm start
  7. Go to Variables and add:
  8. GROQ_API_KEY = your Groq key
  9. PORT = 8080
  10. Go to Settings → Networking → Generate Domain
  11. Copy the URL — you'll need it in Step 7

Deploy the Frontend (Vercel)

2026-06-08_16-21.png
  1. Open frontend/src/environments/environment.prod.ts and replace the apiUrl with your Railway URL:
export const environment = {
production: true,
apiUrl: 'https://your-railway-url.up.railway.app'
};
  1. Commit and push to GitHub
  2. Go to vercel.comAdd New Project → import your repo
  3. Set Root Directory to frontend
  4. Click Deploy — copy your Vercel URL
  5. Go back to Railway → Variables and add:
  6. FRONTEND_URL = your Vercel URL

Your app is now live at a public URL, free forever.

Install on Your Phone

Screenshot_20260608_153759_Chrome.jpg
Screenshot_20260608_153925_Chrome.jpg

FarmAssist is a Progressive Web App (PWA) — it installs directly from the browser, no app store needed.


On Android:

  1. Open your Vercel URL in Chrome
  2. Tap the banner that says "Add to Home Screen"
  3. The app installs like a native app
  4. Open it and photograph a crop leaf with your camera


On iPhone:

  1. Open your Vercel URL in Safari
  2. Tap the Share button → Add to Home Screen

Future Hardware Version — Autodesk Tinkercad Enclosure Design

body_and_lid.png
full-model.png

FarmAssist currently runs entirely on any smartphone with zero hardware needed. But the same AI diagnosis engine could power a standalone field device -- a weatherproof sensor unit that sits between crop rows, photographs leaves on a schedule, and sends diagnosis alerts to the farmer's phone via SMS even without the farmer being present.

I designed a concept enclosure for this future version using Autodesk Tinkercad.


The design features:

  1. Main weatherproof housing: 120 × 80 × 50mm
  2. 25mm front-facing camera aperture for Raspberry Pi Camera Module v2
  3. Snap-fit lid for tool-free field servicing
  4. Four pointed soil stakes at corners for stable ground mounting
  5. Five rear ventilation slots to prevent heat buildup
  6. Four M3 screw bosses for secure lid assembly
  7. 3mm wall thickness throughout for outdoor durability
  8. Solar panel mounting channel (90 × 55mm) on the lid top


Intended internals:

  1. Raspberry Pi Zero 2W
  2. Pi Camera Module v2
  3. DHT22 temperature and humidity sensor
  4. 3.7V LiPo battery + 5V solar panel


The design is freely available on Tinkercad. Open it, remix it, and print it on any FDM printer in PLA at 0.2mm layer height, 20% gyroid infill.

Estimated filament: 180g.

Estimated cost: under Rs. 200.


Any farmer cooperative or agricultural NGO with access to a basic 3D printer could manufacture and deploy these at scale.