Building a Smart Fume Extractor with ESP32


Soldering without proper ventilation is a bad idea. Commercial fume extractors work fine, but I wanted something smarter — a system that monitors air quality in real time, adjusts fan speed automatically, and logs data to a local dashboard.

Here’s how I built one with an ESP32, a BME680 sensor, and a 120mm fan.

The Hardware

The parts list is short:

ComponentPurposeCost
ESP32-S3 DevKitMain controller + WiFi$8
BME680Air quality + temp + humidity$12
120mm PC Fan (PWM)Extraction
MOSFET ModuleFan speed control$3
3D Printed EnclosureHousing—
Carrier board — ESP32-S3, BME680, MOSFET driver, USB-C power input

Wiring It Up

The connections are straightforward. The BME680 communicates over I2C, and the fan PWM signal runs through a MOSFET for level shifting.

#include <Wire.h>
#include <Adafruit_BME680.h>

#define FAN_PWM_PIN 25
#define I2C_SDA 21
#define I2C_SCL 22

Adafruit_BME680 bme;

void setup() {
  Serial.begin(115200);
  Wire.begin(I2C_SDA, I2C_SCL);

  if (!bme.begin()) {
    Serial.println("BME680 not found!");
    while (1);
  }

  // Configure oversampling
  bme.setTemperatureOversampling(BME680_OS_8X);
  bme.setHumidityOversampling(BME680_OS_2X);
  bme.setGasHeater(320, 150);

  ledcAttach(FAN_PWM_PIN, 25000, 8);
}

The Control Algorithm

Fan speed scales linearly with air quality index. Below a threshold, the fan runs at minimum speed to keep airflow moving. Above the danger zone, it runs at full blast.

interface AirQualityReading {
  gasResistance: number;  // Ohms
  temperature: number;    // Celsius
  humidity: number;       // Percent
  iaq: number;           // 0-500 index
}

function calculateFanSpeed(reading: AirQualityReading): number {
  const MIN_SPEED = 30;   // percent
  const MAX_SPEED = 100;
  const IAQ_THRESHOLD = 50;
  const IAQ_DANGER = 200;

  if (reading.iaq <= IAQ_THRESHOLD) return MIN_SPEED;
  if (reading.iaq >= IAQ_DANGER) return MAX_SPEED;

  // Linear interpolation
  const range = IAQ_DANGER - IAQ_THRESHOLD;
  const normalized = (reading.iaq - IAQ_THRESHOLD) / range;
  return MIN_SPEED + normalized * (MAX_SPEED - MIN_SPEED);
}

Web Dashboard

The ESP32 serves a minimal web interface over WiFi. It pushes sensor data via WebSocket every 2 seconds. The frontend is vanilla HTML — no framework needed for something this simple.

The best interface is the one that stays out of your way. For a workshop tool, that means big numbers, clear status, and zero configuration.

The dashboard shows:

  • Current IAQ — large number with color coding
  • Fan speed — percentage with visual bar
  • Temperature & humidity — secondary readouts
  • 24-hour trend — simple sparkline chart

Enclosure Design

The enclosure was designed in Fusion 360 and printed in PETG for heat resistance. Key design decisions:

  • Snap-fit lid — no screws needed for filter changes
  • Carbon filter slot — standard 120mm activated carbon filter
  • Angled intake — 30-degree tilt for better desk positioning
  • Cable routing channels — clean USB-C power input

Results

After a week of testing, the system works well. The automatic speed control means I never think about ventilation while soldering — it just handles it. The dashboard is overkill for daily use, but the 24-hour log helped me realize my workshop ventilation needed improvement even when I wasn’t soldering.

Total build cost: about $33 plus filament. Total build time: one weekend. Worth it.