Research on Remote Control System for Building Windows Based on Mobile Phones

Abstract: Traditional manual window switches can no longer meet people’s daily needs. To provide convenience and comfort in people’s lives, a control system for remotely switching building windows using a mobile app has been designed. The system mainly consists of a mobile terminal, a main controller, and an electric window opener. The control commands issued by the mobile terminal are transmitted over the internet to the main controller, which controls the electric window opener to open, pause, and close the windows based on the commands. The design of the system allows real-time display of the window’s movement status and position on the mobile interface, making it convenient and intuitive, while also providing a practical technical solution for remotely controlling window switches via mobile phone.

Research on Remote Control System for Building Windows Based on Mobile Phones

0 Introduction

With the rapid prosperity and development of Chinese society, the housing standards of people have been continuously rising along with the improvement of living standards. The rapid development of science and technology and internet technology has greatly promoted the intelligent development of the construction industry in our country[1]. Windows are an essential component of buildings and are closely related to people’s daily activities[2]. Currently, most building windows are still controlled manually, and this traditional manual window switching is increasingly unable to meet the daily needs of modern people[3], such as when sudden thunderstorms occur and there is no one at home to close the windows in time[4]; or forgetting to open the windows for air circulation when rushing to work in the morning. Therefore, there is an urgent need for a window that can be remotely controlled to meet daily needs.

1 Overall System Design

1.1 Overall System Architecture

The system mainly consists of three parts: mobile terminal, main controller, and electric window opener. The mobile terminal is used for remote control of the window and displaying the real-time movement status of the window, providing an intuitive human-computer interaction interface; the main controller is responsible for receiving command information from the mobile phone, controlling the electric window opener to open and close the window, and feeding back the window movement status information to the mobile phone, thus being the core of the entire system; the electric window opener is directly connected to the window, controlling the opening and closing of the window. The overall system structure diagram is shown in Figure 1. The mobile terminal first sends the command message to the server, which then transmits the command message over the internet to the home router, and the router forwards it to the main controller, which completes the corresponding control action based on the command message.

Research on Remote Control System for Building Windows Based on Mobile Phones

1.2 Main Controller Design Scheme

To achieve remote control of the window, a controller for controlling the window’s opening and closing is needed. This controller plays a role in controlling the window and remote connection, serving as the core of the system. Three commonly used controllers for controlling windows are as follows.

(1) Microcontroller Control: A microcontroller is an integrated circuit chip that uses ultra-large scale integration technology to integrate a central processing unit (CPU) with data processing capabilities, random access memory (RAM), read-only memory (ROM), various I/O ports, an interrupt system, timers/counters, and other functions into a small and complete microcomputer system on a silicon chip, widely used in industrial control. Its advantages include cost-effectiveness and relatively low costs; disadvantages include difficulty in expansion, strong environmental dependence, and long development cycles. The main control board made with a microcontroller has poor anti-interference capability and high failure rates due to limitations of board technology, layout structure, and component quality.

(2) PLC Control: A PLC (Programmable Logic Controller) is a digital operation electronic system designed specifically for industrial environments. It uses a programmable memory to store instructions for executing logic operations, sequential control, timing, counting, and arithmetic operations internally, and controls various types of machinery or production processes through digital or analog inputs and outputs[5]. Its advantages include strong anti-interference capability, low failure rates, easy equipment expansion, ease of maintenance, and short development cycles; its disadvantage is that it is relatively more expensive than microcontrollers.

(3) Arduino Control: Arduino is a convenient, flexible, and easy-to-use open-source electronic prototyping platform developed by a European team in winter 2005. From the beginning, Arduino has clearly defined its application environment and designed an open-source platform[6]. It has rich interfaces, a simple programming environment, great freedom, standardized interface modes, and high expandability, making it one of the most popular electronic interactive platforms[7]. As this board is open-source hardware, many compatible boards and extension boards with matching functions have emerged on the market for convenient selection. This system uses an Arduino-compatible board—ESPDuino board, which is compatible with Arduino and adds network connection functionality, making it more convenient to use and less expensive.

2 Hardware Design and Selection of the System

The hardware of the system adopts a modular design, and the hardware mainly consists of the mobile terminal, main controller, electric window opener, and window.

