Detects harmful gas or spoiled-food odour in your fridge and alerts your phone.
Built and tested by Drisya K S · Industrial Robotics Institute

A gas detector for refrigerators. An MQ2/MQ135 sensor monitors the air in or around the fridge; when gas levels exceed a safe limit (from a refrigerant leak or spoiled food), the ESP8266 sounds a buzzer, lights an LED and sends an alert and the live gas value to the Blynk app.
| Component | Qty |
|---|---|
| ESP8266 NodeMCU | 1 |
| Gas Sensor (MQ2 / MQ135) | 1 |
| Buzzer | 1 |
| LED (optional) | 1 |
| Resistor 220Ω | 1 |
| Jumper Wires / Breadboard | As needed |
| Power Supply | 1 |
| From | Connect to |
|---|---|
| Gas sensor VCC | 5V (VIN) |
| Gas sensor GND | GND |
| Gas sensor AO | A0 |
| Buzzer + | D5 |
| Buzzer − | GND |
| LED + (via 220Ω) | D6 |
| LED − | GND |
Complete, tested Arduino C++ code for this project. Copy it into Arduino IDE and upload it to the ESP8266 NodeMCU.
#define BLYNK_TEMPLATE_ID "YourTemplateID"
#define BLYNK_TEMPLATE_NAME "Gas Detector"
#define BLYNK_AUTH_TOKEN "YourAuthToken"
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char ssid[] = "YourWiFiName";
char pass[] = "YourWiFiPassword";
int gasSensor = A0;
int buzzer = D5;
int led = D6;
void setup() {
Serial.begin(9600);
pinMode(buzzer, OUTPUT);
pinMode(led, OUTPUT);
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
}
void loop() {
int gasValue = analogRead(gasSensor);
if (gasValue > 400) {
digitalWrite(buzzer, HIGH);
digitalWrite(led, HIGH);
Blynk.virtualWrite(V1, "Gas Leakage Detected!");
} else {
digitalWrite(buzzer, LOW);
digitalWrite(led, LOW);
Blynk.virtualWrite(V1, "Safe");
}
Blynk.virtualWrite(V2, gasValue);
Blynk.run();
delay(1000); // avoid flooding the Blynk server
}A gas detector for refrigerators. An MQ2/MQ135 sensor monitors the air in or around the fridge; when gas levels exceed a safe limit (from a refrigerant leak or spoiled food), the ESP8266 sounds a buzzer, lights an LED and sends an alert and the live gas value to the Blynk app.
You need: ESP8266 NodeMCU (1), Gas Sensor (MQ2 / MQ135) (1), Buzzer (1), LED (optional) (1), Resistor 220Ω (1), Jumper Wires / Breadboard, Power Supply (1). Software: Arduino IDE, Blynk IoT app.
Yes. It is rated beginner and takes about 1–2 hours to build, using the ESP8266 NodeMCU. The guide on this page explains every connection and step.
The complete, tested Arduino C++ code is free on this page. Copy it into Arduino IDE and upload it to the board.
Yes. IRI sells a kit with the parts for this project (PRJ-136). Message IRI on WhatsApp at +91 86060 82634 for the kit price and delivery details.