Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/336162370

Control of Livestock Waste Odors Using Gas Sensors and Fuzzy Logic

Conference Paper · July 2019


DOI: 10.1109/ICTS.2019.8850955

CITATIONS READS

0 186

3 authors, including:

Muhammad Rivai Astria Nur Irfansyah


Institut Teknologi Sepuluh Nopember Institut Teknologi Sepuluh Nopember
162 PUBLICATIONS   525 CITATIONS    27 PUBLICATIONS   59 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

FPGA implementations of stochastic computing applications View project

drip irrigation View project

All content following this page was uploaded by Muhammad Rivai on 17 October 2019.

The user has requested enhancement of the downloaded file.


12th International Conference on Information & Communication Technology and System (lCTS) 2019

Control of Livestock Waste Odors Using Gas


Sensors and Fuzzy Logic
Kharis Sugiarto MuhammadRivai Astria Nur Irfansyah
Department ofElectrical Engineering Department ofElectrical Engineering Department ofElectrical Engineering
Institut Teknologi Sepuluh Nopember Institut Teknologi Sepuluh Nopember Institut Teknologi Sepuluh Nopember
Surabaya, Indonesia Surabaya, Indonesia Surabaya, Indonesia
kharissugiarto7@gmail.com muhammad_rivai@ee.its.ac.id irfansyah@ee.its.ac.id

