## 2 Our Proposed Context-Aware Smart Classroom Architecture
### The Smart Classroom Technology Integration Model  
The building blocks of a smart classroom are sensors and devices. Engineers need to use different kinds of ways to access multiple devices to get accurate data or perform control actions in smart classrooms. It takes complex actions to perform a simple task. A real case is to get the average in-door temperature in a smart classroom remotely. To retrieve temperature level from different sensors, such as the air conditioner, a high-level environment sensor, and a simple digital temperature sensor, different communication technologies, such as Transmission Control Protocol (TCP), User Datagram Protocol (UDP), Simple Network Management Protocol (SNMP), Telnet, Secure Shell (SSH), RS485/422/232 serial communication, Modbus serial communications protocol, need to be used. It may not be a big problem in labs of schools of engineering in the short term, but it will be a major problem for running and maintaining a campus-wide smart classroom program in the long term because the integration and maintenance cost will be very high. Therefore, in this subsection, a technology integration model based on Raspberry Pi is proposed for the ease of smart classroom construction and smart classroom application development in terms of computer technology. The four layers of the proposed technology integration model are:  
* Layer 1: The Device Integration Layer
* Layer 2: The Basic Operation Layer
* Layer 3: The Combo Operation Layer
* Layer 4: The Smart Classroom Application Layer  
The proposed model provides standard rules to access underlying technologies from the top layer remotely. The functions and definitions of each layer are explained from the bottom layer to the top layer of this model. The layering concept is shown in Figure 8; the bottom layer of the proposed model is layer 1, which is the Device Integration Layer. In this layer, the Raspberry Pi was used to implement all direct device communications, including retrieve data from devices and send control commands to devices, within the scope of a smart classroom. Communication procedures between interfaces and protocols, such as TCP/UDP, Inter-Integrated Circuit (I\({}^{2}\)C), Serial Peripheral Interface (SPI), General Purpose Input Output (GPIO), RS422/485/232, Modbus, Bluetooth Low Energy (BLE),  
Figure 7: Information board can provide rich classroom context information and interactive functions: In part (**a**) of this figure, the board shows information including time, weather, class, CO\({}_{2}\) level, PM 2.5 level, indoor temperature, and humidity in portion a. Users can get dynamic classroom schedule, which is shown in part (**b**), by pressing button b. The functions of button c, d, e, f, g are ‘Smart classroom introduction’, ‘launch a AI chatbot’, ‘Skype call to the security guards’, ‘Skype call to the IT services’, ‘Show welcome message’RFID, and ZigBee, should be implemented on the Raspberry Pi in this layer. All programming languages supported by Raspbian can be used to implement the communication procedures. The second layer of this model is the Basic Operation Layer. As shown in Figure 8, in this layer, the basic operations of a smart classroom were defined. All the defined operations were implemented as web service calls with Python [37] and Flask [38] on Raspberry Pi boards. When a basic smart classroom operation, such as turning off the air conditioner, is called through the web service call, the underlying control commands to the devices related to the operation will be invoked by the corresponding Flask route. With this layer, all direct device communications in layer 1 are hidden from users and applications. By sending HTTP requests, users and application can perform basic smart classroom operations defined in this layer. In the third layer, which is the Combo Operation Layer, basic operations are combined to form a combo operation. As shown in Figure 8, operations involved in executing more than one basic operation, which is defined in layer 2, should be defined and implemented in this layer.