The above wiring diagram shows an IoT-based gas leakage detection system. This shows how electronics parts work together to build a gas monitoring system that is both safe and smart to use. The main component is NodeMCU controller.The MQ-4 sensor works to check the level of LPG gas.When any value changes it generates a signal by which it passes the message to the controller device. The controller activates an alarm system whenever gas levels cross the safety threshold, alerting occupants of gas leakage. By following the wiring you will understand the passage of data from the sensor to the controller. The whole system is connected with different devices via wireless connection . For the safety, the solenoid valve is installed and connected, which simply cuts the supply of gas when any leakage detect.