Arduino Gas Detecting Alarm System

by 909804 in Circuits > Arduino

8790 Views, 6 Favorites, 0 Comments

Arduino Gas Detecting Alarm System

image.png

Hello, everyone! Right now, I'll be explaining how to build an Arduino gas detecting alarm system in tinkercad. This circuit uses the gas sensor to detect if there is fire, smoke, or gas leakage nearby. Using the LCD and the alarm, this circuit also can display its “Gas Leakage Alert” message, while alerting people nearby.

Supplies

  • 1 Arduino uno
  • 1 MQ2 gas sensor
  • 4 1k ohms resistors
  • 1 4.7k ohms resistor
  • 1 Piezo buzzer
  • 2 different color LEDs(I'll be using the red and green LEDs in this case)
  • 1 LCD(16x2)
  • 1 breadboard
  • Many wires of different colors

About Project and Schematic Drawing

20200618_170604.jpg

We have used a gas sensor module to detect gases. If a gas leakage occurs, the sensor gives a HIGH pulse and when the Arduino gets a HIGH pulse from the sensor, it sends a signal to the LCD and the piezo buzzer. Then the LCD would show the “Evacuate" message and activates the piezo buzzer which beeps again and again until the gas detector doesn't sense the gas in the environment. Else, the gas sensor gives LOW pulse to the Arduino, then LCD would then show the “All Clear” message.

Gather All the Supplies

image (1).png

Setup(Part 1)

image (2).png

Steps

  1. Connect Arduino 5V to positive power rail
  2. Connect Arduino GND to negative power rail
  3. Connect Arduino A0 to gas sensor B1
  4. Connect gas sensor A1, H2, A2 to positive power rail
  5. Connect gas sensor H2 to ground
  6. Connect gas sensor B2 to 4.7k ohms resistor, then to ground
  7. Connect piezo positive terminal to Arduino pin 4
  8. Connect piezo negative terminal to 1k ohms resistor, then to ground
  9. Connect the cathodes of the two LEDs to 1k ohms resistor, then to ground
  10. Connect the anode of the red LED to Arduino pin 2
  11. Connect the anode of the green LED to Arduino pin 3

Setup(Part 2)

image.png
  1. Connect LCD ground, contrast, and LED cathode to ground
  2. Connect LCD anode to 1k ohms resistor, then to the positive power rail
  3. Connect LCD power to the positive power rail
  4. Connect LCD register select to Arduino pin 5
  5. Connect LCD read/write to ground
  6. Connect LCD enable to Arduino pin 6
  7. Connect LCD terminal 4,5,6,7 to Arduino pin 8,9,10,11

Code

image (3).png

Here is the Arduino Code for Gas Detecting Alarm System.

https://gist.github.com/AZ979/8e344619862e4a76c3c2...

Run the Simulation

image (4).png

When you run the simulation, the LCD should be able to display both safe and evaluate messages, while the piezo buzzer should be able to beep if the gas sensor detect any gas leaks. If anything works just like you thought, then congratulation to you for making it to the end.