Smart-Glass Glazing Using Arduino and Android Application

The parts of buildings most susceptible to light and heat are the windows, which are necessary for basic cooling and heating. A huge amount of electrical energy is used to power air conditioners to adjust the inside temperature of residential buildings, while appropriate glazing techniques and materials can be used to reduce energy consumption. There are classic techniques used for tinting glass in buildings and cars, but they all continue to use fixed techniques with one degree of glazing. Users cannot adjust the glazing of these glasses in response to the intensity of sunlight either automatically or by hand. In this research, a modern technique is proposed to allow users to automatically control a glass’s glazing through sensors and Android application with a microcontroller. Arduino microcontroller is used along with a special film polymer dispersed liquid crystals (PDLC) material coating the glasses to enable tinting. The results show adjustable levels of tinting with PDLC film being enabled. Keywords—Smart glass, glass glazing, microcontroller, sunlight intensity


Introduction
There are a number of advances for Smart-window applications that can be divided into two separate classifications. The first classification is "passive," in which electrical charge is not predicted to change the measure of light allowed to transmit through the glass. Smart glass that falls into this class responds to ecological conditions, wherein the darkness of the glass is adjusted. The second classification is "active," whereby the client controls the transparency of the glass. This classification requires an electrical charge to change the transparency of the Smart glass [1] [2].
Smart windows, characterized as factor light conveyance upon additional potential, are under consideration worldwide to address the issue for different requests for designs of cars' windshields and for buildings [3] [4] [5]. PDLC is an attractive sort of Smart window; moreover, having simple assembling process, exceptionally flexible conveyance, low determined voltage, and quick reaction speed [6] [7], it is more imperative to deal with the light in the entire obvious range. Therefore, PDLC film for smart windows is one of the popularized system of smart windows [8] [9] [10] .
The use of smart life appliances is increasing every day at home and at work, and this makes researchers think of applying the concept of the Internet of Things (IoT) to almost every part of daily life [11] [12] [13] [14] [15]. Therefore, we can utilize smart devices such as microcontrollers and smartphones to control glass tinting. The aim of this research is to allow users to control smart windows with their smartphones by a simple touch via an application.

Materials and Methods
The implementation of this idea is done through developing an Android app and building an electronic circuit controlled by an Arduino microcontroller [16] [17]. The system architecture is the foundation of the solution and is explained with core components and communication among those components. Figure 1 shows the proposed system architecture. The activity diagram of the system is depicted in Figure 2. It shows the interactions among the Arduino controller, Bluetooth Module, and PDLC film on glass.

Implementation
The hardware (the device) is supplied with a 12-volt DC source and the light sensor module is connected by a dedicated wire and placed in a suitable place (the light sensor has been designed to be connected outside the device to ensure that it is placed inside or outside the house and is connected by wire) and then the PDLC is connected, also by a dedicated wire. For the external wire used for connection, while wireless is intended to be used when commercializing the product. The PDLC film is controlled by a special application that works on the Android phone once the application has been installed and opened.
First, we make a Bluetooth connection through a button on the main page of the application, click on it, and choose HC-05. Then we return to the main page, which contains a set of icons. Each icon has a special function, as depicted in Figure 3. When button ON is clicked, the PDLC film is powered on. When the OFF button is clicked, the PDLC film powers off. The UP button increases transparency by one degree while the DOWN button decreases transparency by one degree. Finally, LDR, when clicked, changes the transparency automatically depending on the available light. RST, when clicked, stops the light sensor. When the user clicks the buttons (icons) in the application installed on the phone, at every click, an identifier for that button is sent via Bluetooth. The identifier reaches the Arduino, where it converts that identifier into a signal that controls the electrical current intensity into a PDLC film. Below are the identifiers for each button, as shown in Table  1. Table 1. Interaction of identifiers between App and Arduino.

