<figure><img src="image_1.png" /></figure>

HAL
open science

# The Application of Internet of Things in Pig Breeding

Minghua Shang, Gang Dong, Yuanjie Mu, Fujun Wang, Huaijun Ruan

► To cite this version:

Minghua Shang, Gang Dong, Yuanjie Mu, Fujun Wang, Huaijun Ruan. The Application of Internet of Things in Pig Breeding. 9th International Conference on Computer and Computing Technologies in Agriculture (CCTA), Sep 2015, Beijing, China. pp.548-556, 10.1007/978-3-319-48354-2_56. hal-01614203

HAL Id: hal-01614203

https://inria.hal.science/hal-01614203

Submitted on 10 Oct 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# The Application of Internet of Things in Pig Breeding

Minghua Shang¹,ª, Gang Dong²,ᵇ, Yuanjie Mu¹,ᶜ, Fujun Wang¹,ᵈ, Huaijun Ruan¹,ᵉ,*

¹Institute of S&T Information, Shandong Academy of Agricultural Sciences, Jinan 250100, China; ²Shandong Institute of Agricultural Engineering, Jinan 250100, China

ªseqsoft@163.com, ᵇtelagram@126.com, ᶜmyj2437@163.com, ᵈ191810604@qq.com,

ᶜrhj64@163.com, ᵈCorresponding Author

**Abstract.** A pig breeding IoT system is designed, in view of the human resources, natural re-sources consumption, the quality and safety problems occurred frequently, the management mode is backward and so on. In this paper, the system architecture, information awareness, system application of the three aspects of pig farming system is introduced. The system can use all aspects of pig farming to sales, has some reference to the intensive far ming of pigs.

**Keywords:** The Internet of Things, pig-breeding, large-scale, application

## 1 Preface

China is the world's largest pork producer and consumer, the demand of pork promoted the rapid development of pig breeding industry. First, the number of pig herds are increasing. In terms of Shandong, the number of pigs for 24.0181 million in 2000, by the end of 2013 pigs grew to 29.3141 million[1]. Second, the pig breeding way has changed. The traditional way of farming is to take individual farmers as the unit of extensive farming methods[2-3], farming scale is small, due to the benefits and risks of breeding to promote the industry to accelerate the withdrawal of the family, large-scale breeding has been rapid expansion[4-7]. With the pig population increased and the large-scale farming expansion, the problem of pig breeding is becoming more and more prominent: Pig farming consumes a lot of natural resources, such as human resources and feed, feeding costs greatly increased[8-9]. In the process of pig breeding, the nitrogen compounds, H2S, NH3, etc., are not strictly monitored, this is not conducive to the growth of pigs, but to some extent, the environment has caused a certain impact. Pork quality and safety problems occur frequently; Traditional production management mode is relatively backward, the data is difficult to collect and deal with it in time, which leads to the lag of production statistics, which has not adapted to the needs of modern production management[10].

Today, the development of Internet of things technology is very fast, has been in traffic, medical, security, environmental protection and other industries have been very good application. Apply the Internet of things technology to all aspects of pig breeding, through a variety of terminals, a variety of forms to allow producers,
managers, anywhere access to the relevant information and daily management, will
bring unprecedented opportunities for the pig breeding[11].

## 2 System Framework

Apply the Internet of things technology to the whole process of pig breeding.System is mainly composed of three parts: information perception, data transmission and system application. The system architecture is shown in Figure 1. Information perception is a collection of information on the breeding environment and individual information, data transmission means that the environmental information is uploaded to the server through the gateway node.Pig individual information through smart phones, PAD, PDA and other handheld devices to collect and through mobile communication networks, the Internet to upload to the server.System application layer is a monitoring platform for pig breeding, it can provide a variety of terminals, a variety of methods of data viewing, equipment management, early warning parameters set, quality traceability and other functions.

<figure><img src="image_3.png" /><figcaption>Fig. 1. System architecture</figcaption></figure>

## 3 Information Perception

### 3.1 Environmental Information Perception

Environmental information has a certain effect on the growth of pig: pig is a constant temperature animal, if the temperature is too high, the pig will be adjusted to heat, but the environment temperature is too high will make the adjustment range of pigs narrow; if the temperature is too low, it will lead to the consumption of pigs is too large, which leads to the increase of feed consumption. If the humidity in the pigsty is
too high, it will reduce the pig's resistance, increase the probability of illness; if
humidity is too low, it will cause respiratory disease in pigsty. The harmful gas such
as H2S content is too high will cause inflammation and respiratory diseases, high
concentration of NH3 will stimulate the respiratory tract mucosa and tuberculosis
membrane of pigs, causing conjunctivitis, bronchitis and other diseases.
Environmental information has become more and more attention.

3.1.1 Design of Acquisition Node

