Meezaj: An Interactive System for Real-Time Mood Measurement and Reflection based on Internet of Things

Subjective well-being has a critical affect on progress and productivity vital for digital and strategical transformation. Increase in the suicide attempts of the college and university students is a clear indication of stress and anxiety among the students. Offering a fulfilling and healthy life to promote the life-long learning journey is also one of the important objectives of the Vision 2030 for modernization of the Kingdom of Saudi Arabia. Due to the multifaceted nature of subjective wellbeing, real-time mood measurement and reflection is a challenging task and demands using latest technologies. This paper aims to present Meezaj, an interactive system for real-time mood measurement and reflection leveraging the Internet of Things (IoT) technology. Architecture and workflow of the Meezaj system are discussed in detail. Meezaj not only promotes the sense of significance in the students, by indicating that their happiness matters in decision making, but also assists policy makers to identify factors affecting the happiness in an educational institute. Keywords—Subject well-being; happiness; IoT; Arduino; Vision 2030


I. INTRODUCTION
Mental health contributes significantly in our perception about the world and how we react to it. Subjective wellbeing is considered to reflect the mental state of the people by exploring their experiences and state of mind about the life [1]. Although, subjective well-being investigation is affected by multiple parameters but is generally based on considering the emotional intelligence through measuring the positive and negative feelings [2]. Positive feelings are mainly reflected by happiness, pleasure, and joy while negative feelings are often reflected by stress, sadness, and angriness. Studies like [3], [4], [5], [6] and the research evidences provide by social psychologist D.G. Myers [7] suggest that happy people live longer, are more susceptible to engage in social interaction and undertake difficult tasks, are more willing to donate and help others, and are more open to new ideas.
The urge to find the most profound technologies for pervasive computing as visioned by Mark Weiser in 1988 has led to the emergence of intelligent integration of the physical and virtual objects and devices. The term Internet of Things (IoT) refers to the network of inter-connected heterogeneous things with the ability of data collection and exchange. Things may include portable personal objects like digital camera, smartphone, small sensors widespread in our surroundings like temperature sensor, or the large objects we interact with in our routine lives like smart TV, cars, buses, and trains [8], [9]. IoT technologies has revolutionized the measuring, monitoring, and controlling in almost all the aspects of human life. As reviewed by Suwimon and Sucha in [10], overall supply chain management process has been significantly improved by the use of RFID tags and communication infrastructure, crowd sourcing and participatory sensing is facilitating in finding parking and monitoring the overall health of vehicles in transportation, and ensuring assess to the healthcare in rural areas through integrating the devices and transmitting health data through smartphone has been possible due the exposure of the IoT technologies.
Due to the multi-faceted nature of subjective well-being, mood measurement and reflection in an institutional setting is a challenging task. Measures that are based on subjective input like Experience Sampling Method (ESM) and Day Reconstruction Method (DRM) are affected by personal bias and take a lot of work from the participant where they have to walk around with a beeper and papers to write down their input [11], [12]. Great deal of time and effort is then required to go through all of what the participants wrote. Measures that are based on objective input like physical activity, amount of sleep, and social interactions present the challenge of data collection (as the participants must use wearable devices) and the complexity of the data. Equally important as measurement, real-time reflection of the mood is essential for timely adjustment in the rule and regulations negatively affecting the mood of the employees or the students. Large amount and heterogeneity of the data hampers the real-time reflection of the mood. Another dimension of the mood reflection challenge is personalization of the working environment to maximize happiness among the individuals.
To cope with the above mentioned mood measurement and reflection challenges, this paper presents an interactive system named Meezaj (Arabic word of mood) to measure and reflect the mood of a community in an institutional setting. Meezaj Mobile App continuously collects responses to a short (and optionally long) mood surveys in specific durations of time. Questions for the long surveys are based on the Experience Sampling Method (ESM) approach. The data collected in terms of responses to the mood survey is then analyzed in real-time and mood of the participants is projected through the Meezaj Mood Reflector. Meezaj mood reflector is a IoT based custom (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 11, 2020 designed sculpture which not only aesthetically signifies the respective institute but can also interact with the other entities in the environment for personalization. The system is also equipped with a Meezaj Web App for detailed reports and administration tasks.
The next section describes need and background of this study. Section III presents a summary of the important existing applications for mood measurement along with their comparison. Section IV describes the proposed Meezaj system in detail for real-time mood measurement and refection. The architecture and workflow of the Meezaj system is specified with important algorithms. Section V concludes this paper with a glimpse of important future works.

II. BACKGROUND
Kingdom of Saudi Arabia is going through a strategic and digital transformation for thriving knowledge-based economy. Offering a fulfilling and healthy life through healthcare transformation and promoting the life-long learning journey through educational transformation are two main objectives of this transformation under the umbrella of Vision 2030 [13]. Realization of such multifaceted transformation is quite challenging and demands for highly coordinated multidisciplinary efforts. The successful modernization of the existing infrastructure also requires to exploit modern information and communication technologies to measure, monitor, and reflect the effects and outcomes of policy updates. For example, in relation with health and education, it is essential to investigate that how the transformation of the learning paradigms (from traditional to blended to complete virtual) will affect the happiness and satisfaction of the students.
Increase in the suicide attempts of the college and university students is alarming. In United States alone almost 24,000 students attempt suicides annually [14]. Although not to that extant, but studies like [15], [16], [17], [18] have clearly indicated the signs of stress, and anxiety among the university students in Saudi Arabia as well. Traditionally, long paper-based surveys are conducted for subjective or objective input collection to investigate students' concerns about the infrastructure, curriculum, and educational paradigms. These surveys not only suffer with low response rate but also require considerable time and effort for data compilation and analysis. So for the middle and top management, timely response to a recent policy change may not be reflected in time. As a result, real-time mood measurement and reflection of the students and other stakeholders (faculty members, and the admin) is almost impossible with this paper-based approach.
According to Ministry of Communications and Information Technology (https://www.mcit.gov.sa/), with 188 registered mobile phones for every 100 Saudis, the Kingdom has the highest number of mobile users in the world. Equipped with various sensors, mobile devices also present the idea that survey participants don't have to carry any extra equipment for common mood measurement through ESM and DRM. These sensors can replace wearable devices for the objective input, which can drastically decrease the amount of resources needed [19]. Along with the mobiles phones, IoT being a convergence of multiple technologies, has also been successfully applied to different sectors of the society and has already shown promising results.
To realize real-time mood measurement and reflection, and to facilitate communication and data exchange among multidimensional stakeholders, we present an interactive system leveraging the mobile phone and IoT technologies. Our proposed Meezaj mobile app interacts with students to get their feeling in specific periods of time and analyzes the results to provide the true picture of mood to the middlelevel (HoD, Dean) and top-level managements (Directors). Since students' mood is important to achieve the best abilities, skills and results, we seek to interact with their environment to improve the mood. Meezaj also supports interaction with several entities in the environment through IoT (hardware and software infrastructure) to maximise students' happiness. Meezaj provides automatic report generation for both individuals and the administration.
Although, Meezaj is targeting students, faculty members, and the admin staff in a typical University setting but due to it's scalable design, the system can easily be applied to other institutes like Banks, Airport, etc. by adjusting with their business rules.

III. EXISTING APPLICATIONS
This section presents a summary of the most commonly used existing applications directly providing the mood measurement at institutional and personal level. Existing applications are also compared based on the features being offered to the perspective users. a) Emooter: Equipped with web and mobile apps, Emooter facilitates team members to know work-related wellbeing [20]. Team members do the brainstorming to set wellbeing baseline and the feedback is provided on individual basis. b) Culture Amp: To promote a healthy company culture, Culture Amp engages the employees by inquiring about their problems and helping HR in decision making [21]. Available is both web and mobile apps, the feedback tools cover entire employment life cycle; starting from the new hire surveys, onboarding, employee engagement surveys, singlequestion polls, and exit interviews. c) Roundpegg: Recently acquired by the Achievers, Roundpegg, like Culture Amp, has a culture-first approach [22]. Employees are hired by assessing their fitness for an already defined "CultureDNA". Periodic customized surveys are conducted to know employees' feelings about their life at the company. d) TINYPulse: Derived with several products for employees' feedback and performance management, TinyPulse conducts weekly surveys to know the pulse of the company [23]. To collect ideas, it also provides "Virtual Suggestions". Good work of the employees is acknowledged through "Cheers of Peers" approach. e) MercuryApp: MrucuryApp, fetches employees' feelings from their responses to the daily reminder emails [24]. MercuryApp is considered a good fit for agile practitioners. To log their opinions a daily reminder feedback on the project is collected on daily basis.  [25]. Users tap in the respective color quadrant to reflect their mood. They can provide a reason, and then can select strategy to improve their mood. g) Celpax: Celpax requires employees of a particular company to press green or red button on a specially designed device to express their feelings at the end of the day [26]. An extensive online dashboard is provided for periodic results. h) Peakon: Peakon helps the management to drive measurable improvements with regular surveys, real-time insights, and collaborative action planning [27]. Supporting multiple languages, Peakon can engage large number of employees to collect their feedback through the web, mobile app, kiosk, and regular SMS. i) Bluepulse: Managed under the umbrella of Explorance, Bluepulse is employee experience management software built from the ground up to investigate employees engament through surveys [28]. Bluepulse can easily be integrated with other related platforms for HR to enhance automation for rich insights. j) BambooHR: BambooHR is administrated as a web application for providing complete HR solutions [29]. Employees engagement and moods are measured using surveys to set focus on what matters most for the human assets of the company. k) Heartcount: Powered with AI algorithms, Heartcounts measures employees happiness by tracking their person progress, and relationship with the peers [30]. Immediate feedback is shared with the concerned authorities to improve decision making thus bringing the entire ecosystem together. Table I presents comparison of the existing applications. It is clear that most of these applications target companies. They can collect user input, present the result to the management, and analyze the results to give some guidelines. Most of the existing solutions are provided in English language and are focused on encouraging the improvements in the business policies to increase the happiness of their employees. Some of the solutions are web-based only while others can also be worked on using mobiles phones.
In the context of measuring mood of the students in education institutes in Saudi Arabia, an application with Arabic interface is required. Furthermore, existing applications still require to wonder around several screens with heterogeneous data to understand mood of the participants, which is again time consuming. Due to the stand alone nature of the existing application, none of them provides interaction with other smart devices in environment for change to enhance positive feelings. Our proposed Meezaj system supports both English and Arabic rather than only English giving us a wider client base in Saudi Arabia. Using IoT technology, Meezaj can interact with other smart devices in the environment for customization to maximize the happiness of the people engaged that particular area. To appeal the sense of urgency, the results are displayed at prominent places within the company through customdesigned sculptures.

