Ubiquitous Environment Control System: An Internet-of-Things–Based Decentralized Autonomous Measurement and Control System for a Greenhouse Environment Ubiquitous Environment Control System: An Internet-of-Things–Based Decentralized Autonomous Measurement and Control System for a Greenhouse Environment

A low-cost and flexible system for environmental measurement and control in green - houses based on decentralized autonomous technics, Ubiquitous Environment Control System (UECS), was proposed in 2004. The UECS is composed of autonomous nodes as the minimum units of measurement and control. The nodes can connect with each other through Ethernet or Wi-Fi and can communicate information regardless of manufacturer or model. To realize automation and efficiency of protected horticultural production, two consortia for UECS development and extension were established. During the last 10 years, the UECS has been used to apply environment control in large-scale greenhouses and plant factories. The stability and utility of the UECS have been demonstrated and verified in these practical cultivations. Current research and development are being car ried out to install information and communication technology (ICT) systems to improve productivity in existing small- to medium-scale greenhouses in Japan. The flexibility and concept of the UECS have been very effective to enable sophisticated environmental con - trol technology to be applied to small- and medium-scale greenhouses. In this chapter, self-fabricated UECS, the renewal of old environmental control systems using the UECS, and Sub-GHz radio band use for communicating UECS nodes among distributed green houses are discussed.


Introduction
The greenhouse, which is a solar energy utilization facility, is covered with a thin transparent material, and, therefore, the greenhouse environment is greatly affected by the outside climate and solar irradiation. To control the greenhouse environment to ensure suitability for crop production, it is necessary to frequently operate facilities such as windows, heaters, and curtains. Research and development of environmental control systems intensified after low-cost computers such as minicomputers and microcomputers were invented [1,2]. Since computerized environmental control systems were still too expensive for greenhouse crop production until the 1990s, their use and development potential was limited to large-scale and well-equipped greenhouses in the USA and European. In contrast, Asian greenhouses were small-scale and ill-equipped, so installation of environmental control systems hardly progressed after this time period.
According to Moore's Law, cost-performance of computers was sharply improved, and information and communication technologies (ICT) were also improved simultaneously. As a result, autonomous distributed computing technologies such as ubiquitous computing [3,4], which use many networked computers, began to be introduced into various fields in the twenty-first century. In 2004, a decentralized autonomous system for environmental control in greenhouses was proposed in Japan [5]. In this system, the measurement and control elements of the greenhouse are divided into units, which are termed "nodes," and a low-cost computer system is allocated to each node. Because the computers in each node are networked with each other and measure and control the environment everywhere (ubique) in the greenhouse, the system was termed "Ubiquitous Environment Control System" (UECS). Figure 1 shows an example of the latest UECS-applied greenhouse.
Using a flexible node-network formation, the UECS is able to measure and control the environment in a range of facilities, from small greenhouses requiring only ventilating windows control to large-scale crop production facilities, such as plant factories, that require complex control. In addition, since the communication protocol of the UECS network is open, interconnection and interoperability are possible even for products from different manufacturers [6]. In this chapter, an overview and present research on the UECS are given in detail.

Minimum unit-node
Conventional environment control systems are controlled by a single computer and concentrate on electric signal lines from all sensors (e.g. air temperature and humidity) and actuators (e.g. heater and roof ventilator) in the greenhouse and intensively perform measurements. It is an advantage that integrated control coordination of the sensors and actuators is easy to realize in such converged systems. However, some disadvantages are pointed as follows: (1) complicated control program, (2) no extensibility, (3) high risk of whole system failure due to breakdown of only the central computer. In addition, since the specifications of electrical signal lines are often not unified, the models and manufacturers of connectable instruments to the environmental control system are limited.
In contrast, a decentralized autonomous control system for the greenhouse environment, UECS, is composed of nodes that are the minimum units. The node shown in Figure 2 has an embedded computer in one or several sensors and actuators. The computer has a communication port for networking with other nodes, and a measurement and control program for sensors and actuators.  Taking the air heating node as an example, when the node does not receive a communication message (named UECS-CCM here), the node autonomously controls the air heater using the inbuilt air temperature sensor and the control set point. At the same time, the message on the air heater operation is also transmitted to the other nodes. If the remote control message is received from another node, the operation of the air heater is determined by the content of message. If data reception is stopped for a specific period, the node returns to autonomous control. If higher priority air temperature data are received, these data are used instead of the data from the inbuilt air temperature sensor. Even if one of the sensors fails, the control of the air heater is not stopped.
A measurement and control program is installed in the embedded computer for the sensors and actuators that belong to the node. As a result, the program is simplified, its development is facilitated, and even with low performance, computer boards are available to embed. The communication protocol is standardized as described in the following sections. All the UECS nodes can connect to the network and can communicate information regardless of manufacturer or model. The UECS can be configured with a free combination of the nodes, and it has high expandability. Because of the autonomous function of the nodes, even if one node fails, the risk of stopping the entire system is relatively small.