In order to achieve better monitoring of environmental information, environmental
information acquisition node is designed.The acquisition and processing of the multi
parameter data of pig breeding environment and the function of wireless transmission
are realized.The acquisition nodes mainly collect air temperature, air humidity, H2S,
NH3 four parameters, the acquisition of real-time data processing, and is responsible
for communicating with the gateway node.H2S, NH3 acquisition nodes as shown in
Figure 2(a), the air temperature and humidity acquisition nodes, as shown in figure
2(b). The acquisition node is made of four parts (see Figure 3), which is composed of
the core processing unit, signal processing unit, communication unit and power
supply circuit.

<figure><img src="image_4.png" /><figcaption>Fig. 2. Physical picture of the collection node</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>Fig. 3. Structure of acquisition node</figcaption></figure>
The signal processing unit is directly connected with the sensor (including temperature and humidity sensor, toxic gas sensor), and the NH3 sensor selects the NH3 3E Sensoric 1000 SE sensor, and the H2S sensor selects the H2S 3E Sensoric 100 S sensor. NH3 and H2S sensor use the same principle, in the monitoring to the corresponding gas will produce a weak current signal, signal acquisition circuit to get the current signal into voltage signal and amplification, and then get the voltage analog signal transmission to the core processing unit. Temperature and humidity sensor uses the SHT11 type sensor, it is slightly different with the gas sensor, it outputs digital signal, without the need for analog conversion. SHT11 sensor with strong anti-interference ability, low power consumption, fast response, high accuracy. At the 14 resolution, the humidity was ±3%RH and the temperature accuracy was ±0.4°C. The core processing unit is connected to the temperature and humidity sensor through the I2C bus to obtain the data.

The core processing unit selects STM32 microcontroller, which has the features of low power consumption, low cost and stable performance. In NH3/H2S acquisition node, the core processing unit obtains the voltage analog signal of the signal processing unit through A/D sampling, and after correction, compensation according to the sensor site temperature (different operating temperature, the corresponding current signal of 1ppm gas) will be converted to the voltage signal to the gas collection value. The core processing unit of the air temperature and humidity acquisition node can obtain the numerical value of SHT11 transmission directly through the I2C bus.

The communication module is composed of Si4432, which is simple, communication distance, supports multi band and low power consumption. The acquisition node and gateway node are composed of Si4432, and the information is transmitted to the gateway node.

### 3.1.2 Design of Gateway Node

The gateway node is a bridge between the system application platform and the data acquisition node, which affects the stability of the system. The main function of gateway node: access to various information collection node data; establish the system application platform and long connection can maintain real-time communication; in wireless sensor network and communication network platform, the ability to parse and transform the protocol; configuration: intensity collection node address addressable configuration parameters the base configuration properties that can be configured. Gateway hierarchy is shown in Figure 4.
<figure><img src="image_6.png" /><figcaption>Fig. 4. Hierarchical structure of gateway node</figcaption></figure>

The gateway node selects the S3C2440 processor of Samsung, which is equipped with the Linux 2.6 kernel and Yaffs2 file system. The gateway node is located in the center of the star network of Si4432, and the data obtained from each node is obtained. After data acquisition, the network joint points analysis data packets, the data is updated to real-time display in the interface of Qt, and the data packets are transmitted to the remote server according to the protocol. Communication unit Ethernet or GPRS two ways and the remote server through the design of the heartbeat packet to maintain a long connection state, uplink transmission data, downlink transmission. The physical map of the gateway node is shown in Figure 5.

<figure><img src="image_7.png" /><figcaption>Fig. 5. Physical picture of the gateway node</figcaption></figure>
## 3.2 Production Management Information Perception

In livestock and poultry breeding enterprises in the production of information is still based on the traditional paper records, not only inefficient, error prone, and the data is difficult to timely collection and processing, resulting in a serious lag in production statistics. Livestock quality and safety traceability system requires the information of the whole industrial chain such as pig production, quality inspection, slaughter, transportation, freezing, sales and so on. In order to solve this problem, we designed a portable pig ear tag reading and writing equipment, and developed a set of APP software which named ZHINONGYUNDUAN based on the Android system, and it is necessary to use. Regardless of which link in the whole industry chain, when the need to enter the information, you can use a portable ear tag reader to read and write the device to read the information, the APP client software to enter the appropriate information, and then click on the preservation of information, you can save the collected data to the system. In this way, the individual and the production, quality inspection, slaughter, transportation, freezing, sales and other information links. The portable ear tag reading and writing equipment is made up of three parts: the core processor, the RFID read and write module and the Bluetooth module, and the structure of the device is shown in Figure 6.

<figure><img src="image_8.png" /><figcaption>Fig. 6. Structure of portable ear tag reading and writing equipment</figcaption></figure>

When using this system, the first portable ear tag information collection device (see Figure 7(a)) Bluetooth module and handheld terminal device pairing, portable pig ear tag read-write device using RFID technology, through the non-contact way to obtain pig ear tag information, and ear tag information is transmitted to the APP via Bluetooth (Fig. 8(a)). The corresponding user input information in APP software (Figure 8(b)), click save, relevant information can be transmitted to a remote server, the information flow is shown in figure 7.
<figure><img src="image_9.png" /><figcaption>Fig. 7. Collection equipment for portable ear tag information</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>Fig. 8. UI of the ZHINONGYUNDUAN APP</figcaption></figure>