IV. MEEZAJ SYSTEM
This section presents architecture and workflow of the Meezaj system developed for mood measurement and reflection. Meezaj measures the mood in a specific institutional setting by collecting data in terms of responses to mood surveys. The participants are notified on Android based smart phones to answer short or long survey periodically. Survey responses are then analyzed in real-time and the emotions of participants are reflected on a custom designed RGB LEDbased sculpture. If most of the people are feeling happy, the sculpture glows yellow, but when they are sad, the sculpture will glow blue. The sculpture will glow red if most of the people are feeling angry.

A. Architecture
As depicted in Fig. 1, Meezaj system architecture is structured in three layers: User Interaction, Application Logic, and IoT Platform. 1) User interaction layer: User interaction layer contains the interface and presentation logic. User's visual experience is enhanced using the latest technologies for both web and the mobile apps. Developed using Bootstrap technology, the web interface provides visually appealing screens for all the required features to perform Create, Read, Update, Delete (CRUD) operations. Required reports are enriched with inforgraphics for detailed description and for improving understanding. Responsive design methodology has been followed to improve the visibility on small screens. 2) Application logic layer: Application logic layer consists of the following two main components: • Meezaj Web App: Each registered institute is provided a unique code to be used by the students and employees of the for registration. The registered institutes can then perform all the required administration activities; like creating or updating detailed surveys by adding or removing questions, and activation or deactivation of the user accounts after login to Meezaj web app at https://meezaj.net/. Users activated with Institute Manager role can analyze the survey results for further insights.
• Meezaj Mobile App: To engage users for mood measurement an Android mobile app is developed using Android Studio and is available at the Google Play store. Upon installation, Meezaj mobile app requires user registration and respective institute code provided by the manager. Users can set the language to either English or Arabic. Meezaj app notifies users about the mood survey consisted of one question, "How to do feel" with three specially designed icons for happy, sad, and angry (see Fig. 2a). The user can press the icon to record in mood. After tenth response, users start getting individual mood report in the form of a pie graph (see Fig. 2b). User can also participate in long mood survey by keep pressing any particular icon for couple of seconds. Although, Meezaj as already provided sample questions for long surveys based on the Experience Sampling Method (ESM) approach but the institute managers can add/remove questions for customized surveys.
3) IoT platform layer: Sitting at the bottom, this layer defines basis of the hardware configuration used to control display of the sculpture and communication logic with other smart device in the environment. Hardware configuration consists of Arduino MKR1000 controller board and the required circuitry for RGB LED-based sculpture. MKR1000 board has been selected due to low cost and WiFi connectivity [31]. Although, Arduino boards are easy to configure for programming but MKR1000 requires some extra libraries to be installed for correct configuration. As a unique IP address is assigned to particular MKR1000 board, it is now a uniquely identified "thing" over the internet and can communicate with other things and computing platforms.
For communication, POST method of the HTTP protocol is used to communication with Meezaj web server by assessing the respective web application (https://meezaj.net/). As every MKR1000 WiFi board has a unique MAC address, so after a certain period of time (set through Admin panel) it connects with available WiFi and sends MAC address and recives the mood values form the Meezaj web server. Upon receiving the calculated mood values, the controller then sets the color values for the RGB LEDs to glow is appropriate colors to reflect the mood of the institute.

B. Workflow
This section presents the workflow of the Meezaj system. In a typical university setting Meezaj supports three types of roles: • Users can be students, faculty members, or any member of the institutes work force. They are the ones going to respond to the mood surveys and their mood will be reflected. They can also check their mood history.
• Institute Manager is a member of middle management within the institute responsible for the providing the institute codes to the students, customizing the long mood surveys, setting the periodic mood notification timings, and analyzing the mood data.
• System Administrator: are members of the Meejaz team responsible for the system and its services. With privileges viewing the analyzed mood data, they can arrange discussions with the institute managers to discuss patterns and abnormal spikes in the data.
As depicted in Fig. 3, mood measurement and reflection through Meezaj system is composed of six steps described below.
1) Mood survey notification: After registration, the users get a mood survey notification after a certain period of time, set by the institute manager through admin panel on Meezaj web app. Answering a survey is one of the most important features of the Meezaj system giving that it is currently the only way 2) Survey response: Users can tap the mood survey notification to open Meezaj mobile app. The respective screen has three icons as shown in Fig. 2a, wherein, yellow icon with happy face is used for happiness, blue icon is for sadness, and the red icon is used to represent the angriness. Users can press appropriate icon to express their feelings. This short mood survey is specially designed to improve user response time and interest. A really simple and short survey (with only one question and three possible choices) is also one of the unique features of our Meezaj system for happiness measurement and is based on our own experience and reviews of the existing applications. Users get frustrated very often while answering multiple questions. This not only affects the response ratio (as explained in [32] for surveys in general) but may also produce invalid results in case of happiness measurement. For example, the user was feeling happy when the survey notification was received but gets frustrated while answering the long mood survey. So the short mood survey facilitates getting the immediate feelings accurately.
To investigate the reasons for the immediate feelings, users can also provide the details (through long mood survey) by long-pressing the appropriate icon. Meezaj mobile app then leads to the screen with multiple questions to know the reasons of the current feelings. Although, we have already provided sample questions based on theoretical foundations of the ESM approach but institute managers can customizing this question set by rephrasing, adding and removing possible answers, and by adding or deleting a complete question. Response to the long mood surveys directly indicate the reasons of the immediate feelings. Later patterns can be identified using Natural Language Processing (NLP) techniques and the related policies can be updated to maximize the happiness of the students.
Users of the Meezaj mobile app are also asked for permission to share their location information. Upon submitting response for a short or long survey, GPS location of the respondent is also exchange with the web sever. This information can further assist in identifying the happy, sad, or angry spots within the campus. As shown in step 5 of Fig. 3, other IoT devices in that particular spot can then be engaged to customize the environment for positive change. For example, the light can be adjusted in a close environment and a fountain (if present) can be turn on for the change in the environment.
3) Mood data submission: Appropriate relational schema is defined for each institute's data storage. Meezaj facilitates role-based user management module is implemented to realize data protection. Successful data modeling not only establishes administration of acquisition and storage but also ensures the reliability, and timeliness of the data for relevant users.
Algorithm 1 specifies important steps followed for survey data submission to the web server. It requires response to a survey with unique identification Surv Id issued to a respondent Resp Id in an institute with institute code Inst Code. The algorithm then ensures that all the respective relations are updated accordingly. In case of a short survey (with one questions and three possible answers), a new record is added to the Survey relation with mood values (happy, sad, or angry) using Surv Id.mood value, Resp Id, and Inst Code.
For long surveys after updating the Survey relation, every question in the question set for a particular survey is explored for the answer and questions.answer value is added to the Detailed Survey relation.

