Design of Intelligent Monitoring System of Chicken House Environment Based on Single-chip Microcomputer

. In view of the problem that some chicken farms are susceptible to various bacteria and viruses due to poor breeding environment, this paper designs a chicken house environmental intelligent monitoring system based on single-chip microcomputer application to improve the chicken house environment. The system adopts STC89C52 single-chip microcomputer as the main control chip. The sensor collects information on the light intensity, temperature and humidity, and carbon dioxide concentration, and controls the exhaust fan and the illumination lamp, and the environmental parameters can be displayed on the display in real time.


Introduction
With the continuous development of the society, the current aquaculture industry has also developed rapidly, and many large-scale breeding enterprises and a large number of rural farmers have emerged. In many places, a large-scale farming and one-stop industrial chain has been formed. How to improve the efficiency of enterprises, from the aquaculture industry to obtain profits, is a very concerned issue for each enterprise. In addition to good variety and reasonable nutrition, the environment in which animals grow is also very important. It is very necessary to ensure the environment for the growth and development of the adapted animals in the enclosure and improve the economic benefits through a set of monitoring programs of temperature, humidity and harmful gases.
This paper mainly studies the environment monitoring system of chicken house based on single-chip microcomputer, realizes the monitoring of temperature, humidity, illumination and air circulation. The monitored data is fed back to the monitoring personnel via the LCD. The monitoring system mainly consists of a single-chip control module, an A/D conversion module, a sensor module, an LCD display module, a buzzer alarm module, an execution module, and a power module. The single-chip microcomputer processes the signal collected by the sensor through A/D conversion and displays it on the LCD. When the concentration of carbon dioxide exceeds the limit value, the buzzer will alarm and turn on the fan. When the illumination value is lower than the set value, the light will be turned on to ensure the ecological environment in the poultry house is good.

System structure
The system uses single-chip microcomputer as the main control module of the whole system. The sensor collects the information and LCD displays the data. The system block diagram is shown in Fig. 1. In this design, the carbon dioxide sensor module is used to complete the collection of CO2 concentration, and the photosensitive module completes the collection of the light intensity. The temperature and humidity sensor module uses the DHT11 sensor to collect temperature and humidity information, and then visualizes the data through the LCD1602 liquid crystal display. The alarm module uses buzzer to alarm, and the executive module uses 5V DC fan and LED to control carbon dioxide concentration and light supply. Matrix keyboard can be used to change the limit values of various environmental factors.

Minimum system of single-chip microcomputer
The minimum system of the single-chip microcomputer mainly includes the reset circuit and the crystal oscillator circuit. The schematic diagram of the minimum system hardware composition of the single-chip microcomputer is shown in Fig. 2.

Design of photosensitive module circuit
The system uses photoresistor to collect the light intensity signal, then transfers the collected analog signal to ADC0832 to digital signal, and then transmits it back to the single-chip microcomputer. The circuit diagram of the photoresistor in this system is shown in Fig. 4.

Design of carbon dioxide detection module
The carbon dioxide detection module adopts MG811 solid electrolyte sensor. The module uses the carbon dioxide gas sensing probe to collect information, which is processed by LM393 chip and transmitted to ADC0832 to convert digital information. The entire module has five pins: Power supply positive input Vcc, TTL signal output DOUT, analog signal output AOUT, power supply negative input GND, temperature compensation output TCM. The pins required for the design are Vcc, AOUT, and GND. The voltage of the analog signal output is 0-2V. The lower the concentration of carbon dioxide gas, the higher the voltage value of the output. The circuit design of the carbon dioxide detection module is shown in Fig. 3. Connect the AOUT pin to an input pin of the ADC0832.  The temperature and humidity detection module uses the DHT11 temperature and humidity sensor, and the output signal is a digital signal. The OUT pin of the sensor can be directly connected to the single-chip microcomputer in the circuit. VCC and GND are connected to power and ground respectively. The circuit diagram is shown in Fig. 6.

Design of 4*4 matrix keyboard circuit
The setting of the limited values in this system uses the matrix keyboard of 4*4, and the circuit diagram is shown in Fig. 7. P1.0~P1.7 of single-chip microcomputer is connected with the matrix keyboard. A 1k A102J resistor is connected in the middle to protect the circuit. This resistor is also referred to as a pull-up resistor in the circuit to ensure that the single-chip microcomputer input remains high when no buttons are pressed.

Design of LCD display module circuit
The display module uses an LCD1602 liquid crystal display. The circuit diagram of the display module is shown in Fig. 8. The D0-D7 of 1602 is connected to the P0.0-P0.7 pin of the single-chip computer, and an A102J pull-up resistor is added to ensure that the D0-D7 is effective at low level and plays a role in protecting the circuit. A variable resistor is connected to the V0 pin of the LCD screen to achieve the effect of independently adjusting the backlight brightness of the LCD screen. The P2.5-P2.7 of the single-chip computer connects three control bits of RS, RW and EN on the LCD screen. The system uses an active buzzer, and the circuit diagram is shown in Fig. 9. The driving current of the active buzzer is about 25 mA. An amplifier circuit is needed to drive the buzzer. The whole alarm circuit only needs a P2.0 port of the single-chip microcomputer. Figure 9. Design of alarm module circuit

Design of execution module circuit
The execution module in this system includes a fan and a light-emitting diode, which are respectively driven by P2.2 port and P2.1 port of the single-chip microcomputer. Since the current of the I/O port of the single-chip microcomputer cannot drive the fan to rotate, it is also necessary to have an amplifying circuit to increase the current to drive the fan to rotate. The LED can be directly connected to P2.2. The circuit diagram is shown in Fig. 10. The block diagram of the system is shown in Fig. 11. After the system is powered on, the program will perform initialization work, and then the limit value can be set, after which the DHT11 read program starts executing. Since DHT11 has been subjected to the analog to digital process, it can directly read its digital quantity. The MG811 and the photoresistor output are analog quantities, so they must be input to the single-chip microcomputer after A/D conversion. The single-chip microcomputer compares all received digital quantities with the set value. When the light intensity reaches the set value, the LED will be automatically lit. When other parameters exceed the limit, the program will jump to the buzzer alarm and determine whether the carbon dioxide concentration is over-limit. If the concentration of carbon dioxide exceeds the limit, jump to the driver of the fan. If there is no value exceeding the limit, repeat the cycle program to display the collected data in real time.

.1 Test environment
Hot water bottles are used to raise the temperature around DHT11, and wet wipes are used to increase environmental humidity. The light test is covered with a thick paper bucket to test the function of the light complement. Burning a piece of paper in a sealed plastic bottle creates an environment with a high concentration of carbon dioxide. When the above-mentioned items are prepared, each function can be tested separately. Each function can be checked one by one to see if it works.

Test results
After testing each module, it is found that the system can achieve temperature and humidity detection, illumination and CO2 concentration detection. In the case of the over-limit value, the alarm and reminder can be issued at the first time, the fan can be switched on at the first time when the carbon dioxide concentration is over the limit, and the LED can change with the change of light intensity. The finished product is shown in Fig. 12.

Conclusion
Intelligent monitoring system of chicken house designed in this paper uses a variety of sensors to collect environmental information of chicken house and display the collected information in real time. When the environmental parameters change beyond the set value, the fan and LED can be automatically controlled to improve the environment of chicken house. Experiments show that the system extracts several factors which can not be lacked in the growing environment of chickens for detection, making the system more universal and suitable for monitoring in many breeding environments.