2.1 Selection of Mobile Terminal

The mobile terminal uses the Android system. Android phones have now become the most widely used mobile operating system in terms of market share, with high openness and extensibility, making it incomparable to other mobile systems[8]. Compared to other systems, developing on the Android system is easier, with almost no barriers, allowing for quick development of one’s own programs.

2.2 Main Controller

The main controller is the core of the entire hardware system, responsible for receiving command messages from the mobile terminal and controlling the window opener to control the opening and closing of the window; it also feeds back the window’s movement status to the mobile phone. The circuit diagram of the main controller is shown in Figure 2. The main controller mainly consists of the main control board, infrared sensor, and wireless transmission module.

Research on Remote Control System for Building Windows Based on Mobile Phones

2.2.1 Main Control Board

The main control board is the ESPDuino board produced by SiBoZhiLian Technology Co., Ltd. This board is developed based on the ESP8266-13 and is compatible with Arduino UNO. It uses the ESP-WROOM-02 chip WiFi module, which eliminates the trouble and cost of wiring an external WiFi module compared to traditional Arduino boards, making the system operation more reliable and smaller in size, with wide applications in network connections.

2.2.2 Selection of Infrared Sensor

This system uses a separate infrared counting sensor. This sensor is an NPN normally closed type, meaning it outputs a low-level signal when obstructed and a high-level signal when unobstructed. The working voltage of the transmitter is 5 V, and the working current is 40 mA; the working voltage of the receiver is 3-5.5 V, and the working current is 100 mA, making it easy to connect with the development board. Its effective detection distance of 2-20 cm and fast response time of 2 ms make it well-suited for application in the system.

2.2.3 Selection of Wireless Transmission Module

The wireless module is small in size and has a long transmission distance, making it widely used in various fields of life. The wireless module selected for this system operates at a frequency of 433 MHz. The 433 MHz wireless transceiver module is a short-range wireless communication module, and due to its low cost, sleep mode current consumption of about 1 μA, small size package, and fewer external pins, it is widely used in IoT wireless communication. This module also has high sensitivity, good diffraction performance, low power consumption, and strong penetration capabilities.

2.3 Selection of Electric Window Opener

The electric window opener selected is the KK-LT-300 electric chain window opener from Shanghai KaiKuo Electronic Technology Co., Ltd. Its working voltage is 24 V DC, working current is 1 A, pushing force is 400 N, stroke distance is 400 mm, and speed is 7 mm/s. It features overload protection design; low noise when opening and closing windows, and a double-layer metal chain design for more stable and smooth operation. The window opener is directly connected to the window, controlling the opening and closing through the extension and retraction of the chain.

3 System Program Design

The control commands sent from the mobile terminal to the window execution are accomplished through the system program. The system program is the core of the entire system, and its program flowchart is shown in Figure 3. The mobile app uses the Message Queuing Telemetry Transport (MQTT) protocol to send command messages to the server, which packages the messages and accesses the home router via the internet. The router transmits the messages to the main controller via WiFi, and the main controller parses the command messages and sends them to the receiving module of the electric window opener via the wireless transmission module, controlling the operation of the electric window opener, thus controlling the opening and closing of the window. At the same time, the infrared counting sensor continuously counts the number of chain links of the electric window opener and sends the data to the server, which pushes the data to the mobile terminal as feedback information. The system program mainly includes two parts: the mobile app software program design and the controller’s program design.

Research on Remote Control System for Building Windows Based on Mobile Phones

3.1 Mobile App Software Program Design

The design of the mobile app is done using the Java programming language, with Android Studio as the development environment. Android Studio is a new integrated development tool for Android mobile applications launched by Google, used for the development and debugging of Android mobile applications. The design of the mobile app is used to send command messages; on the other hand, it is also used to receive feedback information and update. The mobile app program sends command messages and receives feedback messages using the MQTT protocol, and the working process is as follows. When the “Open” button is clicked, the command message is first sent to the server via the MQTT protocol. The server then sends the command message over the internet to the home router, and the command message is pushed to the main controller via the router. The main controller controls the electric window opener to operate and extend the chain, thus opening the window. At the same time, the infrared sensor continuously collects data and feeds it back to the mobile terminal through the original link, with the data on the mobile terminal increasing at a rate of 1% until it reaches 100% or stops working upon receiving the “Pause” command message. Conversely, when the “Close” button is clicked, the data on the mobile terminal decreases at a rate of 1% until it reaches 0% or stops working upon receiving the “Pause” command message. Therefore, the design of the mobile terminal control program makes it clearer and more intuitive for people to understand the operating status of the window switch and makes it easier for people to control the opening size based on actual conditions.

