Greenhouse environmental testing system program

1 Introduction

This article refers to the address: http://

The greenhouse, also known as the greenhouse, cultivates plants in a greenhouse with constant environmental parameters, which can provide a more suitable growth environment for plants. The greenhouse includes planting tanks, water supply systems, temperature control systems, auxiliary lighting systems, humidity control systems, and the like. To achieve the regulation of physical and chemical indicators such as temperature and humidity, we must first obtain the physical and chemical indicators of the current environment. Therefore, the sampling module of each physical and chemical index parameter of the environment can be placed at each distribution point in the greenhouse, and the switch of the external device is controlled by the relay according to the current physical and chemical index parameters and the preset threshold values ​​of the physical and chemical indicators. The greenhouse can maintain a constant physical and chemical indicators such as soil temperature and humidity, air temperature and humidity, carbon dioxide concentration, and light intensity.

2. Introduction to ATxmega128A1

The ATxmega128A1 is an 8-bit AVR microprocessor with enhanced performance. It has 128KB of flash memory and operates at 1.6~3.6V. It is the only flash microprocessor that uses 1.6V to operate. It has ultra-low power consumption and rich on-chip resources: 4 analog comparators, 4 channel DMA controllers, 8-channel event system, 4 SPI interfaces, 4 I2C ports, 8 16-bit timer/counters, 2 16-channel 12-bit A/D converters, 2 2-channel 12-bit D/A converters, 1 AES Encryption engine, 1 RTC, all of the above resources do not use CPU resources, which can maximize system performance and reduce power consumption, up to 32MI / s processing performance. Due to its rich on-chip resources, the peripheral circuits are greatly simplified, and the stability, security and reliability of the system are improved.

3. Overall system design

The greenhouse environmental detector designed in this paper is required to sample the air temperature and humidity, soil temperature and humidity, air carbon dioxide concentration and light intensity in the greenhouse, and display the environmental parameters of each monitoring point on the LCD screen. The design block diagram is shown in Figure 1. Show.

Figure 1 Overall block diagram of the system design

Each sensor module converts the measured non-electricity into a measurable voltage value or data. The ATxmega128A1 microcontroller communicates with each sensor according to the data transmission protocol of each sensor, obtains the environmental parameters detected by each sensor, and transmits the environmental parameters to the storage. Data processing is carried out, and finally the physical and chemical index parameters of the current greenhouse environment are obtained.

The greenhouse environmental detector uses a low-power microcontroller ATxmega128A1, a sensor module, and a low-power device, so the greenhouse environmental detector has low power consumption. In addition, the sensor module has good static characteristics such as linearity, sensitivity, hysteresis, repeatability, and drift, and can be used in various greenhouse applications. The temperature and humidity sensor has the characteristics of fast transient response, so that the greenhouse environmental detector can detect the change of the greenhouse environmental parameter in time and adjust it to the control circuit for adjustment, so as to stabilize the greenhouse environment and maintain the growth of the crop. The most suitable environmental parameters.

4. System hardware circuit design

The system hardware circuit is composed of ATxmega128A1 minimum system, soil temperature and humidity sensor module circuit, air temperature and humidity sensor module circuit, air carbon dioxide concentration sensor module circuit, light intensity sensor module circuit, button display module circuit, alarm module circuit and system power module circuit.

4.1 Soil temperature and humidity sensor module

The SLHT5 soil temperature and humidity sampling module is used to measure the temperature and relative humidity of the soil. The hardware interface circuit is shown in Figure 2(a). The sensor module integrates the sensing element with the signal processing circuit to output a fully calibrated digital signal. The sensor includes a capacitive polymer moisture sensing component, a temperature measuring component made of a gap material, and a 14-bit A/D converter and serial interface circuit integrated in the module, which has ultra-fast response and strong anti-interference ability. And the high cost performance and other advantages.

4.2 Air Temperature and Humidity Sensor Module

The SHT75 air temperature and humidity sampling module is used to measure the temperature and relative humidity of the air. The hardware interface circuit is shown in Figure 2(b). The module contains a temperature and humidity sensor with a calibrated digital signal output. It consists of a capacitive polymer moisture sensor and a bandgap temperature sensor, and is seamlessly connected to the same module as a 14-bit A/D converter and serial interface circuit. Its structure is roughly the same as that of the soil temperature and humidity sensor module circuit, but the application of the two modules is different.

Figure 2 Module circuit of each sensor

4.3 Air Carbon Dioxide Concentration Sensor Module

The MG811 carbon dioxide sensing probe is used as the sensitive component, and its hardware interface circuit is shown in Figure 2(c). The module can set the threshold. When the environmental parameter exceeds the threshold, the DOUT pin outputs a low level. The module can also output analog voltage on the AOUT pin, and the current air carbon dioxide concentration parameter can be known by looking up the table according to the voltage. The measurement range is 0~10000ppm.

The MG811 carbon dioxide sensor has the advantages of high sensitivity, good selectivity, long service life and good stability. The module has a temperature compensation output inside. When the ambient temperature changes, the output voltage signal changes, and the temperature change amount is converted into the corresponding voltage output change amount, so that the temperature change amount is compensated by the program, so that the probe can be detected more effectively.

4.4 Light intensity sensor module

The BH1750 light intensity sampling module is used to measure the light intensity. The hardware interface circuit is shown in Figure 2(d). The spectral range of the module is similar to that of the human eye, and it has little dependence on the light source. It has a wide measuring range (1~65535 lux) and high decomposition. The internal logic input interface with 1.8V voltage, illuminance digitizer, and I2C bus interface enable real-time illumination intensity sampling without any external components.

4.5 Keyboard display, alarm, power module The keyboard and display module is the module for information exchange between the user and the greenhouse environment detector. The keyboard is composed of multiple buttons. The display circuit uses the Nokia5110 liquid crystal display module, and the alarm circuit is composed of LED, triode, and bee. The sounder is composed, and its hardware circuit is shown in Figure 3. The power module uses a voltage regulator chip to convert the battery voltage into the required power supply voltage. The hardware circuit is shown in Figure 4.

Figure 3 buzzer alarm circuit

Figure 4 power module circuit

5. System software design

The software design of the greenhouse environmental detector mainly includes the key scan design, the design of the Nokia 5110 display program, and the I2C communication interface design. The overall process of system software design is shown in Figure 5.

Figure 5 system software design flow chart

After the data is successfully sampled, it is processed and sent to the liquid crystal display. Then it is judged whether it deviates from the preset threshold. If there is no deviation, the sampling will continue. If it deviates, the external equipment such as water supply, temperature control, lighting, humidity control and other systems can be controlled to perform appropriate regulation. Until the sampled data returns to within the threshold, the purpose of the test is achieved, thereby maintaining the stability of the greenhouse environmental parameters.

6 Conclusion

There are many physical and chemical indicators for the control of the greenhouse environment. In order to realize the automatic control of these physical and chemical indicators and integrate multiple physical and chemical indicators, the greenhouse environmental detector using single-chip microcomputer and sensor first samples the greenhouse environmental parameters, and then according to the settings. Whether the threshold value is exceeded or too low, so as to control the switch of the external device, balance the physical and chemical index parameters of the greenhouse, and maintain the greenhouse environmental parameters. After experimental verification, the design meets the requirements for greenhouse environmental parameter detection.

Guangzhou Ehang Electronic Co., Ltd. , https://www.ehangmobile.com