# Development of a Wireless System to Control a Trombe Wall for Poultry Brooding
## 1 Introduction
### LoRaWAN  
LoRaWAN is a medium-access control protocol built based on the LoRa modulation and is responsible by addressing the devices in order to realize a bidirectional communication between each other. It has a star network topology that can be seen in Figure 2. Its operation consists of the broadcast of generated values from several end-nodes to central gateways (using LoRa), those which transmit that information to a server, using another protocol, which filters, corrects the data and delivers it to the application layer. As everything is bidirectional, if required, the application can answer the server, where it is ascertained from which end-node the information came in order to transfer this response to it. However, communications between end-nodes are not allowed by this protocol [12,20]. There are SF and BW values tabled along with each data rate, as seen in Table 3[21]. The maximum packet size vary with the distributed values of data rates, consequently of the SF and of the bandwidth. Thereby, the size is [22]:  
* To lower data rates (SF10, SF11 and SF12 using 125 KHz), the maximum packet size is 51 bytes. * To medium data rates (SF9 using 125 KHz), the maximum packet size is 225 bytes. \begin{table}
\begin{tabular}{c c c c} \hline
**Spreading Factor** & **Bit Rate** & **Range** & **Time on Air** \\ \hline SF10 & 980 bps & 8 km & 371 ms \\ \hline SF9 & 1760 bps & 6 km & 185 ms \\ \hline SF8 & 3125 bps & 4 km & 103 ms \\ \hline SF7 & 5470 bps & 2 km & 61 ms \\ \hline \end{tabular}
\end{table} 
Table 2: Values of an 11 byte packet for different SF. \begin{table}
\begin{tabular}{c c} \hline
**Data Rate** & **Configuration** & **bits/s** \\ \hline DR0 & SF12/125 KHz & 250 \\ \hline DR1 & SF11/125 KHz & 440 \\ \hline DR2 & SF10/125 KHz & 980 \\ \hline DR3 & SF9/125 KHz & 1760 \\ \hline DR4 & SF8/125 KHz & 3125 \\ \hline DR5 & SF7/125 KHz & 5470 \\ \hline \end{tabular}
\end{table} 
Table 3: Data Rate, Spreading Factor and Bandwidth dependence. Reprinted from Ref. [21]. Figure 2: LoRaWAN star topology. Reprinted from Ref. [12]. * To higher data rates (SF7 and SF8 using 125 KHz), the maximum packet size is 222 bytes. According to Figure 2, the topology is divided into the following elements:
* End-node: an end-node consists of a radio module and an antenna to receive/transmit data in a binary format, along with a microprocessor to process them [23]. There are three types of end-nodes [12]:
* Class A: devices that when send a message to the server open two windows in order to receive a possible response (each window is approximately 20 s [24]). These are the most efficient on an energy level. * Class B: are what class A decides; however, these also open receiving windows that can be scheduled by the user. * Class C: these devices are always waiting for a response, unless they are transmitting; therefore, they are less efficient on an energy level. * Gateway: This section works as a translator between the two network topology used. A gateway consists of a radio module and an antenna to receive/transmit data in a binary format, along with a microprocessor to process them, similar to an end-node [23]. However, these are designed to receive data from end-nodes in order to send them to a server in the Internet using another protocol (Ethernet, 3G or WiFi) and vice versa. From the same end-node, more than one gateway can receive the data. According to the literature, one only gateway can receive data from more than one end-node at different frequencies simultaneously [25]. * Server: There are a lot of servers that are willing to cooperate with LoRaWAN (LORIOT, ChirpStack and The Things Network). In this work, it is used The Things Network (TTN) that is an open-source infrastructure developed specifically to be an interface between LoRa devices and the application layer, endowed with robust encryption making it safe to use Internet of Things functions [26]. * Application: As servers, there are a lot of applications ready to be connected to a LoRaWAN network.