Smart home management based on ESP8266 WIFI network control and Gizwits Cloud
[Copy link]
This post was last edited by Maoqiu Dada on 2022-1-18 16:52
With the development of sensors and IoT technologies based on many physical principles, smart homes are entering and rapidly improving people's quality of life in various ways. This system uses the ESP8266 serial port WIFI module, Gizwits A iot development platform and single-chip control system to design a smart home management system based on mobile phone APP and WIFI network. Various physical sensors are used to collect home environment information and push it to users. Users can control the working status of home appliances in real time through APP.
1 Overall system design
The signal data of voltage and current sensors, temperature and humidity sensors, and smoke sensors are collected through the STM32 F103ZET6 single-chip computer, and the collected data is sent to the user terminal through the WIFI module. The user monitors whether the various indicators of the home environment are abnormal through the information fed back by the terminal, and controls the real-time working status of household appliances, thereby completing the intelligent management of the home environment. The system can also control the status of household appliances by voice according to the collected information, and display the status of household appliances and home environment information on the LCD display. The framework of the entire system is shown in Figure 1.
Figure 1 System overall block diagram
2 System Workflow
The workflow of the smart home control system is shown in Figure 2. The system is based on the STM 32F103ZET6 single-chip microcomputer. By collecting data from various sensors, it analyzes whether each electrical appliance is in normal working condition, and transmits home information to the user terminal through the WIFI module. When an abnormality is detected, such as fire, raining windows not closed, short circuit of electrical appliances, etc., the system will automatically send an alarm to the user's mobile phone through data analysis to assist the user in dealing with emergencies. At the same time, users can also change the working status of household appliances according to information or wishes to achieve smart home control.
Figure 2 System workflow diagram
3. Voice control design
In order to improve the practicality and convenience of the system, this system also designs a voice assistant similar to "Xiao Ai Tongxue". This voice assistant uses the SYN7318 voice interaction module to convert the collected voice information into the corresponding command number and transmit it back to the system for corresponding control. When in use, the user must first shout out the voice control code "Xiao Ai Tongxue" set by the system to enter the voice control mode, and then shout out the operation command such as "turn off the lights" to the system within 30 seconds. After the command is recognized by SYN7318, it is compared with the voice command in the database. After the match is completed, the voice control function can be realized.
4 Sensor exploration and electrical appliance status detection design
In daily life, household appliances often use alternating current, and the single-chip microcomputer used in our control system can only collect DC voltage within a certain range. Therefore, we need to convert the AC current into a DC voltage within a suitable range. We use the principle of electromagnetic mutual induction to collect AC current. The current transformer is a non-contact current sensor. The current transformer is based on the principle of electromagnetic induction. The cable under test passes through the hollow coil. When the current of the cable under test changes, the magnetic field generated around it will also change at the same time. At the same time, the magnetic flux of the hollow coil changes. The change in magnetic flux will cause the secondary circuit to generate a small AC current. Then, after sampling the secondary current with a high-precision sampling resistor, the sampled voltage is rectified and amplified by an active rectifier circuit, and then it can be converted into a DC voltage signal within the required range. The current detection flow chart is shown in Figure 3.
Figure 3 Current detection flow chart
5. Smart product interconnection design
The effect diagram of the smart home control model is shown in Figure 4. The system uses the WIFI module as a bridge to communicate with the cloud server. During the operation of the system, it is necessary to maintain real-time connection with the server, continuously transmit the information obtained by the MCU to the cloud server, and obtain the control instructions sent by the mobile phone APP from the cloud server. Only by keeping the WIFI module working normally can the normal operation of the entire system be maintained. This system uses the ESP8266 serial port WIFI module, which is widely used in the field of Internet of Things. It has the characteristics of low energy consumption, convenient firmware burning, fast data transmission, support for AT language, small size, and low price.
In this system, the ESP8266 serial port WIFI module is used as a slave to work with the MCU. The module is only used as a communication module. The system can connect the module to the Gizwits cloud server with the help of the communication protocol provided by the Gizwits IoT platform . The network connection function can be realized by simply flashing the firmware provided by the Gizwits development platform into the Flash of the ESP8266 serial port WIFI module.
Figure 4 Smart home control model effect diagram
6 User APP Development
This system requires the construction and development of APP and Internet servers, but this is difficult at the undergraduate level, so we chose the highly integrated and easy-to-develop Gizwits IoT development platform . Using the communication protocol of this platform, data exchange between the server and the device can be easily completed. At the same time, the Gizwits AIoT development platform also provides developers with an open source reference mobile APP code framework, on which developers can design suitable mobile APPs.
During the operation of the system, users can send control signals to the server through the APP, and then the server sends the signal to the device, realizing the control of home appliances anytime and anywhere. Not only that, the APP can also display the status of home appliances in real time, which is convenient for users to adjust the home environment according to the information. The Gizwits AIoT development platform provides us with a good IoT solution, allowing us to easily realize data exchange between the APP and the device, greatly reducing the difficulty of designing the smart home control system.
7 Conclusion
By using sensor acquisition technology and wireless communication technology and relying on the Gizwits IoT development platform, we have designed a smart home management and control system based on mobile phone APP and WIFI network. The system connects basic household appliances to the Internet through the WIFI module, monitors the home environment in real time and controls household appliances in real time, thus realizing the intelligent management of household appliances and home environment.
|