← How-Tos
workshop 1 hr ago ◯ 5 min read

Automating Shop Ventilation with CO2/VOC Sensors and ESP32-Controlled Fan Interlocks

ventilationair qualityESP32home automationshop safety

Most home shop ventilation runs on one of two settings: on, because you remembered to flip the switch before starting a resin pour or a big engraving job, or off, because you forgot. Neither is great — running exhaust fans continuously wastes conditioned air and adds needless noise, while forgetting to turn them on defeats the entire point of having them. Automating shop ventilation around actual air quality sensor readings, rather than a schedule or a manual switch, closes that gap: fans and dampers respond to what's actually in the air, ramping up when a laser job or a resin cure genuinely needs it and staying quiet the rest of the time.

This is a control-system project more than a single build — it's a pattern for wiring air quality sensors to relays and dampers through an ESP32 or Home Assistant, and it applies whether you're managing a laser fume exhaust, a resin curing station, or general shop air turnover.

Choosing What to Sense

Different shop hazards show up on different sensor types, and picking the wrong one means your automation reacts to the wrong thing (or nothing at all):

SensorDetectsGood For MQ-series gas sensors (MQ-135, MQ-2)Broad VOC/smoke/combustible gas presence, low precisionCheap trigger-level detection — "something's off" rather than a calibrated number SGP30 / SGP40 (eCO2, VOC index)Volatile organic compounds from resin, solvents, off-gassing filamentResin curing stations, enclosure off-gassing monitoring SCD40 / SCD41 (true NDIR CO2)Actual CO2 concentration, not just VOC proxyGeneral shop air turnover and occupied-space ventilation decisions PM2.5/PM10 particulate sensors (PMS5003, SPS30)Fine dust and smoke particulateSanding stations, laser smoke, CNC dust collection triggers

For a laser or resin station, pair a VOC sensor with a particulate sensor — VOCs and visible smoke don't always track together, and a laser job that produces heavy particulate with low VOC (cutting plywood) needs a different automated response than one that's VOC-heavy with little visible smoke (cutting acrylic).

Wiring the Control Loop

The basic architecture is the same regardless of which sensor you choose: an ESP32 reads the sensor over I2C, compares the value against thresholds, and switches a relay that controls your exhaust fan or a damper actuator. This site's guides on relays and solid-state relays and on environmental sensor calibration and drift cover the component-level details — the pattern here is how to combine them into a working interlock rather than a standalone sensor readout.

  1. Wire the VOC/CO2/particulate sensor to the ESP32 over I2C (most of these breakout boards share the bus, so multiple sensors can run off two GPIO pins).
  2. Use a solid-state relay, not a mechanical relay, to switch the exhaust fan — SSRs handle the fan's inductive motor load more reliably over the thousands of switching cycles an automated system will rack up compared to manual on/off use.
  3. Set a two-tier threshold rather than a single trigger point: a lower threshold ramps the fan to a low/background speed (if your fan supports PWM or multi-speed control), and a higher threshold kicks it to full speed. This avoids the fan cycling on and off rapidly right at a single trigger boundary.
  4. Add a minimum run-time and a debounce delay in firmware — without one, a sensor reading that hovers right at the threshold will chatter the relay on and off every few seconds, which is hard on both the relay and the fan motor.
  5. Publish sensor readings and fan state to MQTT or directly into Home Assistant via ESPHome, so you get a dashboard and history of what triggered the fan and when, rather than a black box that just turns on sometimes.

Damper and Multi-Zone Control

If your shop has ducted extraction serving more than one machine (laser and resin station on a shared exhaust run, for example), a motorized damper at each branch lets the automation route airflow to whichever zone actually triggered — rather than running the whole system at full blast for a sensor event happening at just one station. A 12V or 24V damper actuator, driven through the same relay logic as the fan itself, is the simplest way to add this: open the damper for the zone with the elevated reading, close or throttle the others, and let the main exhaust fan run at a speed proportional to how many zones are currently open.

Setting Sensible Thresholds

Don't guess at thresholds — log baseline readings from each sensor during normal shop idle time and during known "dirty" events (a real laser job on plywood, a resin pour) for at least a few sessions before picking trigger values. A CO2 threshold that makes sense for occupied-space air quality (around 1000-1200ppm as a general "time to ventilate" guideline) is a completely different number from a VOC index threshold meaningful for resin off-gassing, and the only way to get these right for your specific shop and machines is to watch what the sensors actually report during real use, not a datasheet default.

Fail-Safe Behavior

Design the system so a sensor failure or a lost WiFi connection defaults to the fan running, not off — losing sensor data should never silently disable your ventilation. A simple watchdog timer in the ESP32 firmware that forces the relay to a known "fan on" state if it hasn't received a valid sensor reading within an expected interval keeps a wiring fault or a crashed sensor from leaving a room unventilated during exactly the job that needed it most.

Safety

This kind of automation manages air quality and comfort — it is not a substitute for a dedicated fire/smoke detection and shutdown system, which needs its own independent hardware and should never share a single point of failure with your ventilation controller. Treat automated ventilation as a comfort and long-term-exposure control layer, keep your primary safety equipment (respirators for solvent and resin work, proper enclosure sealing, fire extinguishers rated for the machines involved) exactly as rigorous as it would be without the automation, and don't let a "the fan will kick on automatically" mindset replace situational awareness during any job that produces genuinely hazardous fumes.

Once the thresholds are dialed in from real logged data, this kind of closed-loop ventilation quietly does the job a manual switch never reliably will — running exactly when the air actually needs it, and leaving you one less thing to remember before starting a job.