4) Dynamic reporting:
Along with their growth, institute are also looking for improving their operational performance. Efficient reporting, with right data at the right time, for wellinformed decision making is decisive for any technological application. Meezaj also provides a feature-rich module for managing dynamic reporting. Complex ideas of subjective assessment are realized with infographics to improve understandability of the important data. Individual mood reports are automatically generated and shared with the respondents after each survey response (as shown in Fig. 2b). With details provided as responses to the long the mood surveys, Meezaj also provides an opportunity to identify mood patterns in relation with the people, activities, and places. Users can then easily identify the personalities, places, and activities that make them happy and can try to engage with them more often.
At the institute level dynamic reports can be generated with a user-friendly interface. Institute's mood spikes can further assist to recognize the reasons and update the institutional policies accordingly. for all question ∈ Surv Id.Questions do 8: update Detailed Survey relation with question.answer value 9: end for 10: end if IoT hardware configurations in the Meezaj system [31]. It is based on Amtel ATSAMW25 SoC (System on Chip) which is specifically designed for IoT projects and devices. MKR1000 board also contains a Li-Po charging circuit enabling it to run on battery. Switching from external 5V to Li-Po battery is maintained without any degradation.

5) IoT communication
For programming, Arduino MKR1000 board requires WiFi101 library allowing WiFi shield to connect the available WiFi connection and further communication. This library supports crypto-authentication and allows the board to be configured as a server-accepting multiple client connections or as a client-sending requests to the server [31]. The library also supports both WEP and WPA2 Personal encryption methods.
Another reason for selecting Arduino MKR1000 board is its ability to support different M2M communication protocols. In Meezaj, we have used it for HTTP communication but it can easily be configured as publisher and subscriber with an MQTT broker. This allows it to communicate with other IoT devices in the environment for customization and then maximizing the happiness of the students. 6) Mood reflection: Mood reflection is an important final step of the Meezaj system workflow. The data collected in terms of responses to the (short and long) mood surveys is analyzed in real-time and emotions of the participants are reflected on a custom designed MKR1000 and RGB LEDbased sculpture. If most of the people are feeling happy, it will glows yellow, but when they are fearful, the sculpture will glow blue. The sculpture will glow red if most of the people are feeling angry.
Algorithm 2 presents the mood reflection logic based on the MAC address of the MKR1000 connected to the custom RGB LED-base sculpture and the update period parameter set by the institute manger through Admin panel on Meezaj web app. Fist of all, in the setup() method of the Arduino sketch, programming logic is specified to connect respective MKR1000 with MAC address to the available WiFi network. An instance client of the WiFiClient class, present in the included WiFi101 library, is created. Because of the IP address assigned to MKR1000 WiFi shield with respective MAC address, this instance is now uniquely identified as a "thing" on the internet and represents the sculpture to reflect the mood of the particular institute or a department of an institute.
After establishing connection with an available WiFi router, the MKR1000 board then connects with the Meezaj web app (http://www.meezaj.net) through HTTP connection and sends its MAC address using POST method request to activate the sendmood PHP script. This PHP script fetches mood values from the survey responses stored in the respective relations and sends them back on the serial port of the MKR1000 board to be stored as a String. This String is then further processed to get the required mood values. Appropriate color values are then set for RGB LEDs connected with the MKR1000 board to glow appropriately. The client then waits for the next update period and queries Meezaj web server again for mood values.

V. CONCLUSION AND FUTURE WORK
It is a proven fact that students' level of happiness has a significant effect on their performance. In this paper, we have presented Meezaj-an interactive system for mood measurement and reflection of the relevant stakholders based on the Internet of Things (IoT). Meezaj supports both short and long mood survey, to collect data about the feelings of the participants, to be notified on Meezaj mobile app. Responses to these surveys are submitted to the Meezaj web server. Institute level mood is then calculated and reflected through Meezaj web app and a custom designed sculpture. Arduino MKR1000 and RGB LED-based sculpture is controlled to glow in appropriate colors to reflect the mood of the institute. One of the important future work is to further enhance mood data acquisition with Algorithm 2: Real-time mood reflection with MKR1000 Require: Active WiFi connection with MAC address MAC address of the MKR1000 WiFi shield and the update time period update period Ensure: Appropriately glow LED-based sculpture using MKR1000 with MAC address to reflect mood of the institute 1: connect MKR1000 with an active WiFi connection 2: create an instance client of the WiFiClient class with IP address assigned to MKR1000 with MAC address 3: while client.available do 4: generate HTTP connection string for www.meezaj.net 5: generate POST request method by sending MAC address to PHP script file sendmood.php 6: get mood values from the HTTP response 7: set values for RGB LEDs connected to the particular MKR1000 according to the mood values 8: wait for update period 9: end while on sight cameras and use IBM Watson NLP techniques for sentiment analysis on mood survey response data.

ACKNOWLEDGMENT
The author would like to thank Saoud Abdulmajeed and Abdulrahman Ismail from Saudi Electronic University for their work on developing an initial prototype of the Meezaj system as part of their capstone project.