Design and development of an automatic gas poisoning prevention and ventilation system

As both carbon monoxide (CO) and carbon dioxide (CO2) exit during a fire, they are obvious indicators for the need to be alert to the possibility of fire. Another problem concerning poisoning by carbon monoxide (CO) is asphyxiation that occurs in houses during winter. The development of an automatic gas poisoning prevention system in conjunction with a ventilation function using carbon monoxide/carbon dioxide sensors would prove beneficial, necessary. As presented here, this system includes two gas sensors, an alarm, a ventilation device, a motor, and a rain-protection louver. The louver is manipulated by a motor. Two thresholds of gas concentration are preset inside the microcontroller via a PC. The louver is opened by the motor as the first threshold of gas is reached. Additionally, an alarm system is triggered and the ventilation fan starts up if the second threshold of gas concentration is reached. Consequently, image-monitoring via the PC is established using an IPCAM.


Introduction
Fires are disasters that quickly result in tremendous loss of human life. In order to decrease the danger of fire, a prevention system is essential. The first automatic smoke detector based on an ionization current was invented in 1940 [1]. Gupta [2], in 1985, developed an automatic fire detection system. He adopted an automatic fire detection (AFD) system to differentiate the reliability between the presence and absence of fire. He found that not all fires emit smoke. However, combustion gases emitted from fires still existed. Therefore, the combustion gases were regarded as an early warning indicator for fires [3]. The gases closely related to the combustion process include carbon monoxide (CO), carbon dioxide (CO 2 ) and nitrogen oxides (NOx). In 2000, Hagen and Milke [4] indicated that a system of gas sensors was capable of detecting fires faster than a system of two ordinary smoke detectors. Based on an infrared photoacoustic technique, Nebiker and Pleisch [5,6], in 2001 and 2001, detected the gas concentration of carbon dioxide using a detector. As disturbances like steam, fog, dust pollution, and condensed water may cause false alarms [7], the sensor system used to identify an extinguished fire using a video-based system as well as vision observing needed to be immune to ambiguous signals. According to an investigation by Krüll et al. [8] and Tobera et al. [9], because of the high occurrence of hydrogen during an open fire, a H2-Sensor [0-10ppm] was implemented as a fire indicator. The main features of this semiconductor gas sensor (GTE GSME) were observed to have a very fast response time and to be highly sensitive [10]. Derbel [11], in 2004, improved the fire detectors by using gas sensors and neural networks. Cestari et al. [12], in 2005, analyzed 32 fire tests and 11 nuisance tests using the output from ionization, photoelectric and carbon monoxide (CO) detectors, and a thermocouple. Their results revealed that fire sensitivity and nuisance immunity were directly related to three sets of parameters including (a) a increase in temperature rise and production of CO, (b) CO and ionization detection, and (C) a temperature increase and CO and ionization detection.
In order to increase the reliability of aircraft smoke detectors, and to reduce the response time, Chen et al., in 2007, proposed a fire detection system based on the simultaneous measurements of carbon monoxide, carbon dioxide, and smoke [13]. Mulrooney et al. [14], in 2007, developed an optical fiber based system suitable for monitoring the presence of carbon dioxide (greenhouse gas) emitted from the exhaust system of a motor vehicle. Later, they designed a mid-infrared optical fiber sensor used to detect carbon monoxide exhaust emissions [15]. Their analysis revealed that the optical fibre was capable of monitoring the presence of carbon dioxide and carbon monoxide in the exhaust system of gas engines. According to an investigation from Gutmacher et al. [16] in 2012, CO reached the gas sensors over 4 min before any smoke could be detected by the optical smoke detectors. Based on IEEE 802.15.4 and/or Ethernet, Becher et al. [17], in 2010, detected evaporating hazardous material released from moving sources using a gas sensor network which is a gas-sensing platform communicating via a TCP/IP protocol and a wireless sensor network.
As mentioned above, carbon monoxide (CO) and carbon dioxide (CO 2 ) which are closely related to combustion processes are essential indicators in fire prevention and need to be monitored online. Moreover, from the prospective of health, carbon monoxide (CO) has also been recognized as a risk factor for adverse cardiovascular outcomes. Min et al. [18], in 2009, proved that the effect of two specific MetS components (blood glucose and triglycerides) was related to CO exposure. Moreover, because gas (carbon monoxide (CO) and carbon dioxide (CO 2 )) poisoning often occurs in houses in Taiwan during winter, the development of a gas poisoning prevention system is necessary. In order to avoid fires and gas poisonings, an automatic gas poisoning prevention and ventilation system using carbon monoxide/carbon dioxide sensors is proposed. Here, two gas sensors, an alarm, a ventilation device, a motor, and a rain-protection louver are adopted. The louver is opened by the motor when the first threshold of the gas is reached. Moreover, a remotely monitor alarm system is triggered if the second threshold of gas concentration is reached. Simultaneously, forcing ventilation is started.