3.2 Main Controller Program Design

The core of the main controller is the ESPDuino board, and the programming environment used is Arduino IDE, with the programming language being C/C++. The functions of the main controller’s program include: on one hand, it is used to receive command messages from the mobile terminal and controls the electric window opener to perform corresponding actions; on the other hand, it feeds back the data collected by the infrared sensor to the mobile phone. The flowchart of the main controller is shown in Figure 4. After the main controller receives the command message sent by the mobile terminal, it parses the message and controls the extension and retraction of the electric window opener’s chain according to the parsed command message, thus controlling the actions of opening and closing the window. At the same time, the infrared counting sensor counts the number of chain links of the electric window opener and converts the collected data into the opening size, which is displayed in real-time on the mobile terminal.

Research on Remote Control System for Building Windows Based on Mobile Phones

4 Operating Results

Turn on the mobile network connection to connect the phone to the network. Run the mobile terminal control application, and after clicking the “Open” button, the electric window opener’s chain extends to open the window, while the mobile terminal begins to receive data collected by the infrared sensor from the electric window opener and displays the cumulative change of the value on the mobile terminal control interface. When the “Pause” button is clicked, the electric window opener stops working, and the value on the mobile terminal control interface also stops accumulating and remains unchanged. When the “Close” button is clicked, the electric window opener’s chain retracts to close the window, and the value on the mobile terminal control interface continuously decreases until the electric window opener finishes running and the window is closed, resulting in a value of 0% on the mobile interface. The program runs stably, reliably, and responsively, and can intuitively display the opening and closing status of the window.

5 Conclusion

The remote control system for building windows designed in this paper breaks the traditional window opening mode and realizes the remote control of building windows using a mobile phone, solving the problem of being unable to remotely open and close windows in people’s lives. This system not only achieves remote control of windows but also allows real-time display of the window’s movement status and opening size on the mobile terminal, making it clearer and more intuitive for people to control the windows.

References

[1] Sun Guangyu, Zhang Lingling. Android IoT Development from Entry to Practice [M]. Beijing: Tsinghua University Press, 2015.

[2] He Guoyuan, Liao Zhifei, Yang Tairen, et al. A New Intelligent Window Control System Based on IAP15F2K61S2 Microcontroller [J]. Machine Tool and Hydraulic, 2015, 43(8): 148-151.

[3] Wang Chao, Lin Baishun, Feng Kaiping, et al. Design and Implementation of IoT Intelligent Window System [J]. Computer Times, 2016(7): 12-15.

[4] Gu Jiaye, Xiao Huirong, Chen Zibo. Design of Intelligent Window Based on GSM Control [J]. Science and Technology Square, 2014(7): 253-256.

[5] Liao Changchu. PLC Programming and Application [M]. Beijing: Mechanical Industry Press, 2014.

[6] Cui Yang, Zhang Weihua, Bai Yunfeng. An Arduino-Based Smart Home Control System [J]. Electronic Technology Application, 2014, 40(4): 123-125.

[7] Evans M, Noble J, Hochenbaum J. Arduino Practical [M]. Kuang Qi, Trans. Beijing: People’s Posts and Telecommunications Press, 2014.

[8] Li Ruiqi. Practical Android Development: From Learning to Product [M]. Beijing: Tsinghua University Press, 2017.

Author Information:

Yang Zhigang, Liu Jiwen

(Dalian Jiaotong University, School of Mechanical Engineering, Dalian, Liaoning 116028)

Training Information

Research on Remote Control System for Building Windows Based on Mobile Phones

You can also directly click the website to visit

http://gk.chinaaet.com

Research on Remote Control System for Building Windows Based on Mobile Phones

Research on Remote Control System for Building Windows Based on Mobile Phones

Research on Remote Control System for Building Windows Based on Mobile Phones

Leave a Comment