# Application of Internet of Things in a Kitchen Fire Prevention System
## 3 Research Design
### The Smart Alarm and Control Mechanism  
In a smart building, various sensors are used to obtain environmental values at home, on the basis of which relevant control mechanisms are activated through the control board and software to issue notifications or switch on appliances to change the environment according to detected physical indicators, thereby constructing a safe and comfortable home environment. The devices used in this study to control the environment and issue warnings are as follows:  
(1) Relay (Figure 7) [73] is an electronic control device that has a control system (also known as an input circuit) and a controlled system (also known as an output circuit). It is typically used in automatic control circuits. It is an \"automatic switch\" that uses a small current to control a large current. Therefore, it plays the role of automatic adjustment, safety protection, conversion circuit, etc., in the circuit.  
Figure 5: MQ-4 natural gas methane sensor.  
Figure 6: The Internet Protocol (IP) camera used in this study.  
(2) Display  
This study used a 1602/16x2 monochrome character liquid-crystal display (LCD) module (Figure 8) to display the gas concentration, temperature, and flame intensity [74].  
(3) Sound and light alarm  
If the sensor detects flames, high temperatures, or gas, then the sound and light alarm (Figure 9) produces an alarm sound and flashes to notify residents to adopt appropriate response measures.  
(4) Gas shutoff device  
When the sensor detects flames, high temperature, or gas, the fire prevention system immediately activates the gas shutoff device (Figure 10). The valve is turned 90 degrees clockwise to turn off the gas supply, thereby ensuring the residents' safety [75].  
Figure 8: Liquid–crystal display (LCD) module.  
Figure 7: Relay.  
Figure 9: Sound and light alarm.  
(5)  
If This Then That (IFTTT) [76] is an automation tool that integrates many common web services. Users can create a conditional statement specifying that when a condition in Channel A is satisfied, it will trigger an action in Channel B; the entire process is a recipe. Currently, IFTTT is a free web service, but users must register an account with their e-mail address.  
(6)  
Line reporting system  
Line [77] has been a popular mobile app in recent years because of its combination of communication and online services and the convenience of group chats in addition to individual chats. It not only can be installed on smartphones (e.g., iPhone, Android phones, Windows phones, Black Berry, and Nokia Asha) but can also be used on personal computers. Line facilitates the transmission of text, pictures, and videos and topic discussions in groups, serving as an extensively used tool for social networking, communication, and management. In this study, the IFTTT platform was used to obtain the data detected by various sensors in the smart building. The data were then sent to relevant Line users or groups in a timely manner (Figure 11).  
(7)  
Door lock  
When the sensor detects flames, high temperatures, or gas, the system automatically unlocks the main entrance door (Figure 12) to enable community management team and emergency personnel to enter the house to extinguish the fire.  
The brand, name, model, function quantity and price of hardware used in this study are listed on Table 2. The total cost of the materials used on this study is US$188.6.  
Figure 11: Notification messages on Line.  
Figure 10: Gas shutoff device.  
This study employed Webduino to develop remote control software. The software was connected with the IP camera through Wi-Fi to enable users to monitor the gas stove. The users can remotely control the gas shutoff device by simply clicking on a button to turn off the gas supply.