Automatic gas poisoning prevention and ventilation system
The automatic gas poisoning prevention and ventilation system is depicted in Fig. 1. As indicated in Fig. 1, the hardware of the gas detection and forced ventilation system is composed of two gas sensors (carbon monoxide (CO) and carbon dioxide (CO 2 )), a microcontroller, an alarm, a ventilation device, a motor, and a rain-protection louver. Each part is controlled by a microcontroller -PIC18F4520 shown in Fig. 2. A motor linked to the microcontroller can be rotated clockwise/ counter-clockwise to open/close the louver. Two gas sensors (carbon monoxide (CO) and carbon dioxide (CO 2 ) linked to the microcontroller are adopted to detect the gases' concentration. The concentration values of carbon monoxide (CO) and carbon dioxide (CO 2 ) will be wirelessly sent from the microcontroller to the server PC. The algorithm of gas detection and actuation is illustrated in Fig. 3. As indicated in Fig. 3, the gas ppm is fed back online to the server PC when the server PC sends an inquiry of gas concentrations (carbon monoxide (CO) and carbon dioxide (CO 2 )) to the microcontroller. The louver is opened via the motor when either carbon monoxide's ppm or carbon dioxide's ppm reaches the first warning threshold; if not, the louver is closed and the inquiry of gas concentrations is continued. Thereafter, a second check of the gas concentrations of the second threshold is performed. The on-site alarm is triggered and the ventilation fan is started when one of the gas ppms exceeds the value of the second threshold. Also, an alarm notification at the interface of the server PC is initiated; if not, both the on-site alarm and ventilation fan are turned off. The alarm notification of the server PC vanishes.

Human/machine interface
In order to monitor/control the poisoning environment online, a server PC is wirelessly connected to the microcontroller (single chip) using both an RS-232 and a blue tooth protocol. Two gas sensors used to detect gas concentrations (carbon monoxide (CO) and carbon dioxide (CO 2 )) are connected to the microcontroller. The detected values are fed back to the server PC via the blue tooth and shown on the interface dialogue. The server PC's interface which is programmed by a VB6.0 is depicted in Fig. 4. In addition, in order to visualize the on-site situation, an IPCAM connected to the wireless AP router is also installed on site. The process of setting and running an interface on the server PC is also illustrated in Fig. 5. As indicated in Fig. 5(a), to make the connection between the server PC and the microcontroller, a button that opens the RS232 port is initiated. As illustrated in Fig. 5(b), the thresholds of the CO and CO 2 need to be set in advance before starting the automatic gas detecting/monitoring process. Also, as shown in Fig. 5(c), the automatic function of gas detection and monitoring is initiated by clicking the "start" button. As can be seen in the figure, the alarm's green light which signals a safe condition for the detecting zone is preset. Three kinds of system controlling situations (@1S, @2S, and @3S) are exhibited online. For the @1S status, the louver is closed and both the ventilation fan and the alarm are OFF. This indicates that the environment is safe. Second, for the @2S status, the louver is opened and both the ventilation fan and the alarm are OFF. This indicates that the gas concentration has reached the first threshold (warning) and the natural convection via the louver opening is required. Consequently, the @3S status indicates that the louver is opened and both the ventilation fan and the alarm are ON. This situation appears when the gas concentration reaches the second threshold (danger) and forced convection is initiated using the ventilation fan. The above three conditions (@1S, @2S, and @3S) can also be individually manipulated by clicking the buttons of @1S, @2S, and @3S on the server PC/ client PC interface.    5(c). Initiating the data transmission between the server pc and the microcontroller.

System communication design [19, 20]
For a remote gas monitoring/controlling system, the communication between the server port and the client port is necessary. In this paper, the TCP/IP communication between the server PC and the client PC is adopted using Winsock with the VB program. The corresponding communication diagram interface between the server PC and the client PC is illustrated in Fig. 6. (1) Listening at the server port: The condition "Listen" for the server port (server PC) is performed while the server PC is waiting for the connection from the client port (client PC) at the ready condition of "Listen." In addition, one WINSOCK object in the server port will respond to one client only. One WINSOCK is responsible for the "Listen" function when the "Local Port" is preset as the port of "Listen." (2) Connection at the client port (client PC): A connection request is sent via the WINSOCK object. The WINSOCK will assign a "Port Number" (at "Listen" condition) for the server port (server PC) at the WINSOCK 's "Remote Port." (3) Reception at the server port (server PC): The server port (server PC) receives a ConnectionRequest command from the client port (client PC) when the client port submits a request of "Connect." The client port's connection request will be accepted by the server port by using the "Accept" via a new WINSOCK. (4) Sending data from the client port (client PC): The data sent from the client port to the server port will be initiated using the "SendData" command when the internet connection between the server port and the client port is ready. (5) Receiving data at the server port (server PC): DataArrival from the client port (client PC) will be received on the server port when the client port delivers data to the server port. The server port can read the data from the client port by using "GetData." (6) Receiving data at the client port (client PC): The client port will acknowledge DataArrival when the server port submits data to the client port. The client port will then receive the data via "GetData." (7) Close: The connection will be ended by clicking "Close" when the communication work is completed.

Results and discussions
The automatic gas poisoning prevention and ventilation system using carbon monoxide/carbon dioxide sensors has been introduced. The gas concentration can be automatically detected via server PC/client PC control ports. Two thresholds (1st threshold in the warning situation and the 2nd threshold in the danger situation) are specified before automatic gas detection and ventilation controlling is initiated. Immediate gas concentrations are detected and shown on the interface of the server PC and the client PC. A demonstration of the automatic gas poisoning prevention and ventilation system is depicted in Fig. 7(a)-(n). As indicated in Fig. 7(a), the CO and CO 2 are generated in the kitchen. In Fig. 7(b), the gas concentration increases gradually. As shown in Fig. 7(c), the gas concentration reaches the first threshold (warning level). As illustrated in Fig. 7(d), a command from the server PC/client PC is sent to the microcontroller to actuate the motor to open the louver. As can be seen in Fig. 7(e), gas is diluted by natural convection via the louver opening. However, as shown in Fig. 7 (f), because the increase in gas is larger than gas dilution rate, the gases accumulate. As indicated in Fig. 7(g), the gas concentrations reach the second threshold (danger status). The on-site alarm is then triggered. Concurrently, the alarm flashing red is reflected onto the interfaces of the server PC and the client PC. Subsequently, as illustrated in Fig. 7(h), the forced ventilation is started. The gas concentration shown in Fig. 7(i) decreases when the forced convection is ongoing. As indicated in Figs. 7(j)-(l), the alarm is terminated and the ventilation fan turned off when the gas concentration dilutes to the 1st threshold. The warning signal on the interface turns from red to green. Furthermore, the gas concentration continues to dilute to a level below the 1st threshold. Therefore, the louver is closed. The prototype automatic gas poisoning prevention and ventilation system has been introduced and shown in Fig. 8.   Fig. 7(a). Gas generated.         Fig. 7(n). Louver is closed. Fig. 7. Process of automatic remote gas detection/forced ventilation/monitoring system.

Conclusions
It has been shown that a wireless automatic gas poisoning prevention and ventilation system can be remotely monitored and manipulated during a gas detecting process. Using the RS-232 communication standard and blue tooth protocol, the server PC is wirelessly connected to the microcontroller (single chip). The microcontroller connects to two gas sensors, an alarm device, a motor (used to open/close the louver), and a ventilation fan. To remotely implement the gas poisoning prevention and ventilation system, human/machine interfaces in both the server PC port and the client PC port programmed by VB6.0 has been established. Three system operating modes (@1S: louver CLOSE and ventilation fan OFF and alarm OFF; @2S: louver OPEN and ventilation fan OFF and alarm OFF; @3S: louver OPEN and ventilation fan ON and site alarm ON and interface alarm ON) are designed into the interface. Current gas concentrations can be automatically monitored and controlled online by clicking "start" on the interface. Two thresholds of gas concentrations marked in both the warning level and danger level need to be specified before the system is initiated. In order to remotely monitor the on-site situation, a wireless USB AP router wirelessly connected to the IPCAM is adopted. The image can be sent back to the server PC via the Wi-Fi protocol.
Consequently, a prototype of the automatic gas poisoning prevention and ventilation system has been demonstrated.