# Design and Implementation of an IoT-Based Smart Classroom Incubator
## 2 Materials and Methods
### Data and Network Topology  
The data collected from sensors are 10 bits. Some arithmetic formulae were used to interpret these data. The range of these values was adapted to the actual values. A smartboard computer is used as the main processor. The processors communicate with the web service in the computer using the wireless communication protocol. Data obtained from the classroom are collected with the Python Service that runs on the smartboard. The Data Collection System has three independent Python web services running on the server computer. The Python Service serially communicates with the main processor and requests instant data of the desired sensor from the processor in a certain order and sends the response to the ThingSpeak Platform with RESTAPI. This process is repeated every 20 s for each sensor. Since the dynamic speeds of the variables are low, an interval of 20 s is appropriate for receiving each data.  
Communication with NRF24L01 microcontrollers, which are used for wireless data transfer, is enabled with the SPI communication protocol. The NR24L01 communication chip has the capacity to run 6 transmitters simultaneously in a star topology. Since the number of transmitters was more than 6, a network design was made with tree topology in this study. In a tree topology, each node can have a maximum of 5 sub-nodes, which can go deep at 5 levels. This means that a network of 3125 nodes in total can be created.  
Based on the tree topology method in Figure 11, there is a master NRF24L01, three NRF24l01 nodes, and five slave NRF24L01s under each of these nodes in the system. Microcontrollers with each slave transmitter transfer the data they read at 20 s intervals to a higher node to which they are connected. All nodes transfer the data to the controller where the master NRF24l01 is located. All data collected on the master controller are sent to the main processor and transmitted to the IoT system. A structure consisting of variables, as seen in Figure 11, is designed, and the data read from the controllers are sent to the next receiver as a data package. In this structure, the variable named \"nodenumber\" was used so that the master controller could analyze which transmitter the sent data came from. This variable must be a unique number for all transmitter controllers with NRF24101.  
IoT-Based Data Monitoring  
The ThingSpeak web platform was used to monitor data simultaneously and act. As seen in Figure 12, an account is opened through the application. Four channels are created in this account. Eight fields are opened in each channel, and a total of 32 data can be displayed and recorded. The time and date when each data was received can be seen on the chart.  
With this application, an IoT analysis platform service, which enabled the collection, visualization, and analysis of live data streams in the cloud, was obtained. The application provides instant visualization of the data sent by devices. With the ability to run the MATLAB code on the website, data can be analyzed and processed online. The application communicates with connected devices and people. It usually provides sensor data to cloud storage and cloud computing resources, where data are processed and analyzed for monitoring. Many high-level IoT systems can be defined using the IoT diagram in Figure 1.  
Figure 11: Tree topology diagram.