Abstract- Pollution from livestock waste causes poor air II. LITERATURE REVIEW
quality. This can be a problem for animals and humans around
the livestock. This study has designed and realized a control A. Ammonia
system of livestock waste odor using fuzzy logic method Ammonia is a substance produced in the chemical reaction
implemented on the Arduino Due micro controller. This system of livestock feces shown in equation (1). Excessive level of
employs metal oxide semiconductor gas sensors to measure this substance can cause odor pollution for the environment
waste odor levels and an electronic valve with a nozzle used for
that is harmful to both livestock and humans. The ammonia
spraying the yucca schidigera liquid as a deodorizing agent. The
gas level in farm environments must be less than 20 ppm [7,8].
experimental results show that the fuzzy logic controller can
reduce the odor pollutant levels within 4.5 minutes. In the
uncontrolled livestock waste odor, the ammonia and hydrogen Organic -+ Organic Acid, -+ CO +2N H + H
2 3 2S
+CH
4
(1)
sulfide levels are 9.93 ppm and 1.16 ppm, respectively. Livestock Alcohol
Meanwhile, in the controlled livestock waste odor, the ammonia
and hydrogen sulfide levels are 1.18 ppm and 1.13 ppm,
B. Hydrogen Sulfide
respectively.
Hydrogen sulfide is a toxic substance that is formed from
Keywords- fuzzy logic controller, gas sensor, livestock waste the decomposition of organic matter from animal feces shown
odor, yucca schidigera in equation (2). The presence of hydrogen sulfide due to
pollution of livestock waste is smaller than other substances
I. IN1RODUCTION such as carbon dioxide and ammonia. For the livestock
Odor pollution is usually a volatile compound with levels environments, concentration of this substance is still allowed
that exceed the threshold for clean air quality. Odor pollution at less than 2 ppm. In pollution free environments, the average
usually occurs in industrial environments, one of which is hydrogen sulfide level is around 0.13 ppm [1].
livestock. Odor pollution often occurs due to waste that
accumulates for long periods of time . The odor is chemically
characterized by low oxygen (02) and high levels of carbon
Feces + Litter -+ [CO(NH 2hJ -+ C02+2NH3 + H20 (2)
dioxide (C02) and other harmful substances such as ammonia
(NH3) and hydrogen sulfide (H2S) [1]. Metal oxide
semiconductor gas sensors are often used for gas or vapor C. Yucca Schidigera Extraction
detection both indoors and outdoors because they require Yucca schidigera is an extraction from yucca plants
simple circuit and robust [2-5] . containing bioflavonoids that is useful for neutralizing odor
pollution. Some flavonoid compounds such as quercetin,
Studies of deodorizing using biomaterials have been kaempferol, myricetin, apigenin, luteolin, vitexin and
developed. Bioflavonoids from yucca schidigera plants can be isovitexin have antioxidant properties. Extraction from these
used to neutralize odor pollution generated from livestock plants has been studied and implemented to eliminate
waste [6]. Currently, the handling odor pollution generated pollution of livestock waste odors such as ammonia, carbon
from livestock waste is still carried out by spraying regularly. dioxide and hydrogen sulfide. The reduction process of
Therefore, automatic control is needed to be more efficient hazardous substances using yucca schidigera liquid can be
and effective. seen in Figure 1 and Figure 2. This extraction of yucca
The conventional control systems cannot solve complex schidigera provides more benefits where the waste reacted
problems, especially in the case of implementation with with yucca will become a fertilizer faster and useful for
unpredictable conditions. The control system with artificial agricultur e [6].
intelligence techniques has been developed, one of which is
the fuzzy logic controller. This method can solve problems

~
N H2
without having to model the system mathematically. In
general, fuzzy methods are widely used with Sugeno and HO - N" "'<:: 0 '"
I OH
Mamdani models. Sugeno's model has accurate calculations OH
and quick responses. OH N
I

Fig. 1. The ammonia reduction using yucca schidigera 19J.

978-1-7281-2133-8/19/$31.00 ©2019 IEEE 81


E. Fuzzy Logic Controller
Fuzzy logic controller is an artificial intelligence

. --
Cy. CIt Hey )
-- ~
H:S
technique which is not based on mathematical modeling. This
fuzzy logic method has been implemented in many fields of
appli cation [12-15]. This method is different from binary logic
where fuzzy logic is based on uncertainty. Fuzzy logic map s
Prooe 3· input into output with rules that can be determined from
experiences or formulated by experts.
Figure 5 depi cts a closed loop system with fuzzy logic
Fig. 2. The hydrogen sul1ide reduction using yucca scilidigera controller. The steps of fuzzy logic processing consist of
[10].
fuzzification, inference, fuzzy rules and defuzzification [16].
Fuzzification is a process that converts crisp input values to
fuzzy terms quantified by input membership functions. The
D. Gas Sensor membership function is usually in the form of a trapezium and
Semiconductor gas sensors are usually made of ZnO and triangle as shown in Figure 6. In its implementation, a fuzzy
Sn02 which are modified with AL203 to improve their logic input variable consi sts of several members as shown in
performance. When the crystal ofthe sensor material is heated Figure 7. Inference is basically a decision based on the rules
at a certain temperature, oxygen in the surrounding air will be of reasoning from fuzzy logic illustrated in Figure 8. The
adsorbed onto the surface of the crystal so that it is negatively concept of fuzzy rules uses the "IF-Then" logic shown in
charged. This can inhibit the movement of electrons in the equation (3).
sensor crystal. When the sensor is exposed to reducing gases ,
the density ofthe negati vely charged oxygen ion will decrease
which can reduce its resistance shown in Figure 3. In this if Xl is Ai and ... and Xn is An then Y is B (3)
study, the TGS2602 gas sensor is used to detect the ammonia
concentration and MQ136 is used to detect the concentration Defuzzification tran sforms the fuzz y results of the inference
of hydrogen sulfide. The characteristic of the MQ136 gas into crisp output for action as shown in Figure 9. The
sensor is shown in Figure 4. decision-making method in this study uses the Center ofArea
0"1'
(COA) shown in equation (4).

(4)

- - - - -1----- - - - 1---=--, where fl A (x) is the degree of output membership function,

--
~---- I---~• .I ~
and x is the crisp output value.
....-. . ' :~ l
--" Air Air Alr + NII FUZZY LOGIC
y(t)

CONTROLLER
Output
Fig . 3. The working principle ofthe gas sensor in the presence L -_ _- - - '
Signa l
of reducing gas [11].

MQ-136 Fig. 5. A closed loop system with fuzzy logic controller [16].
p(x)
In uoo
1
1
.UK

------ c;
- ~i1:4
~~ -
-----
- ~s

1-------- -------- r--- r--.


0--+--'-- -'------- --'--------'--- -
x n b x

M
.,
. ;l
--- - ----------
-
----- Fig. 6. The triangular and trapezoidal membership functions
----- ofa fuzzy logic [16].
u
:-IVL :-IL NM NS 1Z PS PM PL PVL

l. 1
10 : 00 1000

·60 -5 () -4() -20 o +20 +60 +80 e


Fig . 4. The characteristic of the MQ136 gas sensor. Fig. 7. The input membership function that describes the error
value in fuzzy logic control [17].

82
Fig . 8. The fuzzy inference process [17].

y :defuzzified ou tput (crisp)

.5

---'~ca

Fig . 9. The defuzzification method [17]. Fig. 12. The control system for livestock waste odors .

III. RESEARCH METIIODS B. Design ofFuzzy Logic Controller


A . Waste odor control system Fuzzy logic controller is built from experience that is
translated into rules for controlling a system. The control
This study deals with the design of waste odor pollution design in this study can be seen in Figure 13. The fuzzy logic
control system using fuzzy logic method implemented on algorithm is realized using the c ++ programming language
Arduino Due board based on Atmel SAM3X8E ARM Cortex- implemented into the Arduino Due microcontroller as shown
M3 core. The block diagram of this system can be seen in in Figure 14. The input data are voltage responses of the gas
Figure 10. The MQl36 and TGS2602 gas sensors are used to sensors, while the output data is the opening time of the valve
identify the type of gas and measure its concentrations. The actuator. The process of fuzzy logic controller is described as
measurements of ammonia and hydrogen sulfide follows:
concentrations are used as control inputs. In this system, a
valve actuator is deployed for spraying the liquid of yucca I) Fuzzification is obtained from converting crisp input value
schidigera. The 0.1 mm nozzle converts the pressurized liquid into the fuzzy value by using the error input membership
to become mist as shown in Figure 11. The realization of the functions shown in Figure 15, with NS is Negative Small , N
control system oflivestock waste odor is shown in Figure 12. is Negative, Z is Zero, P is Positive, PB is Positive Big. The
error is the difference between the clean air setpoint and the
actual value of the ammonia or hydrogen sulfide
concentration. Meanwhile, the Aerror is the difference
between the current and previous error values in which the
Aerror input membership function is shown in Figure 16.
....