Button name (Icon)
The identifier The following are the programming and implementation tools in detail: • MIT app inventor [18], to design an Android application for the front end, through which the user sends commands to the Arduino via Bluetooth. • C Programming language, for Arduino programming in the back end to execute commands received from the user by the android application via Bluetooth.
The implemented system includes two main sub-systems that are integrated and work together; see Figure 4. These subsystems are: • Wireless command transmission system: explained in previous paragraph with Figure 3. • Command execution system: This is an Arduino with some electronic modules, as shown briefly in Section (1.5). These modules are associated with Arduino, as shown in Figure 4. Via Bluetooth, a command is received from the wireless command transmission system (Android application), which executes the command whose outputs are electrical current from 0 to 60 VAC. The hardware contains a wire that is dedicated to the light sensor and a PDLC film. The light sensor and a PDLC film are connected to the wires for each, and after that the hardware is supplied with a DC voltage 12 V.
Pulse Width Modulation (PWM) is a technique that allows us to adjust the average value of the voltage that is going to the electronic device by turning on and off the power at a fast rate; see Figure 5. The average voltage depends on the duty cycle, or the amount of time the signal is ON versus the amount of time the signal is OFF in a single period of time. The PWM module has two screw terminal blocks for the motor, A and B, and another screw terminal block for the Ground pin, the VCC for motor, and a 5V pin, which can either be an input or output. The Enable A and Enable B pins are used for enabling and controlling the speed of the motor. If a jumper is present on this pin, the motor will be enabled and work at maximum speed, and if we remove the jumper, we can connect a PWM input to this pin, and in that way control the speed of the motor. If we connect this pin to a Ground, the motor will be disabled.
The Input 1 and Input 2 pins are used for controlling the rotation direction of the motor A, and the inputs 3 and 4 for the motor B. Use of these pins is to control the switches of the H-Bridge inside the L298N IC. If input 1 is LOW and input 2 is HIGH, the motor will move forward, and vice versa; if input 1 is HIGH and input 2 is LOW, the motor will move backward. In case both inputs are the same, either LOW or HIGH, the motor will stop. The same applies for the inputs 3 and 4 and the motor B .
The choice of the L298N module is designed to obtain a DC electric current with a voltage that changes from 0 to 12 volts, which can be controlled by Arduino. On the Arduino board, the connected motor direction controls ports IN1 and IN2 with digital entry 7 and 8. Connected motor output enables (PWM) in analog entry 9 in the Arduino board. Finally, connecting the circuit with a transformer coil as shown in Figure 6 raises the voltage from 12 to 60 volts, as well as turning the wave from its square to a sine wave. Results and Discussion Figure 7 shows the glass connected to a microcontroller and PDLC film applied on it without activation. Figure 8 depicts the activation of the film and smart tint is on. The user sends a signal from Android app to Bluetooth receiver on Arduino device module. The microcontroller sends a signal to the electronic circuit attached to the PDLC film to activate.  Monitoring the installed film to glaze glass with a signal of control sent from the developed Android application and collect data and measure the impact of the Smart Tint film installation on the light exposure. For the first measure done on the glass without PDLC film, as shown in Figure 9, the degree of lux is high due to high illumination. Installing PDLC film on the glass and activating transparency mode gives the results depicted in Figure 10. It is clear the illumination is reduced slightly compared to glass without the film applied. Data collected have already demonstrated the positive impact of this light protection method. Figure 11 shows the lux measurements whereas the curve demonstrating a significant reduction in illuminance. When the PDLC film is applied with activated tint mode, the illumination is reduced significantly as the film reflects the light away from the glass.  Table 2 shows the measurements of illumination using two different measure units of illumination, LUX and FC. Clearly, the measurements with installing PDLC film show a reduction in illumination, making this glass glaze more suitable for areas with a high intensity of sun illumination such as Iraq.

Conclusion
Glazing glass for privacy and reducing heat and illumination inside buildings is an important issue both in buildings and in vehicles. The new technology of PDLC film can be applied on windshields to create a tint. Controlling the levels of tinting by sensing the illumination intensity or by the user directly with a touch on a smartphone is the aim of this study. Arduino microcontroller with electronic circuit and developed Android application is the aim achieved for controlling the tint level by a touch on a smartphone screen. Thus, PDLC technology is merged with the trend of users using smartphone applications to control appliances within their living environments. The results of the study show good reduction of illumination with easy control of glass tinting.
The future direction of this research is to add a module to control the smart tint through sensing the heat. Where the film used in this research can reduce heat, this may add an extra feature of comfort. Additionally, we hope to add a Wi-Fi module to the microcontroller to make the device supported with Internet of Things (IoT) technology and to allow users to control the tint from far away.