Auto Smoke Exhaust Fan + Real-Time Web Monitor | D1 Mini MQ-2 Relay

Auto Smoke Exhaust Fan + Real-Time Web Monitor | D1 Mini MQ-2 Relay

Introduction

Worried about smoke buildup and poor air quality in your home or workspace? The Auto Smoke Exhaust Fan project using the D1 Mini offers a smart and automated solution! This system uses an MQ-2 smoke sensor to detect elevated smoke levels and automatically turns on the exhaust fan via a relay module. When smoke levels drop, the fan switches off to save energy. Plus, you can monitor real-time air quality and fan status remotely through the D1 Mini’s built-in webserver via its IP address. This project is perfect for DIY electronics enthusiasts and anyone interested in smart home automation.

Why Build an Auto Smoke Exhaust Fan?

Smoke and harmful gases can accumulate unexpectedly, posing risks to health and comfort. This project provides a hands-free, automatic ventilation solution that reacts instantly to changing air conditions. It’s an ideal way to learn about sensor interfacing, relay control, IoT web monitoring, and home safety automation. Whether for kitchens, garages, or workshops, this fan system helps ensure safer, fresher air with minimal manual intervention.

Components Required

To build this project, you'll need:

  • D1 Mini (ESP8266): The main controller and webserver host

  • MQ-2 Smoke Sensor Module: Detects smoke and gas concentrations

  • OLED Display: Shows real-time sensor readings locally

  • Relay Module: Controls power to the exhaust fan

  • Power Supply and Wiring: To power the modules and fan

How It Works

The MQ-2 sensor continuously monitors air quality for smoke or gas. When detected smoke concentration rises above a set threshold, the D1 Mini activates the relay to switch the exhaust fan ON, extracting smoke. As the smoke clears and levels fall below the threshold, the relay switches the fan OFF to conserve power. Simultaneously, the system updates sensor readings and fan status live on a webserver hosted by the D1 Mini, accessible via the device’s IP address on your local network, giving you remote monitoring and control capabilities.

Step-by-Step Instructions

  1. Sensor and Relay Wiring
    Connect the MQ-2 sensor and relay module to the D1 Mini according to the wiring diagram. Connect the exhaust fan to the relay output.

  2. OLED Display Setup
    Wire the OLED display to the D1 Mini for local real-time status display of smoke levels and fan state.

  3. Programming the D1 Mini
    Upload the provided Arduino sketch to handle sensor readings, relay control, OLED updates, and webserver functionality.

  4. Network Configuration
    Use WiFi credentials to connect the D1 Mini to your home network, enabling web access.

  5. Testing and Calibration
    Simulate smoke or gas, verify that the fan turns ON and OFF automatically based on thresholds, and check that real-time data updates correctly on the web interface.

Code and Setup Instructions

Before uploading the code, make sure to replace the placeholder WiFi credentials in the sketch with your own network’s SSID and password to enable the webserver connection. Look for and update this part in the Arduino code:

const char* ssid = "YOUR_WIFI_NETWORK_SSID";
const char* password = "YOUR_WIFI_PASSWORD";

Replace YOUR_WIFI_NETWORK_SSID and YOUR_WIFI_PASSWORD with your WiFi router’s actual network name and password for successful connection.

Code

Copy and upload the code to your D1 Mini using the Arduino IDE. The code handles smoke detection, relay switching, OLED display updates, and hosts a webserver for real-time monitoring.

Code Link - https://github.com/kitkraftin/Arduino_auto_smoke_exhaust_fan.git

Video Tutorial

Watch a quick demo and tutorial on our YouTube channel:
🔗 Auto Smoke Exhaust Fan + Real-Time Web Monitor | KitKraft DIY Project


Applications

  • Home Safety: Automatically ventilate kitchens, garages, or smoking areas

  • Workshop Monitoring: Protect against harmful fumes in small workspaces

  • IoT Learning: Hands-on experience with sensors, relays, displays, and web servers

  • Energy Efficiency: Save power with automated fan control

Get Started!

Visit KitKraft.in to order quality components for this build today! Start your journey into smart home automation with this practical and innovative project.

Conclusion

The Auto Smoke Exhaust Fan with Real-Time Web Monitoring project is not just a functional home safety tool—it’s also a fantastic learning platform for IoT and embedded systems enthusiasts. By building this system, you’ll gain hands-on experience with sensor technology, relay switching, OLED interfaces, and webserver hosting all in one compact device.

Share your project creations with #KitKraftIndia on social media. Let’s create smarter, safer homes together!

Welcome to Our Store!

Please be aware that orders placed between 13th Oct and 26th Oct will begin shipping from 27th Oct. Feel free to browse and place your orders at any time. We appreciate your visit!

For faster delivery, some of our products are available for immediate shipping through our Amazon FBA store. You can find these items ready to ship by visiting us here:
Kitkraft on Amazon.in

Thank you for stopping by, and happy shopping!