Communication protocol and user interface
The nodes of the UECS use Ethernet (IEEE 802.3) or Wi-Fi (IEEE 802.11) to compose the communication network, and they mainly use the broadcast packets of User Datagram Protocol (UDP) to exchange messages for environmental measurement and control. Our pilot study that tested a decentralized control system using Internet protocol (IP) in a greenhouse environment showed that the major risk factors were delays and stoppages of the system due to hanging up the virtual circuit of transmission control protocol (TCP). For this reason, UDP, a connectionless communication, was employed. To eliminate the complicated installation work of associating among the nodes for data exchange, or the network server for transmission control, neither unicast nor multicast packet transmission was employed. The communication message protocol for UECS, which has been named "Common Corresponding Message" (UECS-CCM), is managed and operated by UECS consortium [7].

Figure 3
shows an example of the UECS-CCM used to exchange measurement and control data. A message written in XML is added to the specific attributes for delivering the broadcast message in the DATA tag. Timings of message transmission according to kinds of information are classified into two classes, they are periodical time intervals and occasions on demands.
All the UECS nodes employ an HTTP server to provide a user interface. Greenhouse growers and managers can monitor the latest condition of the node and set the control parameters for the facility using a Web browser interface by accessing the private IP address assigned to each node. Electrical components such as switches and indicators occupy a large share of the initial cost of measurement and control instruments. If the UECS is introduced in greenhouses, growers can manage the greenhouse environmental control system using a smartphone, tablet, or a portable game console, which have higher usability as user interfaces instead of expensive electrical components (Figure 4).

Case study on the introduction of an UECS in a greenhouse used for tomato production
As a case study of the early stage of UECS development, UECS was introduced for the environmental control of a greenhouse (floor area: 1782 m 2 ) in 2007 used for tomato production in Tokushima prefecture, Japan [6]. Overall, 16 sets of nodes from different manufacturers were connected through a LAN ( Figure 5). The environmental control algorithm working autonomously in each node has a relatively simple function. To perform complex environmental control as if integrating many nodes, a program controller node that has only a UECS-CCM communication function is necessary as a commander. The system works as a time-programmed multienvironment control system.  The decentralized autonomous and cooperating environment control of all nodes by mechanisms of the UECS-CCM functioned satisfactorily to produce quality hydroponic tomatoes. The program controller node delivered UECS-CCMs for remote operation orders and control set points, and each node worked according to these. By capturing the UECS-CCMs on the LAN with a PC and storing them in a Comma Separated Value (CSV) format file, the environmental trends in the greenhouse and behavior of each UECS node are recorded easily.  Configuration of the UECS nodes for the greenhouse used for tomato production [6].
Automation in Agriculture -Securing Food Supplies for Future Generations Figure 6 shows a chart using spreadsheet software for 1 day recorded in this manner. The dehumidification control for operation three times per day by cooperation of the air heater nodes and roof ventilator node was confirmed. If the program controller node stopped the CCM packet transmission due to failure or loss of power, all nodes returned automatically to the autonomic control state. The programmed multi-environment control system using the UECS was superior to the conventional control system in reliability.
Research and development of UECS technology in Japan are mainly being promoted by the "UECS consortium" established in 2006. Sales and installations of UECS products are handled by the "Smart-Agri Consortium," a consortium of companies that was founded in 2012.

