Wireless Sensor Network Based Chicken Coop Surveillance System

To tackle with the current situation of China's chick raising industry that is characterized with plenty insufficient automatic level and underdeveloped management techniques, a chicken coop surveillance system based upon wireless sensor network proposed in this article is composed of 4 major components like parameter collection module, host and slave computer as well as wireless communication network for the purpose of monitoring the temperature, humidity and concentration of hazardous gas inside the chicken coops while automatically initiating the manure remover according to the detected hazardous gas concentration. It is revealed by relevant experiments that such system is able to realize precise control over temperature and humidity with maximum tolerance up to 2 and 4% respectively and meanwhile, ensure that the concentration of hazardous gas is limited to an allowed range. Therefore, this is an ideal intelligent chicken coop surveillance system for chick raisers as it is not only easy to operate but also capable of delivering preferable control results.


I. INTRODUCTION
As for the poultry forming that constitutes one of the most important sectors for Chinese agriculture, chickraising is definitely essential since the environment control over chicken coops directly affects the growth of chicks [1] . At present, chicks are kept through either battery farming or free-range farming [2] . Considering the disadvantages of both foregoing methods, for example, low automatic level and serious environmental pollution [3][4][5] , middle and large scale poultry farming enterprises have begun to introduce automatic monitoring technology [6][7][8] that, to certain degree, improves the environment control quality of chicken coops but is haunted with a number of setbacks such as complicated wiring, high cost, inadequate degree of intelligence and scientific management.
Accordingly, a wireless sensor network based chicken coop intelligent surveillance system is brought up to monitor the temperature, humidity and hazardous gas concentration of chicken coops and at the same time, to clean up chicken manure automatically in compliance with the concentration of hazardous gas it picks up. Due to the technology of wireless sensor network, such system is both cost-efficient and easy to expand if required. What's more, the LabVIEW software installed in the host computer features a friendly user-to-machine interface that greatly facilitates supervision and control for farmers, especially middle and large scale poultry framing organizations.

A. System composition
Mainly consisting of parameter collection modules (capable of detecting temperature, humidity and hazardous gas concentration), a host computer (made up of a display section, a configuration section, an alarm section and a database as well), a slave computer (direct control over heating, moisturization, ventilation and manure removal) and a wireless communication network (composed of a collection terminal, a router, a coordinator and a control terminal) as shown in the Figure 1, this system operates according to the following procedures: (1) After obtained data in connection with temperature, humidity, hazardous gas concentration inside the chicken coops and temperature and humidity outside, the parameter module uploads such data to the host computer via the collection terminal, router and coordinator which are comprised of CC2530 and a radio frequency transceiver; (2) Upon receipt of such data, the host computer subsequently conducts processing (data display, storage and alarm setoff included) and comprehensive analysis (through fuzzy control software) so as to get control information; (3) By means of the coordinator, router and control terminal, the slave computer receives the corresponding control information from the host computer; (4) When completed analyzing the received control information, the slave computer directly manipulates relevant devices related to heating, moisturization, ventilation and manure removal.

B. Chicken Manure Removal Design
The chicken manure remover consists of a manure scraping device, a washing device, a reversible motor and a control unit as shown in the Figure 2.
From the Figure 2 we can see that via the reversible motor that, under the control of CC2530, rotates clockwise to move the scrapers to shove chicken manure to the discharge chute and counterclockwise to bring them back to the rest position, the manure remover cleans up chicken manure. Manure remover control module is shown Figure  3.
Manure remover control module installed in the bottom brooder and closed to the reversible motor is composed of a detection unit, CC2530, ULN2003 and the relay group. The detection unit, e.g., two photoelectric sensors, are installed on both ends of the brood cage at the bottom of the lateral chain respectively, and the purpose is to detect dung plate location. The main control chip of slave computer, e.g., CC2530, is used for detecting signal and controlling actuators. CC2530 drives the relay group control through ULN2003 chip thus it can control the manure remover. As for the control procedures, please see Figure  4.

A. Parameter Collection
The data concerning temperature, humidity and hazardous gas concentration are collected first and then transmitted to the host computer via the wireless network consisting of CC2530. Such system adopts a temperature and humidity sensor DHT11, a gas concentration sensor MQ-135 and an analog-to-digital converter PCF8691. Here are the operation principles of MQ-135: the conductivity of SnO2, a kind of gas sensitive material constituting such gas concentration sensor, increases as the concentration of hazardous gas builds up in the air, and the internal circuit converts the changes of conductivity into voltage signals. Integrated with a reinforced single-chip microcomputer and a quality radio frequency chip, the module of CC2530 features abilities of ad hoc network and strong resistance to interference. Since the data collected by the hazardous gas detection module are liable to be influenced by the fluctuation of ambient temperature and humidity, the host computer should calibrate the collected data concerning temperature and humidity. Temperature and humidity collection circuit is shown in Figure  5.