## 4 Application of the System

The application of the system mainly includes:
1. Data real-time monitoring: users can view the real-time data of the various pig breeding environment information acquisition nodes, and can view the production management information;
2. Historical data query and export: environmental information collection node acquisition of data and the wisdom of the cloud APP access to the data stored in the Server SQL database, the user can choose according to their own needs to query the data, but also can export the selected time period of data analysis;
3. Alarm management: users can set up the demand of air temperature and humidity, NH3/H2S gas content on the threshold, if the actual measurement value exceeds the threshold range of the system will automatically alarm to inform the user;
4. Equipment management: users can add
/ remove the environment information collection node, change the equipment (gateway node, environment information acquisition node) according to their own needs ID number.

For the realization of the traceability of pork products quality and safety process, the team based on information management of pig breeding, slaughtering, processing, storage and transportation and other production records, is developed for traceability terminal quality information of pork products (Figure 9(a)) and electronic scale source (Figure 9(b)).In the bar code generated by the special electronic scales, the information contained in the whole process of pig raising to pork production, quality inspection, slaughter, transportation, freezing and sales etc.. The whole process can be obtained by scanning the two-dimensional code in the quality of pork.

<figure><img src="image_11.png" /><figcaption>Fig. 9. Pork product quality information traceability terminal</figcaption></figure>

# 5 Brief Summary

This paper according to the actual needs of production, use the Internet of things technology, have developed a set of system for the management of pig farms. The system can collect the real-time data of the air temperature, humidity, H2S, NH3 in the environment of pig breeding according to the requirements of production, and obtain the production management information, and the information of the quality inspection, slaughter, transportation, freezing, sales and other information are linked with the pig individual, and realize the whole process of pork production. Although the network system of pig farms has been developed, it still has a large gap compared with the developed countries, which need to be improved in the future. The rapid development of the Internet of things technology will give the livestock and poultry breeding industry has brought a qualitative leap.

# Acknowledgment

Funds for this research was provided by the National Science and Technology Plan Projects (2014BAD08B05-02), Shandong Province Major Projects of Independent Innovation (2014XGA13054), Shandong Province Key R&D
References

1. Shandong Provincial Bureau of Statistics. Shandong Statistical Yearbook 2014 [M]. Beijing: China Statistics Press, 2014.

2. Li Xiuhong, Ai Hongbo. Design Scheme of Livestock and Poultry Farm [J]. Agricultural Network Information, 2012, 8:28-30.

3. Lu Changhua. Application and Prospect of Modern Livestock and Poultry Breeding Information Technology [A]. China Animal Husbandry and Veterinary Society Information Technology Branch of the 2014 Academic Seminar[C].Beijing:China Agricultural University Press, 2014, 194-205.

4. Zhu Mengshuai, Zhao Pu, Liu Jiajia et al. Technical Support For the Modernization of Animal Husbandry Modernization[J]. China Livestock Industry, 2015, 2:20-23.

5. Xu Biao, Shi Liang, Liu Yang. Study on the Scale Evolution Model of Pig Breeding Industry in China [J]. Agricultural Economic Problems, 2015, 2:21-26.

6. Zhang Wei, He Yong, Liu Fei et al. Environmental Monitoring System Based on Internet of Things of Large-scale Livestock Breeding [J]. Agricultural Mechanization Research, 2015, 2:245-248.

7. Liu Yuan, Yang Zelin, Zhao Yongjun. The Application of the Internet of Things Technology Based on RFID in Animal Husbandry [J]. Heilongjiang Animal Husbandry and Veterinary, 2012, 8:15-17.

8. Yao Xuguo. The Application of the Internet of Things Technology in the Large-scale Livestock and Poultry Breeding Industry [J]. Agricultural Network Information, 2013, 10:24-26.

9. Wu Linhai, Xu Guoyan, Yang Le. Study on the Moderate Scale of Pig Farms in the Cost of Environmental Pollution Control [J]. Population Resources and Environment in China, 2015, 25(7):113-119.

10. Yang Binyu, Song Changming, Cai Fan et al. The Design of the Monitoring System of the Digital Aquaculture Production Process Based on the Internet of Things [J]. Agricultural Equipment, 2015, 2:183-184.

11. Xiong Benhai, Yang Liang, Pan Xiaohua. Research Progress of the Application of the Internet of Things Technology in Animal Husbandry in China [J]. China Animal Husbandry and Veterinary Society Information Technology Branch of the 2014 Academic Seminar[C].Beijing:China Agricultural University Press, 2014, 149-159.

12. Li Yurong, Liu Ying, Ni Chao et al. Temperature Acquisition System Based on SHT11 Sensor for Low Power Tree Farm [J]. Agricultural Mechanization Research, 2013, 1:204-208.