Why DIY (do-it-yourself)?
Small-scale greenhouse (less than 0.2 ha floor area) growers were not able to relish the benefits of the costly environmental control system previously. If the greenhouse growers could produce the equipment by themselves, they could easily get what they need. With a decentralized UECS, the environmental control system can be assembled step by step, so the difficulty of do-it-yourself (DIY) installation is relatively low compared to other systems. It is unnecessary to buy a costly control device in a small greenhouse. Growers will be able to improve and repair the equipment on their own. They do not need to spend a lot of money to employ experts. Making an environmental control system themselves, they take various advantages. Traditionally growers visually observed the state of the crop and manually controlled the cultivation environment. However, humans cannot keep observing plants for days without rest. If they could easily install sensors in the greenhouse, the understanding of the crop would be much deeper. However, until now small-scale greenhouse growers have had no technology they could install independently even if there was a control method they wanted to use. DIY UECS could provide a control unit that can be programmed as desired for greenhouse growers.

Low-cost microcontroller boards opened up DIY's way
The UECS system is decentralized, and it is necessary to incorporate a microcomputer in all the equipment in the greenhouse for communication and control (Figure 7). The educational microcomputer boards are inexpensive enough to have no problem even if it is built in all the equipment in the greenhouse, it is a promising platform which is mature (seasoned) and easy to obtain.
In recent years, two kinds of educational microcomputer boards called Arduino [8] and Raspberry Pi [9] have been widely used in various fields. Arduino was developed by an Italian manufacturer in 2005. It has many variations, but the price of the Arduino UNO (basic model) is around $25. Raspberry Pi was developed later and released in 2012 and is a microcomputer board with a higher performance than Arduino. The performance is comparable to a small PC. The price is also cheap at around $35. These microcomputer boards have acquired a large number of users and have been used not only for the educational and hobby applications originally developed for but also for industrial use [10].

Software to support the development of UECS nodes
A program for mutually transmitting and receiving the UECS-CCM between nodes is necessary in order for each microcomputer board to function as the UECS node. The development of the implementation program is a difficult task even if you have programming knowledge and experience. Therefore, a library and middleware to implement the UECS-CCM were developed to enable the UECS node to be fabricated on a DIY basis.
For Arduino, the software, UARDECS, was developed in 2013, and is a library for incorporation into Arduino IDE, which is the official Arduino development tool and supports developers implementing UECS protocol and simple Web server function in Arduino. It is written in C language and requires knowledge of programming in order to use it. However, the advantage of using Arduino is that there are so many variations on the supporting device. When using Arduino UNO, you can create simple nodes with one or two sensors. When installing more devices, Arduino MEGA with a large memory load is suitable. UARDECS has already begun to be used for in university education and there are plans for it to be used in commercial greenhouses after beta testing. UARDECS will be released free of charge [11], and the development of the program will be carried out by universities, research institutes, or users with the technology. Various UECS nodes can be generated with only a few parts exchanged. According to our experience, the SD card used for Raspberry Pi needs to be a solid industrial SD card to prevent breakage due to long-term use.
Middleware for easily adapting the Raspberry Pi series to a UECS was developed by WaBit Inc., and the basic model "UECS-Pi Basic" is distributed as free software [12]. When Raspberry Pi is booted from the SD card in which the UECS-Pi is written, the Web server starts up. After that, if you access Raspberry Pi from a PC and so on, any customization can be done with using the browser-based interface. UECS-Pi is an extremely versatile tool that can be used for both sensing and control. The corresponding device is limited to those specified in the instruction manual, but its number is increasing due to version upgrades. At the time of this writing, available sensors range from temperature, humidity, CO 2 , digital pulse, analog voltage, visible light camera, and thermal imaging camera. Functions for control mounted on the UECS-Pi can turn a switch ON/OFF and change the operation of the actuator based on the conditions entered by the user. UECS-Pi can be used by people who do not have any programming knowledge.

Hosting self-made workshops for UECS node manufacture
As the groundwork for individuals to manufacture nodes for UECS has advanced, selfmade workshops for UECS nodes have been held. As an example, the workshops held at Tsukuba's Institute of Vegetable and Floriculture Science, NARO in October 2016 (Figure 8) are introduced. There were 20 participants in the workshop, mainly farmers and staff of agricultural equipment manufacturers. The node to be created was the one using UECS-Pi based on Raspberry Pi. First, a set of parts and a manual were distributed. Participants installed microcomputer boards, power supply units, sensors, and other components and made wiring. After assembling was completed (Figure 9), they turned on, accessed from PC and set up. After confirming that the manufactured node operated normally on the desk, we brought it to the greenhouse and started measuring temperature and humidity. A data log was collected the next morning, and the recorded information was discussed. While some participants misinterpreted the wiring in the middle, everyone was able to finish the node at the end. DIY brings new possibilities to horticultural production. Greenhouse growers familiar with plants may be able to create completely new, sophisticated cultivation techniques with their own hands. DIY is a powerful means for greenhouse growers to evolve horticulture with their own hands.

