Building Krushi Mitra
By Solanki Trushen
Namaste coders and agri-tech enthusiasts! 👨🌾💻
What happens when you mix IoT sensors, Next.js, and desperate farmers? Krushi Mitra - our hackathon project that accidentally became a real-world solution. Here's the tech story behind it!
The Soil Sensor Revolution
We started with three Arduino kits and big dreams:
// Sensor data visualization component
const SoilHealthCard = ({ nitrogen, phosphorus, potassium }) => {
return (
<div className="bg-green-50 p-4 rounded-lg">
<h3 className="font-bold text-green-800">Soil Nutrition</h3>
<div className="grid grid-cols-3 gap-2 mt-2">
<GaugeChart value={nitrogen} label="N" color="blue" />
<GaugeChart value={phosphorus} label="P" color="orange" />
<GaugeChart value={potassium} label="K" color="purple" />
</div>
</div>
);
};| Sensor | Accuracy | Cost |
|---|---|---|
| NPK Sensor | ±2% | ₹1,200 |
| pH Sensor | ±0.5 | ₹800 |
| Moisture | ±3% | ₹500 |
The AI Recommendation Engine
Our crop suggestion algorithm used:
- Soil data from sensors
- Historical yield data
- Weather forecasts
# Simplified recommendation logic
def recommend_crop(soil_data, weather):
if soil_data.nitrogen > 200 and weather.rainfall > 50:
return "Cotton"
elif soil_data.ph < 7 and weather.temp > 30:
return "Groundnut"
else:
return "Wheat"The Rental Marketplace UI
Built with Next.js + Material UI:
<ToolCard
name="Tractor"
owner="Ramesh Patel"
rate="₹500/day"
available={true}
image="/tractor.jpg"
/>Performance Wins
- Lazy-loaded tool images → 40% faster page loads
- IndexedDB caching → Works offline in fields
- SMS fallback → For low-network areas
Pro Tip: Always design for 2G speeds when building for rural users!