Frontiers in Computing and Intelligent Systems ISSN: 2832-6024 | Vol. 11, No. 2, 2025 1 Design of Intelligent Agricultural Greenhouse System Hongze Zhang 1, 2, *, Huaxiang Pan 2 1 Guangxi Key Laboratory of Machine Vision and Intelligent Control, Wuzhou University, Wuzhou, Guangxi, China 2 School of Electronics and Information Engineering, Wuzhou University, Wuzhou, Guangxi, China * Corresponding author: Hongze Zhang Abstract: China's agricultural production is gradually transferred to greenhouses.to solve the negative factors that seriously endanger the growth of crops. So that the growth of crops is not affected by the region and climate, and the quality and total production of crops are effectively guaranteed, an intelligent and efficient management method for modern agriculture is introduced. It can maximize the efficiency of agricultural production, reduce resource waste, and provide a feasible solution for the sustainable development of intelligent agriculture through real-time monitoring and intelligent control. This paper uses an intelligent agricultural greenhouse system based on the STM32 microcomputer to realize real-time monitoring and intelligent control of the greenhouse environment. It integrates various sensors, including environmental temperature and humidity sensors, soil moisture sensors, and light intensity sensors. Through the precise control of STM32, it realizes the efficient control of the greenhouse's environmental temperature and humidity, soil moisture, and light intensity. Connected to the cloud platform through the NB-IoT communication module, users can remotely view and adjust the greenhouse environment parameters anytime. Keywords: STM32F103CT86; Photosensitive Resistance; SHT30 Temperature and Humidity Sensor; NB-IoT Communication Module. 1. Introduction The arable area in China is relatively less and insufficiently concentrated. It is also seriously affected by weather, water, and soil. In the past, China's agricultural technology was relatively backward, and the industrial level was relatively low. As a developing country, China’s agricultural development was challenging in meeting the people's basic living needs. With the development of the microcomputer, its functions are becoming more powerful. The combination of IoT technology and modern agriculture has brought intelligent agriculture into the homes of thousands of farmers. It improves the scientific and technological level of modern agriculture, the yield and efficiency of agriculture, and the quality of agricultural products. People can buy and eat at ease [1-5]. The difference between intelligent agriculture and traditional agriculture is mainly reflected in the combination of advanced science and technology and agricultural production in intelligent agriculture. It can monitor the growth of crops and the change of soil moisture, realize the scientific detection and planting of the soil environment, significantly reduce the yield reduction caused by natural disasters, and rapidly promote the continuous transformation of traditional agriculture in China [6-10]. The realization of automatic irrigation of crops has become a crucial project for the sustainable development of modern agriculture in China. Appropriate temperature and humidity play a particularly critical role in the growth of crops. The irrigation work requires a lot of staffing and material resources, and it is not easy to accurately control the amount of irrigation. Intelligent irrigation can achieve the goal of high efficiency, energy saving, and water saving. It can reduce unnecessary expenses and perform 24-hour automatic irrigation so that the soil moisture is always maintained in a suitable state for crop growth [11-15]. It saves labor costs and improves the accuracy and efficiency of irrigation. It provides stable conditions for the growth of crops, and it is of great significance in promoting the sustainable development of modern agriculture in China. 2. System Working Principle The system's circuit consists of the STM32 core development board, OLED display circuit, key circuit, sensor circuit, water pump circuit, and exhaust fan circuit. The microcomputer and sensors detect the surrounding environment's temperature, humidity, and brightness. The greenhouse's water pump or exhaust fan is driven according to the change in the surrounding environment's brightness, temperature, and humidity. The main components are the STM32F103CT86 core development board, SHT30 temperature and humidity sensor, NB-IoT communication module, OLED display, and photosensitive resistance. The humidity measurement range of the SHT30 sensor is 0% RH to 100% RH, which can widely cover the measurement requirements of different humidity environments. Its temperature measurement range is -40°C to 125°C, which can adapt to extreme temperatures. Its temperature measurement accuracy is ±0.3°C. Therefore, the error between the temperature measurement result and the actual value is minimal, which can provide more accurate temperature data. Its humidity measurement accuracy is ±2% RH, which can accurately measure the humidity of the environment. It can provide users with reliable temperature and humidity data in various application scenarios, which strongly supports accurately monitoring and controlling temperature and humidity. The intelligent agricultural greenhouse can be remotely controlled through the NB-IoT module to meet the environmental needs of crop growth. The system has low power consumption, low cost, and complete functions. Relying on advanced sensing technology, automatic control, and remote monitoring, it can realize accurate regulation of plant growth environment and improve the yield and quality of crops. The system's working principle is: (1) The photosensitive resistance collects the environmental light intensity, and the SHT30 sensor collects 2 the environmental temperature and humidity information. The sensor module sends the detected environmental data to the microcomputer. The microcomputer compares and analyzes the data to determine whether it is necessary to open the exhaust fan to cool and dehumidify the greenhouse vegetables and whether it is necessary to fill the light to realize the functions of the intelligent greenhouse. (2) After processing the sensor data, the signal is sent to the display module, and the OLED screen displays the relevant sensor information in real time. (3) The microcomputer records the humidity threshold set by the user and controls the water pump driving module. If the humidity is lower than the lower limit of the threshold, the microcomputer controls the water pump for irrigation. If the humidity is higher than the upper limit of the threshold, the water pump is controlled to stop irrigation. (4) The photosensitive resistance monitors the ambient light intensity. When the light intensity exceeds the upper limit of the threshold, the LED fill light will automatically reduce the brightness. When the ambient light intensity is lower than the lower limit of the threshold, the LED fill light will automatically increase the brightness. 3. Hardware Circuit Design 3.1. Microcomputer Control Module The system is designed based on the STM32F103CT86 core development board. The pin diagram of the STM32F103C8T6 microcomputer is shown in Figure 1. The sensor collects the environmental data of the greenhouse and sends it to the STM32 microcomputer control center. The microcomputer analyzes and processes the data and sends it to the OLED screen, which displays the relevant content. When the sensor sends the collected environmental information to the STM32 microcomputer, it compares the relevant data with the preset parameters. It sends the signals to the water pump, exhaust fan, and LED fill light according to the comparison results to perform the corresponding actions. Figure 1. STM32F103CT86 pin diagram 3.2. SHT30 Temperature and Humidity Sensor Module The functions and the connection of the SHT30's pins are as follows: (1) VIN is the power supply pin of the sensor, which needs to be connected to the 3.3V power supply of the microcomputer to ensure that the sensor obtains a stable power supply to work typically. The 3.3V power supply of the microcomputer usually has a relatively stable voltage output, which can meet the power supply requirements of the sensor and provide a guarantee for the stable operation and accurate measurement of the system. (2) GND is the grounding pin of SHT30, which needs to be connected to the grounding end of the intelligent greenhouse system to ensure that a complete circuit loop is formed between the SHT30 sensor and the intelligent greenhouse system to ensure stable transmission and correct processing of the signal. (3) The SCL pin provides synchronous clock pulses to the microcomputer to ensure synchronous communication between the SHT30 sensor and the microcomputer so that the microcomputer can accurately receive and process data from the SHT30 sensor. The clock pulse provides a stable time reference for data transmission to ensure the accuracy and integrity of the data. (4) The SDA pin transmits serial data to the STM32 microcomputer. The pin sends the data collected by the SHT30 sensor to the STM32 in serial mode. The STM32 microcomputer can obtain the measurement results of the SHT30 sensor for further processing and analysis. 3.3. Display Module The system needs to display the contents of the current temperature, humidity, light intensity, soil moisture, and control mode. The OLED display screen is adopted. It has a bright color, high contrast, fast response speed, and good display effect to provide users with an intuitive and straightforward display effect, which is conducive to the operation and management of the intelligent agricultural greenhouse system. The selected 0.96-inch OLED screen adopts the IIC communication mode. It has four pins, and their functions are as follows: (1) The VCC power supply pin in the circuit usually needs to be connected to the 3.3V power supply of the 3 microcomputer or the 5V power supply of the central control to provide a stable power supply for the related device or module. (2) The GND pin needs to be connected to the ground cable of the system power supply so that the display module maintains the same potential reference as the other modules of the system to avoid signal interference and errors caused by potential differences. (3) The SCL pin provides the timing logic for the data transmission during the I2C communication, and the pin is the I2C clock bus. (4) The SDA pin is the I2C data bus, and it undertakes the important task of data transmission with the STM32 microcomputer during the I2C communication. 3.4. Photosensitive Resistance Sensor Module The photosensitive resistance sensor has four pins, and their functions are as follows: VCC is the power supply pin, which is connected to a 3.3V or 5V power supply. The GND pin needs to be connected to the ground cable or the grounding end of the power supply. The AO pin is connected to the IN0 port of the microcomputer, which is used to output the analog signal. The DO pin outputs a digital signal of 0 or 1, where 0 represents a low-level state, and 1 represents a high-level state. 3.5. NB-IoT Communication Module The system is connected to the Aliyun platform through the NB-IoT communication module, which can convert the user's instructions received from the platform into serial port signals and send them to the microcomputer for execution. The system can also upload the greenhouse's sensor data to the Aliyun platform through the NB-IoT communication module so that the user can monitor the greenhouse's environment in real time. The pin configuration of the NB-IoT communication module is as follows: (1) The TX/RX is the UART serial communication pin, which is used to communicate with the mobile phone app. (2) The GPIO is the universal input/output pin to connect to the sensors. (3) RESET is the reset pin for resetting the NB-IoT communication module. (4) CH_PD is the power supply pin, which controls the power on and off of the NB-IoT communication module. (5) VCC / GND is the power pin, which usually needs a 5V power supply. Figure 2 shows the physical diagram of the NB-IoT communication module, and its circuit is shown in Figure 3. Figure 2. NB-IoT physical diagram. Figure 3. NB-IoT circuit. 3.6. Key Circuit The buttons used in this design have four pins, two of which are interlinked. Only one pin needs to be connected to the GPIO port, and the other can be grounded. Connecting one pin to the GPIO port can enable interaction and control with external devices or systems. The other pin is grounded, which is simple and efficient. It can meet the sensor and module connection requirements of the intelligent agricultural greenhouse system. The key circuit is shown in Figure 4: Figure 4. NB-IoT circuit. 3.7. Soil Moisture Detection Module The physical diagram of the soil moisture detection module is shown in Figure 5, and its pin functions are as follows: (1) The VCC pin is connected to the positive electrode of the 3.3V or 5V power supply to supply power to the sensor. (2) The GND pin is connected to the ground cable of the power supply or grounded. (3) The AO pin outputs the analog signal. (4) The DO pin outputs the digital signal. Figure 5. Soil moisture detection module. K1 KEY1 K2 KEY1 K1 K2 K3 KEY1 K4 KEY1 K3 K4 4 4. System Operation The system is connected to the mobile phone app through the NB-IoT communication module, and the OLED and the mobile phone app can synchronously display the greenhouse's environmental data. In automatic mode, users can set the relevant threshold through the independent keys or the mobile phone app. Users can adjust the greenhouse environment manually by opening the exhaust fan or the water pump through independent keys or the mobile phone app. In the manual mode, the user's operations can be completed by eight independent keys, and the functions of these keys are as follows: Press the first key in turn, and it will enter the threshold setting interface of temperature, humidity, light intensity percentage, and soil humidity. Double-click the first button, and it will switch between the manual and the automatic mode. The second button is used to adjust the level of the LED fill light and the light's on/off. The third button controls the on/off of the exhaust fan. The fourth button controls the start and stop of the water pump. The fifth and sixth buttons are the increase and decrease of the upper limit of the threshold. The seventh and eighth keys are the increase and decrease of the lower limit of the threshold. It will return to the main interface after pressing the first key for a long time. The system is started after the power supply is turned on. The first row of the OLED screen displays the manual or the automatic mode. The second row shows the ambient temperature. The third row shows the environmental humidity. In the fourth row, the percentage of ambient light intensity and soil moisture are alternately displayed every five seconds. The calculation formula of the percentage of ambient light intensity is: Ambient light intensity percentage = 100 ― (the output voltage of the photosensitive resistance sensor × 100 / 330). The output voltage range of the photosensitive resistance is 0V-3.3V, and the output voltage of the photoresistor will change with the ambient light intensity. The higher the ambient light intensity, the higher the output voltage of the photosensitive resistance. The lower the ambient light intensity, the lower the output voltage of the photoresistor. When the ambient light intensity reaches 3000 lumens, the output voltage of the photosensitive resistance is 3.3V, and the ambient light intensity percentage is 100 %. When the ambient light intensity is 0 lumens, the output voltage of the photoresistor is 0V, and the ambient light intensity percentage is 0 %. 5. Conclusion In this paper, an intelligent agricultural greenhouse management system based on the STM32F103CT86 core development board is designed. Through real-time monitoring of the greenhouse's environmental temperature and humidity, soil moisture, and light intensity, the comprehensive detection and intelligent adjustment of the environment in the greenhouse are realized. The real-time collection, processing, and control of greenhouse environmental data are realized. The system can automatically adjust the fan, water pump, LED fill light, and other modules to maintain the ideal growth environment of the greenhouse. The system is stable and can maintain an efficient working state during long-term operation. The system has certain flexibility and can adapt to different agricultural production needs through modular design. The user can adjust the threshold of environmental parameters through independent keys or the mobile phone app so that the user can manage the environment of greenhouses more flexibly. The system is connected to the Aliyun platform through the NB-IoT communication module to realize remote monitoring and cloud data storage. The user can remotely monitor the environmental temperature and humidity, soil moisture, light intensity, and other greenhouse environmental data anytime and anywhere through the mobile phone app. It provides great convenience for the user and improves the operability and convenience of the system. The system has more automation and intelligence than traditional agricultural management. Through real-time monitoring and the automatic adjustment of the environmental parameters, the system can accurately meet the growth needs of the plants and improve the efficiency and quality of agricultural production. Acknowledgments This work was financially supported by Guangxi Science and Technology Major Project (Grant NO. AA18118036). References [1] Shixiong Su, Chuan Li, Xinhua Ma. Design of intelligent agricultural greenhouse system based on SCM [J]. Electronic Design Engineering.2024,2(15):30-34+40. [2] Yanfeng Liu. Design of Intelligent Agricultural Greenhouse Monitoring System Based on Kalman Filter [J]. Shanxi Electronic Technology,2024,4.29-32. [3] Nuo Shi, Yucheng Wang, Lihua Ma, et al. Agricultural greenhouse data acquisition system based on IoT technology [J]. Internet of Things Technologies.2023,13(07):37-40. [4] Kai Wang, Zijie Liu. Design of Wireless Control System for Greenhouse Temperature and Humidity [J]. Process Automation Instrumentation.2021,42(12):86-89+99. [5] Hongju Zheng, Pengyu Zeng, Hao Chen. Design and implementation of intelligent integrated agricultural greenhouse based on STM32 [J]. Practical Electronics. 2024, 32 (01):106-108. [6] Chenhao Shi, Chengchuang Li, Jiaqing Yu, et al. Design of temperature and humidity acquisition and control system for agricultural greenhouse based on microcomputer [J]. Practical Electronics.2023,31(13):92-94. [7] Peng Zhang. Design and implementation of intelligent agricultural greenhouse detection system based on microcomputer [J]. Computer Knowledge and Technology. 2024, 20(09):53-56. [8] Jiantao Hu, Biaoxin Tao, Zihan Chen, et al. Design of smart agricultural greenhouse monitoring system based on STM32 [J]. Wireless Internet Science and Technology.2024,21(05):28- 31. [9] Changqing Xu. Research on the design of precision intelligent agricultural greenhouse system based on IoT [J]. World Tropical Agriculture Information,2024,7.91-92. [10] Jin Kang. Design of wireless monitoring system for temperature and humidity of farmland soil based on STM32 microcomputer [J]. Technology wind,2024,17.7-9. [11] SENSOR WORLD Total abstract [J]. Sensor World. 2022, 28 (12):46-49. [12] Qiming Cha. Design of Liquid Level Monitoring System Based on STM32 and NB-IoT [J]. Modern Information Technology. 2024,8(20):180-184. [13] Yabin Luo. Design for Compatibility of SHT11 and SHT30 [J]. Automation Application.2023,64(02):1-3. 5 [14] Thomopoulos Vasileios, Bitas Dionysios, Papastavros Kyriakos Nikos, et al. Development of an Integrated IoT-Based Greenhouse Control Three-Device Robotic System[J]. Agronomy. 2021,11(2):405-405. [15] Tekcin Meltem, Tuzer Hamzaoglu Damla Rabia, Kursun Senem, et al. Flexible humidity sensor for smart agricultural applications[J]. Flexible and Printed Electronics.2023,8(3):83- 83.