Design of Intelligent Greenhouse based on STC89C52

The growth of various crops requires specific environment. Intelligent greenhouse, can create the best external environment for the growth of all kinds of plant through regulation. In this study, intelligent greenhouse takes the single chip processor as the core, the design of temperature and humidity sensor is AM2301 of lian cheng chuang fa technology co, LTD. The system is mainly to complete the acquisition of scene temperature and humidity data; According to the actual needs of animal and plant growth to adjust litre cooling equipment, humidifying equipment, drop wet equipment and ventilation equipment, to provide the relatively controllable and even the most suitable temperature, humidity, light, water and other environmental conditions for animal and plant production, to create the most suitable small artificial environment for the growth of the plants and animals to meet the need of modern agriculture.


INTRODUCTION
Agricultural facilities (Chen et al., 2008) is through the application of modern engineering and technology for the growth of plants and animals to create the most suitable temperature, humidity, light, fertilizer and other environmental conditions, so that the growth of plants and animals can get rid of dependence on the natural environment, efficient agricultural production, it is a high-tech, high-yield, high efficiency and other characteristics, is the most dynamic new agricultural industry.
Intelligent Greenhouse (Wu, 2008) as an important form of facility agriculture to achieve, because space is relatively closed to outside climate is small, easy to control the greenhouse climate and other characteristics, widely applied.
Intelligent Greenhouse by adjusting the temperature, humidity, light, CO 2 , soil PH value, nutrition and other environmental parameters, make the environment in the most suitable for a certain crop growth status, provide a good growing environment for the growth of crops, to control crop growth cycle, improve the yield and quality of crops.
In the development of intelligent greenhouse system, it is important to choose the control structure.The reasonable control of the structure of greenhouse control system can improve the control accuracy, reliability, application flexibility.The control frame of this system adopts distributed structure, on the whole, the host computer system consisting of micro computer, lower computer by scm.So to determine the structure of the control system is the main reason there are two, one is taking into account the system's scalability.In practical applications, according to the production situation may need to be adjusted number of greenhouses, such as building a greenhouse to increase or decrease the building greenhouses.In this control system, the response to this situation, only the number of the next crew change it.Second, the compatibility of this structure is good.Whether it is the host-terminal mode, or truly distributed model, both on the hardware layout preclude the use of this distributed architecture, the system chooses this structure is convenient for system upgrading.The core controller of the control system is the macro crystal company STC89C52RC mcu.STC89C52RC is an enhanced MCS 51 kernel 8 bit microcontroller based on macro crystal technology company.STC89C52RC microcontroller has strong code encryption, strong anti-interference, low power consumption, low price, high ratio of performance to price obvious characteristics, fully satisfies the application demand.

THE DESIGN OF CONTROL SCHEME
M This study mainly regulate the greenhouse temperature and humidity, controlled object of all the temperature and humidity inside the greenhouse equipment, mainly some switching devices, such as sunroof motors, ventilation motors.The control system uses a distributed control structure, that is, from one host to manage multiple slaves, each slave can manage a greenhouse.Host (PC) (Peng, 2003) preclude the use of micro-computer, so you can take full advantage of the computing speed and storage advantages of the host; slave (the crew) preclude the use of MCU, mainly to complete the data collection and field preclude control.The core of controller is STC89C52 microcontroller in the crew, completed the main drive of temperature and humidity sensors, the controllable device driver and communication, display, on-site control etc.The system for subsequent set aside part of the interface development and design.The PC software provides man-machine interface of this system, it not only can complete the general control, also can realize the measurement data record.

THE DESIGN OF HARDWARE SYSTEMMERITS OF AGENT-ORIENTED MODELING
The main function of the lower unit is temperature and humidity measurement and site control, no need to show a complex function.Therefore, the system preclude the use of seven-segment LED (Li, 2007;Zhang and Peng, 2002) display system consisting of the next crew.Segment digital tube has a simple structure, the combination of flexible, easy to control, display characteristics of stability, more suitable for composing simple digital display system.A display part of the circuit shown in Fig. 1.
74LS164 is a serial input parallel output conversion chip, the chip used in a cascade, as shown in Fig. 1.The digital control in Fig. 1, it is common anode sevensegment LED display principle as a static display.DC0~DC5 in Fig. 1, this six light-emitting diodes, are in line with the seven-segment digital display lights work, for indicating the display contents on the display means.
Key system includes two parts, one part is the ordinary 16 key keyboard, another part is used for emergency treatment of emergency button.Mergency button connected to two external interrupts of STC89C52RC (Wang, 1999) on the application source, as long as the button is pressed it will promptly apply to the microcontroller interrupt and then get timely treatment.Key system circuit diagram shown in Fig. 2.
Figure 2, matrix keyboard using query mode, the normal work of all lines are low level, all column lines are low during normal operation, when a key is pressed, P2.2 and P2.3 lines two lines have a root line goes low, the row lines can also determine whether the change in the level of the key being pressed.S19 and S20 to manual interrupt request button.Lower computer motherboard belongs to the weak control board and greenhouse site operated equipment generally requires a 220V power supply such voltage, belonging to the electric circuit.Therefore, the output interface to be considered weak and strong electrical isolation problems.Output interface should also consider the correct transmission and power control signal amplification problem.
In this study, the weak strong electrical isolation achieved using opto TLP521-4, TLP521-4 contains four internal opt coupler.Power control signal amplification achieved preclude the use ULN2803, ULN2803 is a set of open-collector Darlington driver chip, ULN2803 contains eight sets of internal driver circuit.
Consider the output signal is more, but also to increase the protective effect on SCM, this study has expanded in the output interface part, added a programmable parallel interface chip 8155H.Access a piece of 8155H can be extended out 22 lines, all control equipment control signal from the 22 line from the root.The circuit output interface is shown in Fig. 3.
Figure 3, the 8155H of PA, PB and PC work is the basic input/output mode.Because this system is only 7 output signals, so only use 8155H PA port, according to need can be extended using the PB port, 8155H can provide a total of 16 output signals.8155HPC port used to expand the display lights with work.

THE DESIGN OF HOST COMPUTER
PC software for unified regulation of various greenhouse, display and record the data collection.The PC software of system has the ability to simultaneously manage multiple greenhouses.When managing multiple greenhouses, have equal status between the greenhouse.The main function of PC software are as follows: the greenhouse temperature and humidity control and monitoring, recording and management, the control of temperature and humidity data control formulation and execution, the fuzzy control strategy formulation and implementation strategy.In order to collect the data of the lower computer, PC software to use the computer serial port.In Delphi 7, you can use the Spcomm control.The PC software of this article is written by Delphi 7.0.

CONCLUSION
The intelligent greenhouse control system designed in this study is formed by the upper machine and lower machine.The upper machine is responsible for fuzzy control arithmetic, the command issuing, data record and display and greenhouse management; Lower machine is responsible for data collection, field device control and emergency treatment, etc.The intelligent greenhouse control system can realize the data acquisition and processing of the environment parameters such as temperature, humidity, illumination and the corresponding control can be carried out, making the intelligent greenhouse can provide a good environment for the growth of crops.The system is of low cost, reliable performance, convenient operation and has a broad market prospect.