The Smart Classroom is one of our bigger projects. The aim is to develop a smart system that allows us to control access to our classrooms and limit power consumption by controlling our air-conditioning and lights smartly. The system consists of a web- and mobile applications that allow us to monitor the state of the smart devices in each classroom and remotely control them. This way, buildings and grounds and other authorized staff don't have to patrol the two campuses to check for devices that are left on unnecessarily. It also limits vandalism and theft by ensuring only authorized people can enter the classrooms.
The system contains a flexible authorization and authentication system that allows us to determine users' permissions to enter classrooms and control their devices in a granular way. It allows us to define groups of users with the same permissions for selected classrooms only, so staff of a certain college can enter and control the devices in the classrooms of their college for instance. Guest users can be allowed to enter the rooms as well but not control their devices, while admins can also add users, change permissions, etc. The whole system is flexible and all permissions can be changed from the web-application. In addition to the web-application, a mobile app allows authorized users to control the devices in their classrooms as well from anywhere in the university network.
The whole system is built by university students, from the electronics to the server backend and all front-ends. It is very flexible and allows us to easily expand it with additional devices. At the moment we are working on adding our smoke detectors to the system, and add infrared sensors to detect human presence in the rooms. The latter will allow us to automatically turn devices off when no human presence has been detected for a certain amount of time, while the first obviously adds safety to the system.
Currently we are in the phase of finalizing the initial prototypes into consumer ready version, that will be implemented through both campuses for Foundation University, starting with around 50 rooms in our highschool, graduate school and dorms.
For those interested, our original project proposal and a presentation can be found on our google drive
Technical Details
The system uses MQTT for communication between the smart devices and the central control hub of each classroom. The control hub is a Pine 64 running NodeRED. It communicates with the central server through a RESTful API and MQTT. The central server runs Flask for the backend, MariaDB for the database and uses username/password and JSON Web Tokens for the authentication. The web-application is built using Angular and uses a Bootstrap theme, while the mobile application is built with Ionic. MQTT communication between the control hub and the central server, and also the RESTful API are all ssl encrypted, while the communication between the control hub and the smart devices is done through a dedicated WPA2 CCMP encrypted wifi which uses the AES altgorithm.
The microcontrollers are EPS8266 based, with both the bigger NodeMCU and smaller ESP01 variants being used. Devices that switch AC or DC electrical power (like the door lock and lights) are fused with easily replaceable fuses for safety.