Upgrading traditional controllers using ICT
It is difficult to buy an environment controller with both high performance and low cost. Therefore, we tried to renew or upgrade conventional controllers using ICT. Handling of collected data will be easy using ICT. A key aspect for installing ICT into greenhouse production is the development of a controller conforming to the UECS. In this section, the advantages of renewing existing conventional controllers using ICT are discussed.

Configuration of renewed controllers
A renewed controller is composed of the conventional multienvironmental controller (base controller), microcomputer, Ethernet cable, and personal computer (Figure 10). The commercial greenhouse environmental controller "Super-mini" sold by Sankikeiso Co. Ltd. chosen as one of the base controllers has already been installed in more than 100 greenhouses in Japan. It can be connected to the UECS node implemented by a microcomputer (e.g. Raspberry Pi) with a serial communication cable. The base controller frequently measures environmental conditions such as air temperature, solar radiation, and CO 2 . All the measured data are directly transferred by the UECS-CCM to the other UECS nodes through the microcomputer. The microcomputer gives instructions for various controlling devices to the base controller after analyzing environmental data. The base controller can control connected devices using the direction of microcomputer. The HTTP server works in the microcomputer. Users must access the website using Web browser software to confirm sensor data and conditions of devices and to set parameters for environmental control.
The controller consists of three key devices. The use of a base controller is effective for the development of renewed controller speed and stability. Hardware design for environmental measurement and control operation of the base controller will be improved continuously, and it becomes robust now. Therefore, the development time and cost of hardware will be decreased. The microcomputer is necessary for controlling the ideal environment control and constructing a user interface for setting parameters for control. It therefore becomes possible to comply with a UECS using a microcomputer. A PC was used for accessing a microcomputer with a browser and monitoring information sent from the microcomputer with data collection software for UECS [13].

Case study on the development to use for strawberry production
In Okayama University, the environmental control technique for cultivating strawberry with high bed has been the subject of research for the past 10 years. The developed logic had been operated by using both the MS-DOS computer program and controller of end of sales for greenhouse in the previous system. If either this computer or the controller is broken, the developed logic could not be continued. Therefore, we renewed the controller as mentioned in the previous section. The controller named "YoshiMax" has several features as follows: (1) CO 2 concentration can be flexibly controlled with a generator of CO 2 (Figure 11). The optimum level of CO 2 concentration can be changed by controlling the air temperature inside the greenhouse. If the ventilator is open, the generator is stopped. CO 2 generator of fuel combustion type could be used for air heater. The control of CO 2 concentration becomes easy, and the CO 2 generator was used effectively by this controller.
(2) It is possible to irrigate an amount proportional to the amount of solar radiation.
(3) The convenience of the UECS can be experienced by using this controller. Monitoring the environment can be easily constructed using data logging software for a UECS. If other UECS nodes were introduced previously, the environmental information can be gathered together with that on the controller. Users can set the parameters for accessing the controller using a Web browser.
Implementation of such flexible control algorithms and acquiring detailed performance information on each measurement control instrument cannot be realized only with the conventional controller. We have demonstrated that conventional controllers updated with UECS extensions are equivalent to new installations of the latest UECS compliant controller. Now, we have tested the controller with various strawberry growers and are working on widespread use of controllers.

Renewal controller to make introduction of ICT and the UECS easier
Making controllers compliant with the UECS was useful for the easy introduction of ICT. There are two main advantages of introducing a UECS. One is the standardization of greenhouse production information. The previously developed data logging software [13] can be used for logging data, and other nodes could be managed on the same system. Another is that LAN is introduced into the greenhouse. UECS is a system that carries out environmental control using LAN. Therefore, it is easy to communicate information in the greenhouse by using the Internet and to know current greenhouse environmental status by using a network camera.
Systems that comply with an UECS can be DIY-made. Although constructing a DIY system means it can be constructed cheaply, expertise on the hardware needed is also necessary.
Modifying conventional controllers means that it is possible to develop equipment quickly without developing such hardware. Many users will prefer controllers that hate mechanical risks of hardware design and operate stably. It is considered that remodeling conventional controllers with a UECS is a useful technique for constructing a controller that operates with new logic quickly.

