Arduino Project
Arduino Gas Leak Detector with MQ-2 Sensor V3
Course Introduction
This Arduino project uses an MQ-2 gas sensor, Traffic Light LED Module, and a buzzer to detect gas concentration in real time.
Note
If this is your first time working with an Arduino project, we recommend downloading and reviewing the basic materials first.
1.1 Install Arduino IDE(Important)
1.2 Introduction of Arduino IDE
Wiring

Common Connections:
MQ-2 Gas Sensor Module
A0: Connect to A0 on the Arduino.
GND: Connect to breadboard’s negative power bus.
VCC: Connect to breadboard’s red power bus.
Buzzer Modudle
I/O: Connect to 2 on the Arduino.
GND: Connect to breadboard’s negative power bus.
VCC: Connect to breadboard’s red power bus.
Traffic light LED
R: Connect to 3 on the Arduino.
Y: Connect to 4 on the Arduino.
G: Connect to 5 on the Arduino.
GND: Connect to breadboard’s negative power bus.
Writing the Code
Note
You can copy this code into Arduino IDE.
Don’t forget to select the board(Arduino UNO R4 Minima) and the correct port before clicking the Upload button.
