Circuit Diagram





First of all, connect the ESP8266 module with the Arduino. To connect the ESP8266 properly with the Arduino, we used an ESP-01 adapter module which will make the connection very easy. This adapter module has a built-in 5V to the 3.3V regulator, which means that you will not have to use any resistors

Connect the ESP-01 adapter's VCC pin to the 5V pin on the Arduino and the ESP-01 adapter's GND to GND on the Arduino. Next, connect the TX pin from the adapter to the pin 2 on the Arduino and the RX pin from the adapter to the pin 3 on the Arduino.

Then, Connect the MQ-2 gas sensor with the Arduino. Connect the VCC and the GND on the gas sensor to the 5V and GND pins on the Arduino. Then connect the A0 pin on the MQ-2 gas sensor to the A0 on the Arduino.

After that, connect the Buzzer and the LEDs to the Arduino. Connect the positive on the buzzer with pin 10 on the Arduino and the negative on the buzzer with GND on the Arduino. Then connect the negative side of the LEDs to the GND through the 220-ohm resistor and the positive side to pins 8 and 9 on the Arduino.