Kitchen chimney that starts on smoke and heat
Build it step by step
0 of 7 doneWire the sensors and display
Check the readings.
Let the MQ-2 warm up
A full day on the first use.
Add the relay
With no mains connected yet.
Test with a low-voltage fan
A 12 V fan and battery.
Test with a hair dryer on the sensor
Heat trigger.
Have the mains side wired
By a qualified electrician.
Keep a manual switch
In parallel.
How do you build a kitchen chimney that starts on smoke and heat?
A temperature sensor near the stove and a smoke sensor start an exhaust fan automatically when cooking begins and stop it after the air clears. You need Arduino Nano, MQ-2 gas and smoke sensor module, DS18B20 Temperature Sensor, Resistor 4.7 kΩ, Relay Module 5V and 16x2 LCD with I2C backpack (PCF8574). It takes 7 steps and about 120 minutes.
- Level
- Intermediate
- Time
- About 120 min
- Parts
- 6
Parts list
- Development BoardsBuyArduino Nano × 1
- SensorsBuy
- SensorsBuy
- PassivesBuyResistor 4.7 kΩ × 1
- InterfacesBuyRelay Module 5V × 1
- DisplaysBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| MQ-2 AO | Nano A0 | Smoke and gas level (the heater needs 5 V and warms up) |
| MQ-2 VCC and GND | Nano 5V and GND | Power |
| DS18B20 data | Nano D2, with 4.7 k to 5V | Temperature above the stove |
| DS18B20 VCC and GND | Nano 5V and GND | Power |
| Relay IN | Nano D7 | Fan switch |
| Relay VCC and GND | Nano 5V and GND | Coil power |
| LCD SDA and SCL | Nano A4 and A5 | Shows the reason the fan started |
| Fan | Through the relay contacts, by a qualified electrician | Mains side |
Code
The MQ-2 reacts to smoke and combustible gas with a heated element, so it gives a number that rises with cooking fumes; it has to warm up for a minute at each start and needs a day or two of burn-in when new, and its reading drifts with temperature and humidity. That is why the sketch follows a slow baseline and triggers on a rise above it, not on a fixed number. The temperature sensor sits above the stove, out of the flame and the splash, with its cable kept away from direct heat. The fan starts on heat or smoke and keeps running for five minutes after both clear, and the display shows what started it. Safety: this is a convenience, not a smoke alarm or a gas alarm, and it must never replace a certified smoke alarm or a gas leak detector. The mains side must be wired by a qualified electrician with a proper enclosure and a fuse, and a manual switch should stay in parallel so you can always run the fan by hand. Test everything first with a low-voltage fan from a battery. Arduino IDE, board "Arduino Nano" (try the Old Bootloader option if the upload fails).
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
// Kitchen exhaust fan trigger: starts the fan on heat or a rise in smoke, keeps it on 5 minutes after the air clears.
// Libraries: OneWire, DallasTemperature, LiquidCrystal I2C. Board: Arduino Nano.
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal_I2C.h>
OneWire bus(2);
DallasTemperature temp(&bus);
LiquidCrystal_I2C lcd(0x27, 16, 2); // try 0x3F if the screen stays blank
const uint8_t RELAY = 7, MQ = A0;
const bool RELAY_ON = LOW; // most relay boards switch on with a LOW input
const float HOT_C = 40.0;
const int SMOKE_RISE = 80; // ADC counts above the slow baseline
const unsigned long OFF_DELAY_MS = 5UL * 60UL * 1000UL;
float baseline = 0;
bool fanOn = false;
unsigned long lastBad = 0;
const char* reason = "";
void setup() {
pinMode(RELAY, OUTPUT); digitalWrite(RELAY, !RELAY_ON);
temp.begin();
lcd.init(); lcd.backlight();
lcd.print("MQ-2 warming up");
delay(60000); // a real MQ-2 needs a day or two of burn-in, and a minute at every start
baseline = analogRead(MQ);
lcd.clear();
}
void loop() {
temp.requestTemperatures();
float t = temp.getTempCByIndex(0);
int smoke = analogRead(MQ);
bool hot = t != DEVICE_DISCONNECTED_C && t > HOT_C;
bool smoky = smoke > baseline + SMOKE_RISE;
if (!smoky) baseline += 0.002 * (smoke - baseline); // baseline follows slow drift only when the air is clean
if (hot || smoky) {
lastBad = millis();
reason = hot ? "Heat" : "Smoke";
if (!fanOn) { fanOn = true; digitalWrite(RELAY, RELAY_ON); }
} else if (fanOn && millis() - lastBad > OFF_DELAY_MS) {
fanOn = false; digitalWrite(RELAY, !RELAY_ON); reason = "";
}
lcd.setCursor(0, 0); lcd.print(fanOn ? "Fan ON: " : "Fan off "); lcd.print(reason); lcd.print(" ");
lcd.setCursor(0, 1); lcd.print((int)t); lcd.print("C smoke "); lcd.print(smoke); lcd.print(" ");
delay(1000);
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Cold, clean air | Fan off |
| Warm the DS18B20 above 40 C | Fan on, reason Heat |
| Smoke from a snuffed match | Fan on, reason Smoke |
| Air clear for 5 minutes | Fan off |
If it does not work
Fan starts by itself
Raise SMOKE_RISE or wait for the MQ-2 to settle.
Never starts on smoke
Lower SMOKE_RISE or move the sensor nearer the hob.
Display blank
Try address 0x3F.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the kitchen chimney that starts on smoke and heat?
Arduino Nano, MQ-2 gas and smoke sensor module, DS18B20 Temperature Sensor, Resistor 4.7 kΩ, Relay Module 5V and 16x2 LCD with I2C backpack (PCF8574).
How long does the kitchen chimney that starts on smoke and heat take to build?
About 120 minutes for a intermediate maker, in 7 steps.
How do I know the kitchen chimney that starts on smoke and heat works?
Cold, clean air: Fan off. Warm the DS18B20 above 40 C: Fan on, reason Heat. Smoke from a snuffed match: Fan on, reason Smoke.
Fan starts by itself: what should I check?
Raise SMOKE_RISE or wait for the MQ-2 to settle.
Never starts on smoke: what should I check?
Lower SMOKE_RISE or move the sensor nearer the hob.
Display blank: what should I check?
Try address 0x3F.