B. Wireless Network Design
ZigBee, a cost-efficient wireless network technology deployed by this system, is suitable for close-range communication 4 [9][10][11] . Formed in a star-shaped topological structure and with a Baud rate of 115,2000, such technology operates in the following fashion: the sensor module stores the collected environment parameters into CC2530 after conversion in the first place and then sends them to the ZigBee wireless network through the data collection terminal and the coordinator in turn. It is the USB serial port cable that the host computer uses to access, display and analyze the corresponding environment parameters and finally dispatch the control information obtained via fuzzy control to the coordinator. The coordinator transmits the control information to the control terminal along the same routes so as to manipulate each chicken coop individually in a wireless way.

A. Wireless Network Design Host Computer Control
Featuring LabView, a piece of software with a friendly user-to-machine interface and Access database holding collected environment parameters and standard system configuration parameters, the host computer is able to function via fuzzy control and different modules.

B. Fuzzy Control
Due to the nature of chicken coops, i.e. nonlinear and time-varying, fuzzy control is therefore adopted to control its environment [12] . Put the difference between temperature and humidity and related standard values, hazardous gas concentration and upper limit on top of the rate of change in connection various differences into the fuzzy controller that, following fuzzy reasoning, generates output values, wherein 0 stands for normal, 1 relatively higher and 2 relatively lower. There are 3 steps about fuzzy control: fuzzification, fuzzy reasoning and clarification [13] .
When entering 6 parameters like temperature deviation E1 and its rate of change EC1, humidity deviation E2 and its rate of change EC2, hazardous gas concentration deviation E3 and its rate of change EC3, the fuzzy controller then outputs U1, U2 and U3 as results following fuzzy reasoning. Regarding the membership function between the inputs E and EC and the output U, refer to the Fig. 6, where in PB, PM, PS, ZE, NS, NM and NB respectively correspond to total 7 fuzzy sets such as positive big, positive middle, positive small, zero, negative small, negative middle and negative big. Table 1 tabulates the fuzzy laws.
As different parameters are output as continuous values by the fuzzy controller, the outputs of temperature and humidity U1 and U2 are accordingly dispersed into 3 values: if U 2, then U=1, indicating that the said parameter is higher than the preset value, if U -2, then U=2, indicating that the said parameter is lower than the preset value and if -2�U�2, then U=0, indicating that the said parameter equals the preset value. On the other hand, in respect of the hazardous gas concentration, the output U3 is dispersed into 2 values: if U3 2, then U3=1, indicating that the hazardous gas concentration in the chicken coop is rather higher, and if U3�2, then U3=0, indicating that the hazardous gas concentration in the chicken coop is acceptable.  The control information mentioned above is sent to the slave computer by the host computer through the ZigBee wireless network and the former consequently instructs certain device related to heating, moisturization, ventilation and manure removal to operate upon receipt of such control information.

C. Function Modules
The function modules of the host computer include a data display module, a data storage module, a data analysis module, an alarm module and a system setup module, as shown in Figure 7. Via the data display module, users are allowed to check out relevant environment parameters from the ZigBee coordinator as well as alarm information that is displayed in the form of tables. Together with those standard values configured by users, the data of temperature, humidity and hazardous gas concentration collected from chicken coops are stored in the data storage module. The data analysis module depends upon a fuzzy control algorithm to analyze the corresponding data stored in the data storage module so as to obtain control information. In addition, the alarm module is capable of triggering alarms of temperature, humidity and hazardous gas. Through the system setup module, users can set up standard parameters related to temperature and humidity, and time for manual manure removal according to the demands of chick growth. As per the environment test results of chicken coops, the hazardous gas concentration is set to 14ppm by default.

