The Application of Internet of Things in Pig Breeding

. 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.


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][5][6][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].

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.

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.

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.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℃.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.

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.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.

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.

Power supply circuit
Bluetooth module RFID R/W module Coil Fig. 6.Structure of portable ear tag reading and writing equipment 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.

Application of the System
The application of the system mainly includes:①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;②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 query data, but also can export the selected time period of data analysis;③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;④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.

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.

Fig. 5 .
Fig. 5. Physical picture of the gateway node