Production
Mushroom Ki Mandi
Mushroom Ki Mandi is a smart IoT platform for mushroom farmers. ESP32 sensors monitor temperature, humidity, and air quality inside grow rooms in real time. When conditions drift, relays kick in automatically - fans, humidifiers, heaters - keeping the environment dialed in for each growth stage. The platform tracks the full cycle from inoculation to harvest, and connects growers directly to buyers through a built-in marketplace. Real sensors, real farms, real mushrooms.
# What It Does
Climate Monitoring
ESP32 microcontrollers with DHT22/BME680 sensors continuously monitor temperature, humidity, and air quality in grow rooms. Data published via MQTT.
Growth Stage Tracking
Track mushroom growth cycles from inoculation through fruiting to harvest. Each stage has optimal environmental parameters that trigger alerts if breached.
Relay Automation
Automated relay control for fans, humidifiers, and heaters based on sensor readings. Rules engine maintains optimal growing conditions per stage.
Dashboard & Alerts
React frontend shows live sensor data, growth stage status, relay states, and historical charts. Real-time alerts when conditions drift from optimal ranges.
# Architecture
┌────────────────────────────────────────┐
│ MUSHROOM FARM │
│ │
│ [ESP32 + DHT22/BME680] │
│ │ MQTT publish │
│ ▼ │
│ [MQTT Broker] │
│ │ │
│ ▼ │
│ [FastAPI Backend]──[PostgreSQL] │
│ │ WebSocket │
│ ▼ │
│ [React Dashboard] │
│ Climate · Stages · Relays · Alerts │
└────────────────────────────────────────┘
Relay Control Loop:
Sensor → Backend → Rules Engine
→ MQTT command → ESP32 → Relay ON/OFF# Stack
| Backend | FastAPI · SQLAlchemy (async) · PostgreSQL · Alembic migrations |
| Frontend | React · TypeScript · Tailwind CSS · Historical charts |
| Firmware | ESP32 · PlatformIO · Arduino framework · DHT22/BME680 drivers |
| Protocol | MQTT (paho-mqtt backend, PubSubClient ESP32) |
| Infra | Docker Compose · Mosquitto broker |
| Testing | pytest (auth, climate, dashboard, devices, firmware, readings, relay, security) |
| CI/CD | Docker-based deployment pipeline |
# How It Works
Each grow room has an ESP32 microcontroller wired to DHT22 or BME680 sensors. Every few seconds, temperature, humidity, and air quality readings are published over MQTT to the backend. The rules engine compares readings against optimal ranges for the current growth stage - if humidity drops below threshold during fruiting, it fires a relay command back to the ESP32 to turn on the humidifier.
Farm owners see everything on a React dashboard - live sensor tiles, historical charts, growth stage timelines, relay states, and alerts. The marketplace side connects growers with buyers, letting them list harvests and manage orders.
The system runs in production on real mushroom farms with real hardware. Currently live and under rigorous testing at mushroomkimandi.com.