I~ I
TUS2602

r'
t
Arduino I )ue V3 1 \'e ~ N ozzle» I
I
Board
MQ I.16
........................ I I
I

G as.Senso rs :I L,J r----,'----.--"I


Motorized rump
I
I
I
Fig . 10. Block diagram of the waste odor control system. I C.error Membership
I
I Function
I
I
I 1- - - - - '
I 1 Livestock 1
I 1 1
I 1 Odor 1
I y(t) I ~ 1
I t---+l Valve s 1
I L --' 1 1
I
I Valve M emb ership 1I ~
Fece s 1I
1, 1I
~- -- --- y~~~~------- - ---
Actual

Fig . 11. The spraying of yucca schidigera liquid. Fig. 13. The block diagram of the fuzzy logic controller
system.

83
Table 1. The rule of fuzzy logic controller used in the
experiment.
Gas Sensor Valve
Initialization No Opening
error Aerror Time
Odor Setpoint=O.33 ppm
1 NS NS Long
2 N NS Long
3 Z NS Middle
4 P NS Short
5 PB NS Short
6 NS N Long
Error(t)= Odor Setpoint - Actual
7 N N Middle
~error= error(t) - error(t-l)
8 Z N Middle
9 P N Short
10 PB N Short
11 NS Z Middle
12 N Z Middle
13 Z Z Short
14 P Z Short
15 PB Z Zero
No 16 NS P Middle
17 N P Short
18 Z P Short
19 P P Zero
20 PB P Zero
Stop 21 NS PB Short
22 N PB Short
23 Z PB Zero
Fig. 14. Flowchart of the control system for livestock waste 24 P PB Zero
odors. 25 PB PB Zero

Er ror

NS N z P PB Valve Opening
Zero Short Middle Long

0'--_-'-_-'--_"'"-_"'---_'--_ _-..
-10 -5 o 5 10
Concentration (ppm) o' - - _...L..-_---'-_ _-'-_----'~
Fig. 15. The error input membership function. o 25 50 75
Time (Sec onds)
Fig. 17. The output membership function of the opening
Aerror
time of the valve.
NS N z P PB

Table 2. The gas sensor measurements.


Gas Sensor Voltage (mY)
Gas Type
MQ136 TGS2602
Ammonia 320.6 4075
O L - _- L _ . . . l - _.JL-_.L.-_.l...-_ _---. HzS 2860 360
-2 -1 0 1 2 Smoke 508 502
Concentration (ppm)
Propane 402 357

Fig. 16. The Aerror input membership function.