D. Slave Computer Control
In order to avoid operation errors due to difference between the inside and outside, slave computer control is employed to monitor the external environment in terms of temperature and humidity and then compare with that in the chicken coops for the purpose of taking proper actions. In regard to the control information, 0 suggests that the outdoor temperature is equal to the average temperature of the chicken coops, 1, the outdoor temperature is higher than the average temperature of the chicken coops and 0, the outdoor temperature is lower than the average temperature of the chicken coops. Such denotation also applies to humidity. For details, please refer to the Table II According to the standard parameters involving temperature, humidity and time for manure removal set up by users, the host computer, via the fuzzy control system, periodically sends relevant control information to the slave computer in the format of Chicken Coop No. + Internal Temperature + Internal Humidity + Internal Hazardous Gas Concentration + External Temperature + External Humidity. Take a01102 as an example, it means that as for the chicken coop No. a, the temperature inside such coop is normal, the humidity and hazardous gas concentration inside such coop are relatively higher, and the temperature outside such coop is equal to the average temperature inside such coop and the humidity outside such coop is lower than the average humidity inside such coop. If users touch the button of manure removal in connection with the chicken coop No. b in the operation interface of the host computer, the host computer then sends b33333 to clean up such coop. When the time for manure removal configured by users is reached, the host computer sends a/b/c/…+33333 to remove the manure of all the chicken coops. If pressed OFF button in the interface, the host computer sends the control information of a/b/c…+00000 to suspend the operation of all the actuation mechanisms of the chicken coops. After start-up, the slave computer initiates the chip of CC2530 by the control information of a/b/c…+00000 and then analyzes whether the control information changes or not. If not, it will continue to receive the next control information. The chip of CC2530 acts in compliance with the received control information. If a high concentration of hazardous gas is indicated, CC2530 will start the ventilation system to expel hazardous gas and meanwhile, run the manure remover. Similarly, if the temperature in the chicken coops is lower than the preset value, CC2530 will initiate the heating device and meanwhile, if the humidity is lower than the preset value, CC2530 will activate the moisturization device. If both the temperature and humidity of the chicken coops are higher than the preset value, CC2530 will engage the ventilation device to ventilate the chicken coops.

V. EXPERIMENTS
The experiments in the 3 scenarios, i.e. manual manure removal, timed manure removal and excessive hazardous gas concentration, are carried out in an air-tight chicken coop model that is long as 4m, wide as 0.68m and high as 0.34. Around 4 sizes of such model there are 4 temperature and humidity surveillance spots are symmetrically arranged with 1 hazardous gas detector located in the right middle of such model. With a layer of chicken manure thick as 1cm at the bottom, such model has 3 150W heaters evenly equipped and fans with ventilation quantities of 0.01m3/s installed in the front and back. Sprayers are used to moisturize and all the water accumulated inside are drained via pipes.
The temperature and humidity of such model are initially set to 30 (35 as standard value) and 53% (65% as standard value). Following 8 minutes of operation, the system is stabilized and the interface of the host computer is shown in the Figure 8 which reveals that the tolerance of temperature and humidity is respectively  and 4% and the hazardous gas concentration is within a normal range. It is suggested by multiple experiments that the manure remover is able to respond correctly in the mode of manual and timed manure removal and start in combination with the ventilation device in case that the hazardous gas excessively builds up inside the model. As the original status of temperature and humidity as well is affected by the action of ventilation, the system will rebalance pursuant to the collected environment parameters. To sum up, this system is highly automated.

VI. CONCLUSIONS
The wireless sensor based chicken coops surveillance system introduced by this article is capable of achieving real-time monitoring and fuzzy control upon the temperature, humidity and hazardous gas concentration of chicken coops and also proved by relevant experiments to be well-controlled, operational and effective. Even without a router, the CC2530 module based wireless communication network can realize a wireless transmission distance long as 72m that is available for considerable extension by means of routers so as to suit various chick raising enterprises. This system solves the problem of underdeveloped breeding techniques, according to which the environment of chicken coops is usually controlled by a rule of thumb, thus putting weak chicks at serious risk.

AUTHORS
Lijia Xu is a professor in Sichuan Agriculture University, Ya'an, Sichuan Province, 625014,China. Her main research interests include intelligent signal processing, intelligent algorithm and fault diagnosis etc. (e-mail: liji-axu13@163.com) Xiaopei Ren is associated with the college of information and engineering technology, Sichuan agriculture university, Ya'an, Sichuan Province, 625014,China. His main research interests include agricultural electrification and automation.
Zhikun You is associated with the college of information and engineering technology, Sichuan Agriculture University, Ya'an, Sichuan Province, 625014,China. His main research interests include agricultural electrification and automation.
Sheng Wu is associated with the college of information and engineering technology, Sichuan Agriculture University, Ya'an, Sichuan Province, 625014,China. Her main research interests include agricultural electrification and automation.