Arduino UNO-Based Gas and Flame Detection System with LCD Display and Piezo Alarm
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves an Arduino UNO microcontroller interfacing with various sensors and output devices. The components include an MQ-2 gas sensor, a KY-026 flame sensor, a 16x2 I2C LCD display, and a piezo speaker. The circuit is powered by a 9V battery. The Arduino UNO reads data from the sensors and displays information on the LCD while also controlling the piezo speaker based on sensor inputs.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
MQ-2
- Description: A gas sensor that detects LPG, i-butane, propane, methane, alcohol, hydrogen, and smoke.
- Pins: GND, VCC, ANALOG, Digital
16x2 I2C LCD
- Description: A 16x2 character LCD display with I2C interface.
- Pins: GND, VCC, SDA, SCL
Piezo Speaker
- Description: A piezoelectric speaker used to produce sound.
- Pins: pin1, pin2
KY-026 Flame Sensor
- Description: A flame sensor module that detects fire or flame.
- Pins: AO, GND, VCC, DO
9V Battery
- Description: A 9V battery used to power the circuit.
- Pins: -, +
Wiring Details
Arduino UNO
- GND: Connected to GND of 16x2 I2C LCD, KY-026 Flame Sensor, Piezo Speaker (pin1), and MQ-2.
- 5V: Connected to VCC of 16x2 I2C LCD, KY-026 Flame Sensor, and MQ-2.
- Vin: Connected to + of 9V Battery.
- A0: Connected to ANALOG of MQ-2.
- A4: Connected to SDA of 16x2 I2C LCD.
- A5: Connected to SCL of 16x2 I2C LCD.
- D9: Connected to pin2 of Piezo Speaker.
- D8: Connected to DO of KY-026 Flame Sensor.
MQ-2
- GND: Connected to GND of Arduino UNO.
- VCC: Connected to 5V of Arduino UNO.
- ANALOG: Connected to A0 of Arduino UNO.
16x2 I2C LCD
- GND: Connected to GND of Arduino UNO.
- VCC: Connected to 5V of Arduino UNO.
- SDA: Connected to A4 of Arduino UNO.
- SCL: Connected to A5 of Arduino UNO.
Piezo Speaker
- pin1: Connected to GND of Arduino UNO.
- pin2: Connected to D9 of Arduino UNO.
KY-026 Flame Sensor
- GND: Connected to GND of Arduino UNO.
- VCC: Connected to 5V of Arduino UNO.
- DO: Connected to D8 of Arduino UNO.
9V Battery
- -: Connected to GND of Arduino UNO.
- +: Connected to Vin of Arduino UNO.
Code Documentation
Arduino UNO Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code is a basic template for the Arduino UNO. The setup() function is where you initialize your components and settings, and the loop() function is where the main logic of your program runs continuously.
Additional Documentation
This section is reserved for any additional documentation or notes related to the code or circuit.