IV. RESULTS AND DISCUSSION
2) Inference is a fuzzy rule for controlling a system that The initial experiment is to measure the gas sensor
combines input and output membership functions. The fuzzy response for several types of gas shown in Table 2. The
logic rules are shown in Table 1. TGS2602 sensor has a high response during exposure to
ammonia gas, while the MQ136 sensor has the dominant
response to hydrogen sulfide. The next experiment is to
3) Defuzzification converts fuzzy output values into crisp measure the volume of liquid produced by the valve on the
values . The output membership function uses singletons that fuzzy logic controller system during ammonia exposure
represents the opening time of the valve, shown in Figure 17. shown in Table 3. For 2.81 ppm of ammonia, the spraying
volume is 2.6 ml, whereas for 27.38 ppm of ammonia, the
spraying volume is 25.3 ml. The measurement of the time
response of the fuzzy logic controller is accomplished with a

84
setpoint of3.95 ppm when the actual value is 27.59 ppm. This
control system takes 4.5 minutes as shown in Figure 18. The Uncontrolled Livestock Odors

Measurement of gas sensor carried out on clean air is used a :I!i


as a setpoint on the control system . This outdoor measurement 0.
0.

is conducted at a distance of about 15 meters from the


~ 20

§
livestock area. Wind and air humidity are the main factors that ·C l~

can affect the measurement results to fluctuate. In the clean ~ ]0


air, the ammonia and hydrogen sulfide levels are 0.51 ppm and §
0.61 ppm, respectively, shown in Figure 19. In the U

uncontrolled livestock waste odor, the ammonia and hydrogen I 3 9 II 13 15 17 19 2 1 23 25 n 29 31 33 35 37 39 ~ I ~3 ~ 5


sulfide levels are 9.93 ppm and 1.16 ppm, respectively, as Sampling Time (Days)
shown in Figure 20. The fuzzy logic controller system is -es- Hydrogen Sulfide -..-Aml1lo nia
implemented at the location oflivestock to control the level of
surrounding air pollution. The experimental result showed that
in the controlled livestock waste odor, the ammonia and Fig. 20. The uncontrolled livestock waste odors.
hydrogen sulfide levels are 1.18 ppm and 1.13 ppm,
respectively, as shown in Figure 21.
The Co ntrolled Livestock Odors

Table 3. The liquid spraying during ammonia exposure.


Ammonia Volume
NO (ppm) (mL)
I 27.38 25.3
2 21.77 20.1
3 18.35 16.9
4 15.25 14.1 1 :2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 & 19 20 21 22
5 9.25 8.5 Samp ling Time (Days)
6 6.5 6. ~ J l y (b O;C t:n sul fi de ....... Am mo nia
7 4.78 4.5
8 2.81 2.6

Fig. 21. The controlled livestock waste odors.

Fuzzy Logie Controller Response


V. CONCLUSION
In this study, we have designed and realized a control system
of livestock waste odor using fuzzy logic method
implemented on the Arduino Due microcontroller. This
system employs TGS2602 and MQ136 metal oxide
semiconductor gas sensors to measure waste odor levels and
an electronic valve with a nozzle size of 0.1 mm used for
) 3 5 7 9 11 n 15 17 19 2 1 23 "5 27 29 .1 1 3.1 35 .17 39 ·11 B ·15 ·17
spraying the yucca schidigera liquid . The experimental results
Sampling Time (Seconds)
~ A ctll a l -e-e Setpcint
show that the fuzzy logic controller can reduce pollutant levels
from 27.59 ppm to 3.95 ppm within 4.5 minutes. In the
uncontrolled livestock waste odor, the ammonia and hydrogen
sulfide levels are 9.93 ppm and 1.16 ppm, respectively.
Fig. 18. The time response of the fuzzy logic controller. Meanwhile, in the controlled livestock waste odor, the
ammonia and hydrogen sulfide levels are 1.18 ppm and 1.13
ppm, respectively.
Clean Air Odors
07

A CKNOWLEDGMENT
This research was carried out with financial aid support
from the Ministry of Research, Technology and Higher
Education ofthe Republic ofIndonesia (Kemenristekdikti RI).

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 4 1 REFERENCES
Sampling Time (Seconds)
~ l l y clrog e n sulfide -6- :'\ m monia
[I] Alta Atia, Karen Haugen-Kozyra and Mohamed Amrani , "Ammonia
and Hydrogen Sulfide Emiss ions from Livestock Production.t'Alberta
Agriculture, Food and Rural development , 2000, pp. 227-27 1.
Fig. 19. The livestock waste odors in the clean air. [2] Radi , Muhammad Rivai, Mauridhi Hery Pumomo, "Study on
Electronic Nose-Based-Quality Monitoring System for Coffee under

