Normally exhaust fans installed in kitchens, including restaurant kitchens, keep running continuously—whether smoke is present or not. Here is how you can build a small electronic device that switches on the exhaust fan automatically only when there is smoke in the air. It switches the exhaust fan off when the smoke has been removed.
Circuit and working
Circuit diagram of the auto exhaust fan switch is shown in Fig. 1. It has 5V voltage regulator 7805 (IC1), AVR microcontroller ATtiny85A (IC2), gas sensor MQ2 (SEN1), common-cathode bi-colour LED (BICO1), 5V single changeover relay (RL1), NPN transistor BC547 (T1), and a few other components.
Fig. 1: Circuit diagram
The ATtiny85A turns the exhaust fan connected through the relay on or off based on extent of smoke in the air. The resistance offered by MQ2 sensor changes with smoke concentration near the sensor and thus changes voltage at analogue input pin 3 (PB4) of IC1. Potentiometer VR1 is used to adjust the sensitivity of the sensor during calibration.
When the circuit is powered on, bi-colour LED BICO1 blinks in red colour for 20 seconds, indicating that the circuit is in the necessary pre-heat stage (see Fig. 1). After that the microcontroller continuously checks whether voltage at analogue input (pin 3) is above the threshold value set using potentiometer VR1 during calibration. When the sensor detects sufficient smoke, its digital pin 5 (PB0) goes ‘high’ and energises the relay to turn on the exhaust fan connected at CON2. The bi-colour LED BICO1 glows continuously in red colour to indicate that smoke is present.
When the concentration of smoke near the sensor goes below the preset level, digital pin PB0 goes ‘low’ after one minute. The exhaust fan keeps running during this one minute to ensure smoke in the entire kitchen has been removed. During this one-minute period, BICO1 blinks in orange colour to indicate that the exhaust fan is now running to remove the smoke that may be present elsewhere in the kitchen. After this period, the digital pin goes low and de-energises the relay, which switches the exhaust fan off. Bi-colour LED BICO1 now emits green colour to indicate that no smoke is present in the air.
Pushbutton switch S1 can be used to reset the microcontroller. Capacitor C4 is used to debounce switch S1 and it helps in power-on resetting along with resistor R1.
The source code ExhaustFanSwitch.ino is written in Arduino programming language using Arduino IDE. By default, Arduino IDE does not support ATtiny85, so ATtiny board needs to be added to Arduino IDE. To add ATtiny support to Arduino IDE, open FilePreferences and in the additional boards manager URLs, add the link.
After that, open Tools->Board->Board Manager. Scroll down the list and look for ‘attiny by Davis A. Mellis.’ Click on that and install it. After installing it, the ATtiny will be listed in the Board menu. Select ATtiny25/45/85 under Tools->Board, then select ATtiny85 under Tools->Processor option, and then select 8 MHz (internal) under ToolsClock option.
Now, to turn the Arduino Uno into an ISP programmer, open Arduino IDE (make sure you have selected the Arduino/Genuino Uno as your board) and open the Arduino ISP example sketch. Upload the sketch to your Ardunio Uno. Your Arduino Uno is now an ISP programmer.
By default, ATtiny85 runs at 1MHz. To make it run at 8MHz, select ToolsBurn Bootloader. Ensure the Arduino Uno board is programmed as ISP and is connected to ATtiny85 through ISP pins. Now, upload the source code ExhaustFanSwitch.ino into ATTiny85A using the Arduino board that has been programmed as ISP.
Construction and testing
An actual-size PCB layout for the auto exhaust fan switch is shown in Fig. 2 and its component layout in Fig. 3. Assemble the circuit on PCB, enclose it in a suitable plastic box, and place it near the smoky area.
Fig. 2: PCB layout
Fig. 3: Component layout of the PCB
Download PCB and Component Layout PDFs: click here
Make a suitable hole in the enclosure for the sensor to detect the smoke. Power the circuit using a 12V adaptor that has output current of at least 500mA. Switch S1 should be accessible to reset the circuit, whenever required.
Please note the following:
Gas sensors require preheat time of about 20 seconds. So, IC1 is programmed in such a way that after the circuit is powered on, there will be a 20-second preheat time.
Additionally, a temperature sensor can be used in this circuit to switch on the exhaust fan automatically.
ATtiny25 or ATtiny45 microcontroller can be used in place of IC1.
The MQ2 sensor alone has been used in this circuit. If required, MQ2 sensor module (Fig.
Fig. 4: MQ2 sensor module (optional)
4) can be used in this circuit. Connect the digital output of the module to pin 3 of IC1 and ignore resistor R5 and potentiometer VR1.
Download Source Code
A. Samiuddhin, a circuit designer, is B.Tech in electrical and electronics engineering. His interests include LED lighting, power electronics, microcontrollers, and Arduino programming.