The problem
Mushroom growers walk a narrow environmental line. Oyster and button mushrooms fruit best when the chamber air sits around 75–90% relative humidity and 20–28°C, and regular fresh-air exchange keeps carbon dioxide from building up — elevated CO2 stretches stems and stalls cap development. Most small growers manage this by hand: misting on a fixed schedule, opening vents by feel, and glancing at a thermometer when they remember. That manual loop is inconsistent. Mist too often and the substrate waterlogs; forget the fan and CO2 climbs while nobody is watching. There is no continuous record of what actually happened inside the chamber, so problems are usually diagnosed after the flush is already spoiled.
This project automates that loop with an ESP32-based IoT controller. A DHT22 measures temperature and humidity while an NDIR CO2 sensor watches the air; the controller switches a relay-driven ultrasonic humidifier and an exhaust fan against configurable thresholds, shows live values on a local OLED, and publishes everything to a cloud dashboard with alerts. It is a complete sense-decide-actuate demonstration of environmental control for precision agriculture.
Measures chamber temperature and relative humidity inside the grow chamber.
Follow the working sequence
How it works
- The DHT22 and the NDIR CO2 sensor sit inside the grow chamber and continuously sample temperature, relative humidity and CO2 concentration.
- The ESP32 reads both sensors on a fixed sampling loop (approximately every 2 seconds, configurable) and smooths the readings with a moving average.
- Each smoothed value is compared against its configured thresholds: humidity low/high band, temperature high limit, and CO2 fresh-air limit.
- On a threshold crossing, the firmware drives the relay module — energizing the ultrasonic humidifier to raise humidity, or the exhaust fan to vent heat and CO2 — with hysteresis so the relays do not chatter.
- Live readings, relay states and threshold flags appear on the 0.96-inch OLED at the chamber and can be overridden with the manual push-buttons.
- The ESP32 publishes the readings and actuator states over Wi-Fi to the cloud dashboard, which renders live graphs and a history view.
- When any value stays outside its configured band for the confirmation period, the dashboard raises a threshold alert and the OLED flags the condition locally.
Tech stack:
- ESP32 development board (Wi-Fi)
- DHT22 temperature/humidity sensor
- MH-Z19B class NDIR CO2 sensor module (0–5000 ppm)
- 4-channel relay module, ultrasonic humidifier, 5 V exhaust fan
- 0.96-inch OLED display
- Cloud dashboard (Blynk / ThingSpeak class)
- Arduino IDE (C/C++ firmware)
| Parameter | Value |
|---|---|
| Controller | ESP32 development board, dual-core, Wi-Fi 802.11 b/g/n |
| Temperature sensing | DHT22, −40 to 80°C range, ±0.5°C accuracy (datasheet value) |
| Humidity sensing | DHT22, 0–100% RH range, ±2% RH typical accuracy (datasheet value) |
| CO2 sensing | NDIR module, MH-Z19B class, 0–5000 ppm range, ±(50 ppm + 5% of reading) (datasheet value), ~3 min warm-up |
| Control outputs | Relay-switched ultrasonic humidifier and 5 V exhaust fan, hysteresis on/off control |
| Thresholds | Humidity band, temperature limit, CO2 fresh-air limit — all configurable in firmware (design defaults: RH 80–90%, temp 28°C, CO2 1000 ppm) |
| Local display | 0.96-inch OLED, live temperature / humidity / CO2 plus relay status |
| Cloud | Wi-Fi telemetry to Blynk/ThingSpeak-class dashboard with graphs and alerts; needs internet |
| Sampling interval | Approximately 2 seconds (configurable) |
| Power | 5 V USB supply for logic; humidifier and fan powered per their own ratings through the relay |
| Chamber | Transparent demo chamber, approximately 30 × 20 × 20 cm (design size, demo scale) |
Project features
- [Closed-loop humidity control] The ESP32 reads chamber humidity from the DHT22 and switches the ultrasonic humidifier through a relay when humidity falls below the configured lower threshold, cutting it at the upper threshold with a configurable hysteresis band.
- [Temperature monitoring with over-temperature ventilation] Chamber temperature is read continuously from the DHT22; if it rises past the configured high-temperature limit, the controller runs the exhaust fan to vent warm air and alerts on the dashboard.
- [CO2-driven fresh-air exchange] The NDIR CO2 sensor reports chamber CO2 in ppm; when the reading exceeds the configured fresh-air threshold (design default 1000 ppm, adjustable), the exhaust fan cycles to exchange the air and bring CO2 down.
- [Cloud dashboard with live graphs] Temperature, humidity and CO2 are published over Wi-Fi to a cloud dashboard (Blynk/ThingSpeak class) with live value cards and trend graphs, so the chamber can be watched from anywhere.
- [Threshold alerts] Crossing any configured limit raises a visible alert on the dashboard and on the local OLED; push/email notification wiring is included where the chosen cloud plan supports it.
- [Local OLED readout and manual override] A 0.96-inch OLED shows live temperature, humidity and CO2 at the chamber, and push-buttons allow manual fan/humidifier override without touching the firmware.
- [Fully configurable thresholds] Every setpoint and the hysteresis band is adjustable in firmware constants or through the dashboard (where supported) — the student tunes the chamber to their mushroom variety during calibration.
- [Optional: GSM alert module] As an optional customization, a GSM module can be added for SMS alerts when Wi-Fi is unreliable at the installation site; it is not part of the base build.
What is included
- Working prototype: ESP32 controller, sensors, relay module, humidifier, exhaust fan, demo chamber and OLED, wired and tested
- Complete firmware source code (Arduino IDE, C/C++) with configurable thresholds
- Circuit and wiring documentation with connection diagrams
- Component list with exact part numbers used in the build
- Cloud dashboard setup guide (account, widgets, alert configuration)
- Threshold calibration procedure for the student's own chamber
- Project report PDF (background, design, methodology, readings, results)
- PPT presentation for final review
- Viva Q&A preparation document
Limitations & prerequisites
- DHT22 accuracy is ±0.5°C / ±2% RH per its datasheet; readings also depend on sensor placement and a simple offset calibration the student performs — it is not a reference instrument.
- The NDIR CO2 module needs roughly 3 minutes of warm-up after power-on and reads ±(50 ppm + 5% of reading) per its datasheet; the first readings after boot should be ignored.
- The cloud dashboard, remote graphs and alerts need continuous Wi-Fi and internet; local sensing, control and the OLED keep working offline.
- The demo chamber is a small transparent box (approximately 30 × 20 × 20 cm, design size) — a demonstration scale, not a commercial grow room; a larger chamber needs bigger actuators.
- The ultrasonic humidifier's water reservoir must be refilled manually; run time per fill depends on the mist rate and chamber size (component-dependent).
- Control is hysteresis-based on/off switching through relays, not PID or proportional control; relay contact ratings must not be exceeded.
- This is an academic prototype, not an industrial-certified environmental control system.
Frequently Asked Questions
Which controller is used and why?
The ESP32. It has built-in Wi-Fi for the cloud dashboard, enough GPIO and UART/I2C lines for the DHT22, the CO2 module, the relay board and the OLED at once, and it runs on the familiar Arduino framework — so the student can read, explain and modify every line of firmware in the viva.
Can the sensors be replaced?
Yes, within limits. The DHT22 can be swapped for a DHT11 (lower accuracy, ±2°C / ±5% RH datasheet) or an SHT31 (higher accuracy) with small firmware changes, and other NDIR CO2 modules with a UART interface can replace the MH-Z19B class unit. Any swap needs re-calibration, and the report documents which sensor the delivered build uses.
Does it work without Wi-Fi?
Partially. Sensing, threshold comparison, humidifier/fan switching and the local OLED display all run on the ESP32 itself and work with no network at all. The cloud dashboard, remote graphs and alerts need Wi-Fi and internet — if the connection drops, local control continues and telemetry resumes on reconnect.
What power supply is needed?
The logic side (ESP32, sensors, OLED) runs from a standard 5 V USB supply drawing well under 1 A in normal operation. The ultrasonic humidifier and exhaust fan are powered per their own ratings through the relay module's switched contacts — the wiring guide shows the exact supply arrangement, and relay contact ratings must be respected.
Can GSM, LoRa or Bluetooth be added?
Yes, as optional customizations. A GSM module adds SMS alerts where Wi-Fi is unreliable, LoRa suits a farm with the chamber far from any router, and Bluetooth allows a phone app for local monitoring. Each is quoted separately because it changes the hardware and firmware; the base build is Wi-Fi only.
Is this project suitable for a final-year project?
Yes — for Electronics, Electrical, IoT & Embedded and Instrumentation programs. It demonstrates sensor interfacing, threshold-based control logic, relay actuation, Wi-Fi telemetry, cloud dashboards and calibration methodology, and the student collects and analyzes real chamber data for the final report. Suitable for B.E./B.Tech final-year projects in Electronics, Electrical, IoT and Instrumentation.
Components & software requirements
- ESP32 development board (Wi-Fi)
- DHT22 temperature/humidity sensor
- MH-Z19B class NDIR CO2 sensor module (0–5000 ppm)
- 4-channel relay module, ultrasonic humidifier, 5 V exhaust fan
- 0.96-inch OLED display
- Cloud dashboard (Blynk / ThingSpeak class)
- Arduino IDE (C/C++ firmware)
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.
Download free synopsis (PDF)
Enter your name and email — the synopsis PDF downloads immediately. We may send occasional project updates; no spam, unsubscribe anytime.