85
Roasting", Journal of Circuits, Systems, and Computers, Vol. 25, Issue [10] Dong-Peng Li, Jin-Feng Zhang, Jie Cui, Xiao-Feng Ma, JinTing Liu,
10,2016, pp. 1650116-1 - 1650116-19 Jun-Ying Miao, Bao-Xiang Zhaoa, "A ratiometric fluorescentprobe for
[3] Hari Agus Sujono, Muhammad Rivai, Muhammad Amin, "Asthma fast detection of hydrogen sulfide and Recognition of biological thiols",
Identification Using Gas Sensors and Support Vector Machine", Sensors and Actuators B Chemical, Vo1.234, April 2016, pp. 231-238.
Telkornnika, Vo1.16, No.4, 2018, pp. 1468-1480 [II] Dey, "Semiconductor metal oxide gas sensors: A review," Material
[4] Muhammad Rivai, Fajar Budiman, Djoko Purwanto, Joshwa Science and Engineering: B, Desember 2018, Vol. 229, pp. 206-217.
Simamora, "Meat Freshness Identification System Using Gas Sensor [12] Dewi Nurhaji Meivita, Muhammad Rivai, Astria Nur Irfansyah,
Array And Color Sensor In Conjunction With Neural Network Pattern "Development of an Electrostatic Air Filtration System Using Fuzzy
Recognition", Journal of Theoretical and Applied Information Logic Control", International Journal on Advanced Science,
Technology, Vol. 96, No 12,2018, pp.3861-3872. Engineering and Information Technology, Vol. 8, No.4, 2018, pp.
[5] Vinda Setya Kartika, Muhammad Rivai, Djoko Purwanto, "Spoiled 1284-1289.
Meat Classification Using Semiconductor Gas Sensors, hnage [13] Muhammad Rivai, Rendyansyah, Djoko Purwanto, "Implementation
Processing and Neural Network", International Conference on of Fuzzy Logic Control in Robot Arm for Searching Location of Gas
Information and Communications Technology, Yogyakarta, 2018, pp. Leak", International Seminar on Intelligent Technology and Its
418-423 Application , 2015, pp. 69-74
[6] Deng-Sheng Sun, Xiao Jin, Binlin Shi, Yuanging Xu, and Sumei Van, [14] Muhammad Rivai, Kriyo Sambodho, Dwi Purnomo H, "Identification
"Effects of Yucca schidigera on gas mitigation in livestock production: of Levee Strength for Early Warning System Using Fuzzy Logic",
A review," Brazilian Archives of Biology and Technology 60, 2017, International Conference on Information, Communication Technology
pp.I-15. and System, Surabaya, 2014, pp. 25-29
[7] Kaiying wang, Dandang Huang, Hongchuang ying, and Haojie Luo, [15] Ngangbam Herojit Singh, Khelchandra Thongam, "Mobile Robot
"Effects of acidefication duting storage on emissions of methane, Navigation Using Fuzzy Logic in Static Environments", Procedia
ammonia, and hydrogen sulfide from digested pig slurry," Biosystems Computer Science, 125,2018, pp. 11-17
Engineering, Vo1.122 June 2014, pp. 23-30. [16] Herbert Martins Gomes, "Fuzzy Logic For Structural System Control",
[8] P.M. Ndeqwa, A.N. Hristov, J.Arogo, and R.E Sheffield, "A review of Latin American Journal of Solids and Structures,Brazil Vol. 9, 2012,
ammonia emission mitigation techniques for concentrated animal pp. 111-129
feeding operations," Biosystems Engineering, Vo1.100 ,may 2008, pp. [17] P.A. Saudagar, D.S. Dhote and K.D. Chinckhede, "Design of Fuzzy
453-469. Logic For Humidity Control Greenhouse", International Journal of
[9] Aljce Arbenz, and luc Averous," Chemical modification of tannins to Engineering Inventions,India Vol. I, Desember 2012, pp. 45-49
elaborate aromatic biobased macromolecular architectures," Green
Chemistry, February 2015 voU7, pp.2626-2646.

86

View publication stats

You might also like