এলপিজি লিক অটো-কাটঅফ — গ্যাস ধরলেই ভালভ বন্ধLPG Leak Auto-Cutoff
MQ-2 নাকের আগেই গ্যাস ধরে ফেলে। মাপ পার হলেই রিলে নেমে সলিনয়েড ভালভ বন্ধ হয়ে যায়, আর গ্যাস সরলেও বন্ধই থাকে — লিক থাকতে থাকতে কেউ লাইন খোলার সাহস করে না।
The MQ-2 smells gas long before your nose does. At the limit the relay drops, the solenoid valve slams shut and it STAYS shut even if the gas drifts away — nobody reopens a line while a leak is live.
সার্কিট ডায়াগ্রাম · Circuit diagram
যা যা লাগবে · Parts you need
- 1 × Arduino Uno R3 Arduino Uno
- 1 × Gas & smoke sensor (MQ-2) গ্যাস ও ধোঁয়া সেন্সর (MQ-2)
- 1 × Relay module (5V, 1 channel) রিলে মডিউল (5V, ১ চ্যানেল)
- 1 × Solenoid door lock (12 V) সোলেনয়েড দরজার লক (12 V)
- 1 × Buzzer (5 V) Buzzer (বাঁশি, 5 V)
- 1 × Resistor 330Ω Resistor
- 1 × LED (red) LED বাতি
- 14 × Jumper wires জাম্পার তার
তার লাগানো · Wiring
| Gas & smoke sensor (MQ-2) VCC | → | Arduino Uno R3 5V |
| Gas & smoke sensor (MQ-2) GND | → | Arduino Uno R3 GND |
| Gas & smoke sensor (MQ-2) AO | → | Arduino Uno R3 A0 |
| Relay module (5V, 1 channel) VCC | → | Arduino Uno R3 5V |
| Relay module (5V, 1 channel) GND | → | Arduino Uno R3 GND |
| Relay module (5V, 1 channel) IN | → | Arduino Uno R3 D7 |
| Relay module (5V, 1 channel) COM | → | Arduino Uno R3 5V |
| Relay module (5V, 1 channel) NO | → | Solenoid door lock (12 V) + |
| Solenoid door lock (12 V) - | → | Arduino Uno R3 GND.3 |
| Buzzer (5 V) + | → | Arduino Uno R3 D8 |
| Buzzer (5 V) - | → | Arduino Uno R3 GND.3 |
| Arduino Uno R3 D13 | → | Resistor a |
| Resistor b | → | LED A |
| LED K | → | Arduino Uno R3 GND.3 |
Code (Arduino C++)
// LPG pipeline auto-cutoff: the MQ-2 smells gas long before your nose does.
// While the air is clean the solenoid valve stays energised (open) and the
// kitchen cooks. The moment gas passes the limit the relay drops, the valve
// slams shut, the red lamp and buzzer take over — and it stays shut even if
// the gas drifts away, until the power cycle resets it. That latch is the
// whole point: nobody reopens a gas line while the leak is still live.
void setup() {
Serial.begin(9600);
pinMode(7, OUTPUT); pinMode(8, OUTPUT); pinMode(13, OUTPUT);
}
void loop() {
int raw = analogRead(A0);
static bool leak = false;
if (raw > 300) leak = true;
bool safe = !leak;
digitalWrite(7, safe ? HIGH : LOW); // relay holds the valve open
digitalWrite(8, leak ? HIGH : LOW);
digitalWrite(13, leak ? HIGH : LOW);
Serial.print("Gas: "); Serial.print(raw);
Serial.print(" | Valve: "); Serial.println(leak ? "CLOSED (leak)" : "open");
delay(300);
}
আরো project · More projects
- অটোমেটিক পেট ফিডার — এক চাপে এক পোরশনAutomatic pet feeder (one button, one portion)
- সিও ভেন্টিলেটর — MQ-7 সেন্সরে এক্সহস্ট ফ্যান ঘোরেCO ventilator (MQ-7 spins the exhaust fan)
- বৃষ্টি সেন্সর অরশদ — দোকান ভিজে যাওয়ার আগেই নিজে বন্ধ হয়Rain-sensing awning (closes itself before the shop soaks)
- এসএসআর হিটার কন্ট্রোল — রিলের ক্লিক ক্লিক শব্দ নেইSSR burst-fire heater control (silent, no relay clicks)