Limitations of a Wi-Fi network
In Japan, typical growers own several greenhouses that are distributed at a prescribed distance. Management of the greenhouses is performed individually and is therefore complicated and costly. To avoid this problem, a network infrastructure for distributed greenhouses to establish a virtual large-scale horticultural farm is required. For instance, a wireless network connecting each greenhouse would be the most effective network and has advantages such as simple installation and rearrangement of nodes, and a reduction of instillation time and cost. As mentioned in Section 2.2, the UECS has fully supported Wi-Fi network without any modification and addition of the system software and hardware in principle. However, the actual application in agriculture has several problems as follows: (1) The Wi-Fi network is a de facto standard wireless local area network. The transmission quality can suddenly drop due to radio interference between routers if a lot of Wi-Fi routers are in use near greenhouses in a residential quarter owing to radio band conflicts.
(2) Wi-Fi commonly uses 2.4 and 5 GHz radio bands in Japan. The transmission accuracy given by throughput and packet loss remarkably depends on the environmental condition in the greenhouse. In particular, the radio wave is attenuated by vegetation and humidity conditions as the plants contain much water and discharge vapor by transpiration.
Owing to the above-mentioned reasons, the application of Wi-Fi networks in agriculture is limited only to cases where each UECS node is distributed close to a Wi-Fi router. Therefore, we concluded that a Wi-Fi network is not suitable to unify a distributed greenhouse network, that is, to establish a virtual large-scale horticultural farm.

Wide-area network using Sub-GHz radio bands
Recently, various types of wireless network standards and protocols have been developed and used as a fundamental network infrastructure in our society. Among them, Low-Power Wide-Area Network (LPWAN) has features such as a long transmission distance (max 50 km), several radio frequencies (typical radio frequency is 920 MHz called Sub-GHz radio bands), low transmission rate (max 250 kbps), and several standards such as LoRa, Wi-SUN, and IM920, which have no interchangeability in general. These features agree well with the requirements to establish a network covering distributed greenhouses for constructing a virtual large-scale horticultural farm. Figure 12 shows an example of LPWAN applied for distributed greenhouses. In actual greenhouse management, growers expect to understand the current environmental information such as air temperature, humidity, and CO 2 , and the control and configuration information for facilities installed in the greenhouse anytime and anywhere. The gateway in each greenhouse is able to correct the information in the greenhouse by using UECS-CCM. Here, the original UECS-CCM is formatted using XML while the message size becomes large in general. Encoding to a transmission message based on LPWAN and decoding to UECS-CCM are required to reduce the size of the transmission message using LPWAN since the transmission rate is limited. Moreover, the transmission interval and message size are managed by the gateway in the greenhouse. The information is transferred directly to the main gateway for the Internet and is stored in the database. Therefore, the growers can review the information in all the greenhouses by using PC and mobile devices such as mobile phones, tablets, and mobile game consoles. At present, the authors are developing the prototype nodes based on this concept, for example, environmental monitoring node, data collection, and transmission node.

Conclusion and future perspective
When we proposed adopting the Internet protocol for the decentralized environmental control system for greenhouse in 2004, negative suggestions were obtained from many researchers and engineers in terms of reliability and real-time communication. However, in recent years, the term IoT has been popular, and the interest of UECS is increasing. In Japanese agriculture, facing to aging of people and farm land declines, UECS, which promotes automation and efficiency of protected horticultural production, is attracting attention as one of the important technologies for achieving safe and sustainable food production.
The improvement of greenhouse crop production in Japan is progressing in two major directions. They are (1) to construct a new large-scale and well-equipped greenhouse reflecting the types existing in Europe and the USA and (2) to install ICT systems for upgrading productivity in existing small-to medium-scale greenhouses. Our current research and development of UECS is proceeding with the aim of the latter. Therefore, issues of DIY, renewal, and wireless communication between discrete greenhouses have been the primary themes of UECS research and development, and various results have been obtained as mentioned earlier. These achievements are being adopted by greenhouses in six prefectures in Japan in the field test project "Realization of smart-agriculture by UECS platform to activate Japanese type greenhouses," which began in 2016. Upon completion of the project in 2019, the effectiveness of the UECS in agricultural greenhouses realizing low-cost and high-productivity greenhouse crop production will have been demonstrated and further spread will be expected.