Toxic and Non-Toxic Gas Detection System for Septic Tank

In septic tanks, various types of toxic and non-toxic gases are found such as Carbon-di-Oxide (CO2), Carbonmono-Oxide (CO), Hydrogen Sulfide (H2S), Methane (CH4), and so on. In this paper, a toxic gas detection system for a septic tank has been presented, where MQ-135, MQ-136, MQ-4, and MQ-7 sensors are employed for combined detection of CO2, H2S, CH4, and CO gases respectively. With the change of concentration of gases, the sensor resistance changes and accordingly an analog voltage is produced across the sensor. The analog voltages from the sensors are fed to a microcontroller, which reads the values and converts the values into gas concentration in PPM (parts per million). The PPM values for all four gases are displayed on an LCD, where two levels are assigned as “Safe” and “Danger” based on the concentration of each gas. “Safe” status means the concentration of gas is not harmful and “Danger” status means the concentration of gas is harmful. A buzzer will give an alarm when the gas concentration status becomes “Danger”. Furthermore, a Bluetooth device is interfaced with the microcontroller for transferring the gas concentration data to a smartphone. For the Smartphone, application software has been developed to monitor the concentration of each toxic gas. The prototype system has been developed and tested which gives satisfactory results. It is supposed to be a helpful and cost-effective system for cleaners working in septic tanks.


INTRODUCTION:
A septic tank is an underground chamber made of concrete, fiberglass or plastic (Septic tank, 2020) which is a submerged sedimentation tank utilized for the fundamental treatment of homegrown wastewater streams with the cycle of natural decay and drainage shown in Fig 1 (Water Disposal Hub, 2016). It is worked with on site wastewater treatment elements, for example, biofilters or oxygen-consuming frameworks including misleadingly constrained air circulation (Sep-tic tank, 2020; Zhang et al., 2011). Generally, the septic tank is responsible to hold the wastewater sufficiently long to permit solids to settle down to the base shaping exude, while the oil and oil buoy to the top as a layer ( Sometimes septic tank can be blocked with slop and scum which can stop functioning be-cause of breakage and prominent to a costly systemic collapse. So, the tank should be cleaned, checked, and pumped regularly (How to clean a Septic Tank, 2021). But a few sorts of gases such as methane, hydrogen sulfide, carbon monoxide, and carbon dioxide, etc. are available in the septic tank which can be destructive to people especially cleaners, and can bring about an explosion. Even they can cause organ harm, lung damage, adverse symptoms, or even death (Healthline, 2019;Safeopedia, 2018). The primary sign of sewage gases in a zone could be observed with the smell of spoiled eggs (Safeopedia, 2018). The indications also include loss of smell, mouth, throat, and lung bothering, eye disturbance and pink eye, seizures, extreme lethargies, sometimes death (Healthline, 2019). A septic tank gas exposure occurred in India where three of four workers passed on and the fourth one felt unconscious and hospitalized (DH news, 2020). Considering all these, gas detection for the septic tank is needed. The detecting technique can be different such as chemical-based detection systems, microcontroller-based detection systems. The microcontroller-based detection technique is more suitable than the chemical-based detection system because of its versatility, availability of sensors, and wireless facilities to display the results. Various types of microcontroller-based gas detectors are available but maximum of those are designed for specific few gases such as LP gas leakage detection system (Fraiwan et  Few numbers of papers were reported on gas detection systems for the septic tank. These systems are highly expensive and are designed for a specific number of gases. Considering the presence of various harmful gases and the inadequacy of a versatile, easy-to-use, and viable detecting system, we understand the needs of a system that can effectively identify gases available in the septic tank. In this paper, a microcontroller-based electronic system is designed to sense and process the data to identify the presence and display the concentration of these gases produced in a septic tank. To show the outputs of the system on the smartphone which is interfaced with a microcontroller through Bluetooth (BT) module, application software has been developed.

Hardware development of the system
A schematic diagram of the gas detection system is shown in Fig 2.   Fig 2: Block diagram of gas detection system for septic tank.
The system consists of three parts: i) input unit, ii) microcontroller unit, and iii) output unit. The input unit consists of four sensors (MQ-136, MQ-135, MQ-4, and MQ-7) which are used for data collection. Various types of toxic and non-toxic gaseous elements are present in septic tanks. The concentration level of these gases can be determined with the electronic-nose sensors which are called MQ sensors (metal oxide semiconductor sensors). The resistivity of the sensors changes with the concentration levels of gases. Higher the concentration means lower the resistivity of the sensors and the output signal is equivalent to PPM values of gas concentration.
All the components are interfaced with a microcontroller to execute the system. ATmega328p is used as a microcontroller that is interfaced with input and output units. It receives data from the input unit and processes these data and transmits them to the output unit for showing results to end-users. To collect data input unit will be inserted into the septic tank with a long stick and gases will be sensed with sensors. The microcontroller will process the sensed data and will give different results and statuses of gases to the output unit considering the threshold value used in the code. Based on the concentration of gases of the septic tank, this device shows the two statuses named "Danger" and "Safe" with the concentration esteems. A septic tank will be considered as "Safe" if there are negligible levels of gases present, otherwise, the tank will be considered as "Danger". An LCD, a piezo buzzer, a Bluetooth module, and a Smartphone with android application software are used as an output unit to show the result.
Using the Bluetooth module, the microcontrollerbased system is interfaced with an app titled "Gas detection" to show the result in a smartphone. The results will be transmitted inside short-range (Approximately 10 -100 m) with the Bluetooth module HC-06. Any smartphone with android OS inside that range where the Bluetooth app was installed can get the results and statuses. To get the data, the application software and Bluetooth signal must be kept on. A piezo buzzer is also used to give alarm when the gas level is at a harmful level.
For the assessment of the gas detection system, a prototype of a complete hardware system shown in Fig 3 consisting of a microcontroller unit, sensor unit, a display unit (LCD and mobile device with Bluetooth module), and a piezo buzzer has been developed and tested in the laboratory. 2. Software development of the system: MIT app inventor version2 is used to develop the android application software which is a cloud-based integrated development environment (IDE) (Wolber et al., 2011). Block programming language is used in this deve-lopment field. This drag-and-drop feature can be used for designing user interface by visual programming and for particular user interface web-based graphical user interface (GUI) builder can be used. The Designer, the Blocks Editor, and Android Emulator are three key units of the App Inventor programming environment (Walter et al., 2015). To develop the android application software, the following components are used from the palette.
i. User interface palette: Four Labels (Label1-Label4) and one List Picker (ListPicker1) are chosen as visible components. These will be used to give demonstrating guidelines, to pick and tap as a button, for showing the results, etc. Two of these labels are used to give some instructions on how to use the device properly for determining gases in the septic tank. Label1 is used to give an app screen name termed as "Gas Detection System". Label2 is used to give instructions on where to press to get available Bluetooth clients to connect the needed one. At first, it is set as "Press here to connect". ListPicker1 as a button with a Bluetooth logo is used to connect with Bluetooth clients. Label4 (termed as "Reading") is used to receive and show the results and status of gases in the septic tank. ii. Connectivity palette: Bluetooth Client and Clock are non-visible components. For the app, these are key components. Bluetooth Client is needed to interface the software with the Bluetooth module when the Bluetooth signal is kept on. The Clock is needed to control the time for receiving one data after another.
After designing the user interface, the flow chart of the program is developed to write the code for developing the app. The flow chart of the program is shown in Fig  4. At first, Label4 and ListPicker1 are set as an empty list and as a Bluetooth logo respectively. After picking ListPicker1, various Bluetooth addresses and their names will be shown on the app screen. If the Bluetooth address is selected and connected with the system, the app shows the content "Connected" in green color; otherwise, it shows the text "Not Connected" in red color.
A global variable is declared as "global Value" and set equivalent to received data. "Global Value" will be separated at every comma (",") of received data. These values will be shown successively in Label4. With the clock, after showing the results, the "global Value" will be cleared and prepared to receive the new data. Press the back button to close the app at any time. The several segments of the program are described below:

Part 2:
This block is written for utilizing the connection statuses of the software with the gas detection system. After picking the ListPicker1, the program calls BluetoothClient1 to establish a connection with the gas detection system. If the connection of the system is established, then the Label2 text will change to "Connected" in green color. Otherwise, the Label2 text will change to "Not Connected" in red color. This process is illustrated in  Value. The second part is to call the BluetoothClient1 to receive available data and to split the results with the sign (","). Clock1 is used to set time intervals to receive data one after another. The developed prototype system is tested in the laboratory and gives satisfactory results as shown in Fig 9. The sensors sense the different gases and are interfaced to the microcontroller, which processes the values and sends them to the output unit. Status is set according to different levels of gases. According to WHO (World Health Organization) report, carbon monoxide can be dangerous above 100 ppm (Carbon Monoxide Levels Chart, 2020). According to Occupational Safety and Health Administration, hydrogen sulfide and carbon dioxide can be dangerous above 50 ppm (Safety and Health Topics on Hydrogen Sulfide, 2021) and 500 ppm, respectively (Carbon Dioxide in Workplace Atmospheres 2021). The National Institute for Occupational Safety and Health Administration recommends a maximum of 1000 ppm methane during 8 hours working period (Hazardous Gases: Methane, 2021). Depending on that recommended values, the threshold values for each gas were set in the code to classified gases into "Safe" and "Danger" levels.  However, the developed prototype system has some limitations. Further enhancements to our system can be included to achieve greater efficiency and effectiveness and to make it more portable. For commercial use, it can be performed to additional improvements both in hardware and software. For hardware improvement, greater portability can be achieved by minimizing the external appearance of the device. Here, the connection of all the equipments has been given on the breadboard which can be turned into a user-friendly and more portable with PCB (Printed Circuit Board). The app that is being used to show the result also needs to be made user-friendly and made available in the app store. The feature can be added in app to store all data in the cloud so that anyone can observe previous values also through online. The whole system needs to be made more cost-effective. So, our next focus will be to make the system commercially viable.

CONCLUSION:
A microcontroller-based gas detection system has been presented. This system can deal with quick recognition of harmful gases that exist in the septic tanks. The main advantage of our system compared to other systems is that it can detect both quantitatively and qualitatively the foremost harmful gases in septic tanks. Our proposed system uses four gas sensors (MQ-135, MQ-136, MQ-4, and MQ-7) to detect the presence of CO 2 , H 2 S, CH 4 , and CO gases in the septic tank. This system can also measure the concentration of gases in PPM. Based on the concentration of each gas, the system can show the status of the septic tank on LCD, where the tank is in safe mode or danger mode. In a danger mode, an alarm will be given for the awareness of cleaners of the septic tanks. Furthermore, a Bluetooth device is incorporated with the system and application software has been developed for Smartphones to monitor the concentration of each toxic gas and the status of the tank remotely. These results reveal that our developed gas detection system can be a useful tool for cleaners of the septic tanks to ensure their health safety.