## 1 Introduction  
Agriculture is dependent on the weather and climate. To moderate the variability of these factors, crops can be grown in greenhouses that shelter the plants from natural disasters such as typhoons, heavy rain, or drought. The development of Information and Communication Technologies (ICTs) helps us to accurately monitor the indoor planting environment. Many studies have applied ICTs to create a better plant growth environment by changing cultivation procedures. Some studies capture real-time data from the soil using sensors that are linked to stand-alone programs or a database. The captured data include soil moisture [1; 2; 3], pH, or the quantity of microelements [4; 5; 6]. To improve the growing environment for crops, some experiments have controlled the day-lengths for specific plants [7; 8; 9; 10; 11]. Other research has applied wireless communication devices to reduce the disturbance caused by the communication wires [12; 13]. Water is one of the critical factors affecting crop growth. Crops grow slowly if the water supply is too low, but too much water will rot their roots. Traditional farming practices cannot precisely control the volume of irrigation. Many studies have investigated effective automatic irrigation mechanisms. [PERSON] et al. proposed an irrigation water distribution model based on the genetic backtracking search algorithm to maintain a uniform flow rate of water [14]. This approach optimized irrigation by reducing water waste and minimizing the water distribution time. The Internet of Things-based Wetting Front Detector (IoT-WFD) is another irrigation management system designed for cash crops with root layers at different levels in northern Thailand [15]. IoT-WFD contains a component to capture the moisture value from the different root layers to control the soil moisture in a cultivated field precisely and to increase productivity. Collecting real-time data is also useful for managing irrigation. [PERSON] et al. used LoRa (Long Range) [16], a wireless radio frequency transceiver, to established real-time data communication. The sensors were installed in the cultivated field to collect real-time information [17]. When the soil moisture fell below a predefined threshold, their system triggered irrigation via wireless communication. [PERSON] et al. also used LoRa wireless communication technology to collect soil moisture data from a vineyard and store it on a cloud server [18]. They designed web apps to visualize moisture information. Each vine could receive up to 25 L of water every 12 h from a drip irrigation system. [PERSON] et al. [13] and [PERSON] et al. [19] applied a similar mechanism to automate irrigation, fertilization, and harvesting. The above studies continuously sample soil information by placing the sensors in the soil. However, the probes of the lower-cost sensor products measure how strongly the soil resists the flow of electricity between two electrodes to determine the soil moisture content. The metal probes of these sensors corrode over time, which increases the probability of heavy metal contamination and means they need frequent replacement. Therefore, [PERSON] et al. investigated the use of image processing technology to identify the moisture level of the soil [20]. They collected aerial photographs with drones and analyzed the photographs with image recognition algorithms to recognize whether the water was uniformly distributed. [PERSON] et al. proposed an irrigation control system based on a water movement model [21]. This system starts irrigation based on the model, which determines the maximum input flow and the water content levels in the soil. [PERSON] et al. proposed a similar method by integrating a solar power system into an irrigation system [22]. They used image processing technology to identify when the leaves of the crops began to yellow as the clue to decide the irrigation time. However, none of these irrigation systems precisely control the watering volume. [PERSON] et al.