The MQ-2 smoke sensor continuously monitors the surrounding air for harmful gases or smoke particles. When the concentration exceeds a predetermined threshold, the D1 Mini microcontroller triggers a relay module to switch on the exhaust fan. Once the smoke dissipates and levels return to normal, the relay turns off the fan to save power. Simultaneously, the D1 Mini updates local OLED display readings and hosts a webserver, allowing users to check the system status via a local network IP address.
Why Build This
Provides hands-free, automated ventilation for kitchens and workshops
Offers remote real-time air quality monitoring via a local web interface
Saves energy by automatically turning off the fan when smoke clears
Great learning project for IoT automation and sensor integration
Real-World Application
This automated exhaust system is ideal for kitchens, garages, and workshops where smoke, fumes, or gas build up unexpectedly, ensuring cleaner air and improved fire safety with minimal manual intervention.
Skills You'll Learn
Interfacing MQ-2 gas sensors with microcontrollers
Controlling AC/DC loads using relay modules
Displaying real-time sensor data on an OLED screen
Hosting a local webserver on the ESP8266
Safety Precautions
Exercise caution when working with mains-powered appliances like exhaust fans; ensure all high-voltage AC connections are properly insulated and isolated from low-voltage DC logic circuits. Always disconnect power before making any wiring adjustments or handling the relay module. Double-check all sensor and microcontroller pin connections to prevent short circuits.
Technology Tags
ESP8266
D1 MINI
MQ-2 SENSOR
RELAY MODULE
OLED DISPLAY
EXHAUST FAN
WEB SERVER
Frequently Asked Questions
Standard Arduino boards like the Uno lack built-in Wi-Fi capabilities required for the real-time web monitor feature. A Wi-Fi-enabled board such as the D1 Mini (ESP8266) is necessary.
You need to update the placeholder SSID and password in the Arduino sketch with your actual Wi-Fi router credentials before uploading the code.
The relay module acts as an electronic switch capable of controlling low-power DC fans or standard AC exhaust fans, provided the relay's voltage and current ratings are respected.
This page is part of Kitkraft's Project Hub — a curated collection of electronics & robotics projects gathered from the maker community to help students and hobbyists discover and learn to build. Kitkraft does not claim authorship of the original project, and makes no representation as to the accuracy, completeness or safety of third-party source material. The summary and "How It Works" explanation above are AI-generated, rewritten with reference to the original tutorial — not a reproduction of it. Full credit and a direct link to the original source are provided above. If you're the original creator and have a concern about how your work is represented here, please contact us and we'll address it promptly.