Internet of Things system suitable for smart home
By using STM32F407 and STM32F103 modules, E18 modules and K210 modules in smart home IoT systems, the zigbee network is solved, and the device compatibility and security problems are achieved, and efficient data interaction between devices is achieved and Safe and fast access control improves the flexibility and reliability of the system.
Patent Information
- Application Number
- CN202411517693.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-01-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Poor compatibility, insufficient security and inconsistent data management among smart home devices have led to difficulty in achieving linkage control, presence of security vulnerabilities and poor system flexibility.
An IoT system including central control equipment, environmental monitoring and indication equipment and access control equipment was designed. The STM32F407 and STM32F103 modules are used as the main control. Based on the MQTT protocol, the ESP-01S WIFI module is used to implement data cloud access. The E18 module serves as the zigbee group Network coordinator, builds a zigbee network, realizes data interaction between devices, and performs facial recognition and access control through the K210 module, and uses FreeRTOS operating system to manage tasks to improve system operation efficiency.
It realizes compatibility and data interaction between different devices, improves the security and flexibility of the system, ensures synchronization and blockage between devices, and improves the reliability and scalability of the system.
Smart Images

Figure CN119270663A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to an Internet of Things system suitable for smart homes. Background Art
[0002] For many people, using smart home systems is no longer a novelty. For example, smart light bulbs can be turned on and off remotely through mobile phone applications, or the brightness can be automatically adjusted through sensors. However, although these systems are convenient, there are still some problems: the first is the compatibility issue: different smart home devices are not well compatible with each other, resulting in the inability to achieve linkage control; then there is the security issue: traditional access control systems generally use card swiping or password verification, which has security loopholes, such as card theft or password cracking; finally, there is the data management issue: there is no unified standard between products of different brands, and it is difficult to interact and manage data, resulting in poor flexibility and scalability of the system. Summary of the invention
[0003] In order to make up for the above deficiencies, the present invention provides an Internet of Things system suitable for smart homes that overcomes the above technical problems or at least partially solves the above problems.
[0004] The present invention provides an Internet of Things system suitable for smart homes, including a BAFTA cloud platform, a central control device, an environmental monitoring indicator device, an access control device and a host computer module;
[0005] The central control device includes an STM32F407 module, an ESP-01SWIFI module, an E18 module and a button indicator module. The central control device is controlled by the STM32F407 module. Based on the MQTT protocol, the ESP-01S WIFI module is used to upload data to the cloud. The E18 module serves as the coordinator of the zigbee network to build and maintain the zigbee network.
[0006] The environmental monitoring indication device includes an STM32F103 module, an environmental data perception module, an E18 module and an RGB light indication module. The environmental monitoring indication device is controlled by the STM32F103 module as the main control, and the E18 module is used as the terminal node in the zigbee network. The device is added to the established zigbee local area network to realize data interaction, and the WS2812 chip is used to drive the RGB light to realize lighting and signal indication;
[0007] The access control device includes a camera module, a K210 module, an E18 module, a relay and an electromagnetic lock. The access control device uses the K210 module as the main control to perform face recognition. After the recognition is passed, the electromagnetic lock is driven to unlock. The E18 module is used as a terminal device in the Zigbee network. The device is added to the established Zigbee local area network to realize data interaction.
[0008] In this preferred solution, the environmental data sensing module includes an AHT20 temperature sensor, a photosensor and an MQ-2 combustible gas sensor, which can collect environmental data in real time and upload the data through a cloud platform.
[0009] In this preferred solution, the upper computer mobile phone APP module includes a user interface module and a control logic module, so that users can more conveniently interact with the system for data control, and can connect to the BAFFA cloud platform through a wireless network to control and monitor the internal devices of the BAFFA cloud platform. The upper computer mobile phone APP module uses the appinventor Android development environment for logic design and human-computer interface development, and the implementation of the system's internal functions is based on the MQTT protocol.
[0010] In this preferred solution, the user interface module includes a temperature and humidity data real-time display module, a light intensity data real-time display module, a door opening and closing status display module, an RGB light status prompt module and an RGB light control module, and the above modules are all based on the MQTT protocol.
[0011] In this preferred solution, the control logic module includes the Broker server address module, the port network port number module, the KeepAlive heartbeat packet time interval module and the ClientID customer service ID module, which can be connected to the Baffa cloud platform after setting up.
[0012] In this preferred solution, the environmental monitoring indicating device adopts a linear voltage stabilization solution, and the power management chip uses the LDO linear voltage stabilization chip RT9193-33GU5 to achieve linear voltage stabilization of the system power supply, and adopts an internal power supply method to ensure the stability of the device and improve the mobility of the device.
[0013] In this preferred solution, the central control device, environmental monitoring indicator device and access control device all use private data protocols, and the main data include temperature, humidity, light intensity, MQ-2 value, access control status, as well as judgment bit and end bit.
[0014] The present invention provides an Internet of Things system suitable for smart homes, and its beneficial effects include:
[0015] 1. The present invention discloses an Internet of Things system suitable for smart home. The FreeRTOS operating system is integrated in the central control module. The FreeRTOS operating system effectively manages the initialization task, LED indication thread, data sending thread, and data acquisition task. These four tasks can run in sequence to achieve synchronization and blocking between tasks, thereby ensuring the efficiency and reliability of system operation.
[0016] 2. The present invention adopts three E18s to form a ZigBee local area network. The E18 of the central control module is the coordinator node, and the E18 of the environmental monitoring indicator device module and the access control device module are the terminal nodes. The central control module packages the data and transparently transmits it to E18 to realize small-scale data interaction, improve the compatibility of data between devices, and enable devices of different standards to be connected to the same device (central control) according to one standard.
[0017] 3. The present invention adopts K210 as the main control of the access control module to realize the face recognition function. It adopts LBP feature detection to extract the features of the image by calculating the differences of local pixel points. After detecting that the face features meet the set face features, the corresponding door lock relay is closed and unlocking is executed to achieve safe and fast unlocking.
[0018] 4. The central control module device in the present invention mainly plays the role of data transfer, which not only realizes the coordinated control of various auxiliary devices, but also connects the system data to the cloud and obtains cloud data in real time. The private data protocol is used for data communication between devices to realize data interaction between devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 It is an overall flow chart provided by an embodiment of the present invention;
[0021] Figure 2 A schematic diagram of an environmental data perception module provided in an embodiment of the present invention;
[0022] Figure 3 A schematic diagram of a host computer mobile phone APP provided in an embodiment of the present invention;
[0023] Figure 4 A schematic diagram of the process flow of an environmental monitoring indicating device provided by an embodiment of the present invention;
[0024] Figure 5A schematic diagram of the software flow of the central control device provided in an embodiment of the present invention;
[0025] Figure 6 A schematic diagram of the software flow of the access control device provided by the embodiment of the present invention;
[0026] Figure 7 A schematic diagram of the zigbee module architecture provided for an embodiment of the present invention;
[0027] Figure 8 A schematic diagram of the MQ-2 sensor architecture provided in an embodiment of the present invention;
[0028] Fig. 9 A schematic diagram of the AHT20 temperature and humidity sensor architecture provided in an embodiment of the present invention;
[0029] Fig.10 A schematic diagram of the light intensity sensor architecture provided by an embodiment of the present invention;
[0030] Fig.11 A schematic diagram of the WS2812B architecture provided for an embodiment of the present invention;
[0031] Fig.12 A schematic diagram of a battery architecture provided for an embodiment of the present invention;
[0032] Fig.13 A schematic diagram of the K210 architecture provided for an embodiment of the present invention;
[0033] Fig.14 A schematic diagram of a relay architecture provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] Reference Figure 1-Figure 14 ,The present invention provides a technical solution: an Internet of Things system suitable for smart home, including a Baffa cloud platform, a central control device, an environmental monitoring indicator device, an access control device and a host computer module;
[0036] The central control device includes an STM32F407 module, an ESP-01SWIFI module, an E18 module and a button indicator module. The central control device is controlled by the STM32F407 module. Based on the MQTT protocol, the ESP-01S WIFI module is used to upload data to the cloud. The E18 module serves as the coordinator of the zigbee network to build and maintain the zigbee network.
[0037] Among them, this system uses multiple E18 modules to form a Zigbee LAN to achieve small-scale data interaction. The PCB onboard antenna or IPEX-1 interface, the distance between the two ports is 1.27mm, supports self-organizing network, and the firmware is burned at the factory. It is suitable for use in various applications (especially smart home). Multiple E18 modules use CC2530 RF chip to improve the communication range. On the basis of ZigBee3.0 protocol, the factory-provided firmware realizes serial port data transparent transmission and supports various command commands under Zigbee3.0 protocol. It has good compatibility with most ZigBeec3.0 products on the market, which greatly improves the compatibility of this system. It should be noted that the performance of the module is greatly affected by the antenna installation structure. Therefore, it is necessary to ensure that the antenna is exposed and installed vertically upward to obtain the best performance. The module needs to be installed inside the casing. A high-quality antenna extension cable should be selected to extend the antenna to the outside of the casing. The antenna cannot be installed inside the metal shell, which will seriously weaken the signal transmission distance. The hollow design under the antenna can be adopted when designing the circuit board to prevent signal interference with the module. At the same time, the copper under the module is covered with vias to reduce unnecessary interference.
[0038] In the above, Zigbee uses buttons to manually select the network configuration scheme, and the LED light displays the network configuration status.
[0039] like Figure 1 As shown, in order to improve the compatibility of data between devices, devices of different standards must be connected to the same device according to one standard, so the star topology is used to build the ZigBee network.
[0040] Among them, FreeRTOS is a widely used real-time operating system (RTOS), especially suitable for embedded systems. Its design goal is to provide developers with a lightweight, efficient and easy-to-use task scheduling and management mechanism. Through the task management and scheduling mechanism, FreeRTOS can effectively improve the system's response speed and resource utilization. When using FreeRTOS, users can flexibly configure the task priority, communication mechanism and memory management strategy according to actual needs to meet the needs of the application; its workflow is as follows: (1) Initialization system startup: When the system starts, FreeRTOS will initialize, including creating a scheduler, configuring memory management, initializing the clock, and creating tasks: Developers can create multiple tasks in the initialization phase and set the priority, stack size and entry function of each task. (2) Task scheduling scheduler startup: Call the vTaskStartScheduler() function to start the scheduler, and FreeRTOS will begin to manage the execution of tasks and time slice allocation: The scheduler schedules tasks according to their priorities and time slices to ensure that high-priority tasks are executed first. (3) Task running context switching: When a task's time slice ends, or the task enters a blocking state (for example, waiting for an event or semaphore), the scheduler will perform a context switch and select the next executable task to execute. Task state management: Each task may be in different states during execution, including running, ready, blocked, suspended, etc. The scheduler switches tasks according to the state of the task. (4) Task termination: A task can end normally or be forcibly terminated. When a task terminates, the scheduler will clean up the relevant resources and select the next task to run based on the task priority.
[0041] The environmental monitoring indication device includes an STM32F103 module, an environmental data perception module, an E18 module and an RGB light indication module. The environmental monitoring indication device is controlled by the STM32F103 module as the main control, and the E18 module is used as the terminal node in the zigbee network. The device is added to the established zigbee local area network to realize data interaction, and the WS2812 chip is used to drive the RGB light to realize lighting and signal indication;
[0042] like Fig. 9As shown, the environmental data perception module includes an AHT20 temperature sensor, a photosensor and an MQ-2 combustible gas sensor, which can collect environmental data in real time and upload the data through the cloud platform. The AHT20 temperature and humidity sensor on this system uses the platform GPIO port to simulate the I2C bus for data communication. The specific steps are as follows: First, initialize the GPIO configuration of the SCL and SDA pins of I2C, configure the GPIO port to be used as the output mode, and pull the SCL and SDA lines high, and then send the start signal: first pull the SDA line low, then pull the SCL line low, and then send the address: according to the I2C protocol, first send the device address and read and write direction. The last bit is 1 when reading and 0 when writing. Send the address bit by bit to the SDA line, pull the SCL line high and then low after each bit is sent, and send the data: according to the I2C protocol, send the start bit first when sending data, and then send the data bit by bit. After the data is sent, the stop bit is sent. During the data transmission process, the data is written to the SDA line. After each bit is sent, the SCL line is pulled high and then low. Receive data: According to the I2C protocol, an ACK signal must be sent when receiving data. When receiving data, the start signal and device address are sent first, and then the data is read. After each bit of data is read, the SDA line is pulled high and then low to send ACK. Send stop bit: When sending the stop bit, pull the SDA line from low to high, and then pull the SCL line high to indicate that the transmission is complete.
[0043] like Fig.10 As shown in the figure, PTSM-D021 is a light intensity sensor. The implementation principle is that external light affects the base voltage, thereby affecting the emitter voltage. At the same time, the collector is connected to the microcontroller, which can be turned on and enabled by the microcontroller. The emitter is connected to the ADC pin of the microcontroller to read the emitter voltage, thereby realizing the acquisition of ambient light intensity data. The ADC of this system is mainly used to read the analog values output by the light intensity sensor and the MQ-2 hazardous gas detection sensor to sense the external environmental situation. The specific configuration steps of ADC are as follows: (1) Initialize GPIO: configure GPIO to analog input mode and enable the corresponding clock; (2) Initialize ADC: configure ADC parameters such as clock and resolution; (3) Configure ADC input channel: select the corresponding channel as the ADC input; (4) Start ADC conversion: start ADC conversion and wait for the conversion to complete; (5) Process ADC results: read the ADC conversion results and process and calculate them as needed. The light intensity sensor uses the PB0 pin to enable channel 8 of ADC1, and MQ-2 uses PA1 to enable channel 1 of ADC1.
[0044] like Figure 8As shown, MQ-2 is a combustible gas sensor based on semiconductor gas sensing technology. It can be used to detect a variety of combustible gases, such as liquefied gas, propane, butane, methane, hydrogen, etc. The output signal of the MQ-2 sensor is an analog signal, and its value can be read through the microcontroller ADC.
[0045] The pins of the MQ-2 sensor are VCC, GND, AO, and DO. VCC and GND are connected to the positive and negative poles of the power supply respectively. The AO pin is an analog output signal, and the DO pin is a digital output signal. This system does not use it, so it is left floating. When combustible gas is detected, the MQ-2 AO pin will output an analog voltage signal, the size of which is proportional to the detected gas concentration.
[0046] Among them, the RGB light indication module is a variable LED light, which is driven by the WS2812B chip. The WS2812B has built-in signal amplification, filter and data decoding circuits, and can control the color and brightness of multiple WS2812B lights through a single signal line. The voltage operating range of the WS2812B RGB light is 3.5V-5.3V, and it can be driven by low voltage. The color and brightness of the WS2812B RGB light can be controlled by the program, and a variety of beautiful lighting effects can be achieved, such as breathing lights, flowing lights, flashing lights, rainbow lights, etc., which greatly improves the prompt effect.
[0047] The computing resources required for the environmental monitoring and indicating device are not high. STM32F103C8T6 is used as the main control chip. The STM32F103C8T6 processor uses the ARM Cortex-M3 core with a maximum main frequency of 72MHz, integrates 64KB flash memory and 20KB SRAM, supports JTAG and SWD debugging interfaces, and has relatively rich peripherals, including 3 timers, each with 3 channels; 2 I2C bus interfaces; 3 USART serial ports; 2 SPI interfaces; 1 USB 2.0FS interface. In addition, it also supports ADC, DAC, PWM, RTC and other functions, thereby increasing the scope of application of the environmental monitoring and indicating device and facilitating subsequent connection line operations. The environmental monitoring and indicating device in this system needs to use PA11 (timer), PA1 (adc), PB6 (iic), PB7 (iic), PB0 (adc), PB1 (gpio), PB9 (gpio), PB12 (gpio), PA9 (uart), PA10 (uart), and PB8.
[0048] like Fig.12As shown, the environmental monitoring indicating device adopts a linear voltage regulation scheme, and the power management chip uses an LDO linear voltage regulator chip RT9193-33GU5 to achieve linear voltage regulation of the system power supply, and adopts an internal power supply method to ensure the stability of the equipment and improve the mobility of the equipment. Before voltage regulation, the power supply comes from the external 5V power supply connected to the type-c interface, and is switched to the VIN end of the RT9193-33GU5 through a 3-speed button switch for voltage input. After voltage regulation by the voltage stabilization point circuit, a 3.3V voltage is output at the VOUT end for system use. The maximum current is about 300ma, which meets the system requirements. In addition, the internal power supply of this device uses a 3.7V rechargeable lithium battery as the power source. The power supply is selected through a 3-speed button switch and then connected to the voltage stabilization circuit. Among them, as an internal power supply, the battery has limited power, that is, a battery charging circuit is designed for the device. According to the battery's electrical resistance characteristics, TC4056A is selected as the lithium battery charging management chip to build a charging circuit, which can be used at 5V It can charge a single lithium-ion battery under USB power supply. It also integrates protection functions such as overcharge protection and undervoltage protection. The maximum charging current can reach 1A, and it has overcharge and undervoltage protection. When the battery voltage exceeds 4.28V, TC4056A automatically turns off charging; when the battery voltage is lower than 2.4V, TC4056A automatically turns off charging, thereby improving the battery life of this system.
[0049] The access control device includes a camera module, a K210 module, an E18 module, a relay and an electromagnetic lock. The access control device is controlled by the K210 module to perform face recognition. After the recognition is passed, the electromagnetic lock is driven to unlock. The E18 module is used as a terminal device in the Zigbee network. The device is added to the established Zigbee local area network to realize data interaction.
[0050] like Fig.13As shown in the figure, the access control module needs to realize the face recognition function, which requires a high computing power of the main control chip. Therefore, an AI chip based on the RISC-V architecture, K210, is used. The K210 chip has a built-in AI hardware accelerator, which can support various AI applications and can be used for face recognition. K210 has a dual-core 64-bit RISC-V processor, one of which has a core frequency of 400MHz and the other has a core frequency of 600MHz, which can achieve high-performance computing and high-speed data processing. K210 is also equipped with an AI accelerator, supports convolutional neural networks (CNN) and recurrent neural networks (RNN), and can achieve efficient face recognition, speech recognition, image processing and other applications. It has a wealth of peripherals, including SPI, I2C, UART, PWM, ADC, DAC and other interfaces, and supports a variety of storage media, such as SD card, TF card, SPI NOR FLASH, etc., and also uses UART and ordinary GPIO. It also provides a complete development tool chain and software library, supports a variety of programming languages and development environments, such as C / C++, Python, thereby increasing the speed and fluency of the face recognition process.
[0051] Face recognition uses LBP feature detection. When it is detected that the face features meet the set face features, the IO33 pin is pulled high to close the relay and unlock the door.
[0052] like Figure 6 As shown in FIG. 1 , LBP (Local Binary Pattern) feature is a feature extraction method used in image processing and computer vision. The extraction process of LBP feature is simple and the calculation speed is fast. The LBP feature mainly extracts the features of the image by calculating the difference of local pixels. The specific calculation process is as follows: select a pixel as the center point, and select a circle of pixels (usually 8 or 16) with the center point as the center. For each pixel, compare it with the gray value of the center point. If it is greater than the gray value of the center point, mark it as 1, otherwise mark it as 0. Connect these binary numbers in sequence to form a binary number, which is the LBP value of the center point. Calculate the LBP value for each pixel in the image to form an LBP image. Count the LBP image to get the number of occurrences of each LBP value as the LBP feature vector of the image. When the feature analysis score is greater than the set calibration value, execute the unlocking action, pull up the 33IO pin, and send '$1#' to the serial port. After waiting for 5s, automatically close the lock and send '$0#' to the serial port, so that the system data is updated in time. The valid data bit is the second bit, '1' means unlocked, and '0' means locked.
[0053] The host computer mobile phone APP module includes a user interface module and a control logic module, so that users can more conveniently interact with the system for data control, can connect to the Baffa cloud platform through a wireless network and control and monitor the internal devices of the Baffa cloud platform. The host computer mobile phone APP module uses the appinventor Android development environment for logic design and human-machine interface development. The implementation of the internal functions of the system is based on the MQTT protocol. Users can control smart home devices, monitor device status, and obtain environmental information through the host computer mobile phone app module. The smart home control system needs to use the central control device, environmental monitoring indicator device, access control device and host computer software app at the same time. The two cooperate with each other to achieve the normal operation and convenient use of the system. The real-time data display part includes: temperature and humidity, light intensity, hazardous gas detection, access control status, and RGB light status. It adopts parallel, vertical and combined arrangement to present a more intuitive real-time display. The RGB control part provides 6 buttons for users to use, with RGB color selection and mode selection. The colors include white, red, green and blue, and the modes include flashing mode and running light mode.
[0054] like Figure 3 As shown, the user interface module includes a temperature and humidity data real-time display module, a light intensity data real-time display module, a door open and closed status display module, an RGB light status prompt module and an RGB light control module. The above modules are all based on the MQTT protocol. The control logic module includes a Broker server address module, a port network port number module, a KeepAlive heartbeat packet time interval module and a ClientID customer service ID module. After setting, it can be connected to the BAFTA cloud platform.
[0055] The central control device, environmental monitoring indicator device and access control device all use private data protocols. The main data include temperature, humidity, light intensity, MQ-2 value, access control status, as well as judgment bit and end bit. For the three devices in the entire system, how to communicate data with each other requires the formulation of a data regulation. In order to achieve effective communication between data, this system adopts a private data protocol. The main data include temperature, humidity, light intensity, MQ-2 value, access control status, as well as discrimination bit and end bit. The format of the effective data packet contains a total of 10 decimal data, which are two bits of temperature, two bits of humidity, four bits of light intensity, two bits of MQ2 status, and two bits of access control status. On the central control device side, the effective data packet will eventually be parsed and integrated, and the data packet will be packaged and sent to ESP-01S, which will then parse and split the data packet and publish each data bit to the corresponding Topic of the cloud platform through the MQTT protocol to achieve data update. At the same time, as the terminal node device of the zigbee network, the environmental monitoring indicator module also needs to package and send the collected data according to the established data rules. The effective data part is consistent with the format of the central control data packet, and '#' is added to the last bit to indicate that the data transmission has been completed. When the central control module coordinator device receives '#', it can be determined that a data packet has been received and data can be sent and updated, such as 2666150011#, 26 is temperature, 66 is humidity, 1500 is light intensity, 1 is MQ2, 1 is access control status, and # is the end bit. At the access control module terminal node device end, the data that needs to be incorporated into the zigbee LAN is only the access control status. There is only one valid data bit, and binary 0 and 1 are used to represent access control closed and open respectively. At the same time, it must be distinguished from the EMIM data to avoid data confusion. Therefore, the data packet format on the ACM end is 3 bits, which are identification bit, access control status bit, and end bit in order, such as $1#, $ is identification bit, 1 is access control status, and # is end bit. When the central control module coordinator device receives '$'2, it is determined to be data from the access control module terminal node device. According to the data of the access control status bit, the access control status bit of the central control data packet is updated.
[0056] Specifically, the working process or working principle of this IoT system suitable for smart home is as follows: First, the environmental data perception module is composed of AHT20 temperature sensor, light sensor and MQ-2 combustible gas sensor, which monitors the temperature, humidity, light intensity and combustible gas concentration in the environment in real time. The collected data is processed by STM32F103 main control module, and the data is uploaded to the Baffa cloud platform using MQTT protocol to ensure the real-time and reliability of the data. The system uses E18 module to build Zigbee network, which connects various smart devices as a coordinator to realize wireless communication between devices. Users interact with the system through mobile phone APP. The APP interface design includes multiple modules to display real-time temperature and humidity, light intensity, access control status and RGB light status. Users can control the door switch (by sending unlock or lock commands) and the color and mode of the RGB light (such as selecting red, green, blue and other colors and flashing or flowing light modes) through the APP. When the user issues commands on the APP, the main control module receives these commands and performs corresponding operations. The system will feedback the current status to the APP after executing the operation to ensure that the user can understand the status changes of the device in time. The system also has an environmental monitoring function and can notify the user through the APP when dangerous gases are detected, further enhancing the safety of the family. In this way, users can easily monitor and manage the smart home environment and improve the convenience and safety of life.
[0057] In the above process, the central control module, as the coordinator node in the Zigbee network, is responsible for collecting and processing data from other terminal nodes in the system. After parsing and packaging the data, it is repackaged through ESP-01S and then sent to the cloud. The main control chip is STM32F407, equipped with FreeRTOS. A total of 3 Tasks are created in the code system, namely start_task (initialization thread), app_task_led1 (LED indication thread), and app_task_datasend (data sending thread). The program starts running. After the peripheral initialization is completed, start_task is created and started. Start the system scheduling, and then start_task starts running. In this thread, after the app_task_led1 and app_task_datasend threads are successfully created, start_task is deleted to avoid frequent creation of user threads. The app_task_led1 thread controls the LED on and off to indicate that the system is in operation. The data of the Zigbee network is obtained by the USART2 of the STM32F407 through E18 using interrupt mode. After the data is received and packaged, it is passed to the app_task_datasend thread and sent to ESP-01S through USART1. ESP-01S repackages the data and uploads it to the Bafa Cloud, which then sends the data to the subscriber's mobile APP for display.
Claims
1. An Internet of Things system suitable for smart home, characterized in that: Including BAFTA cloud platform, central control equipment, environmental monitoring indicator equipment, access control equipment and host computer module; The central control device includes an STM32F407 module, an ESP-01SWIFI module, an E18 module and a button indicator module. The central control device is controlled by the STM32F407 module. Based on the MQTT protocol, the ESP-01S WIFI module is used to upload data to the cloud. The E18 module serves as the coordinator of the zigbee network to build and maintain the zigbee network. The environmental monitoring indication device includes an STM32F103 module, an environmental data perception module, an E18 module and an RGB light indication module. The environmental monitoring indication device is controlled by the STM32F103 module as the main control, and the E18 module is used as the terminal node in the zigbee network. The device is added to the established zigbee local area network to realize data interaction, and the WS2812 chip is used to drive the RGB light to realize lighting and signal indication; The access control device includes a camera module, a K210 module, an E18 module, a relay and an electromagnetic lock. The access control device uses the K210 module as the main control to perform face recognition. After the recognition is passed, the electromagnetic lock is driven to unlock. The E18 module is used as a terminal device in the Zigbee network. The device is added to the established Zigbee local area network to realize data interaction.
2. The Internet of Things system suitable for smart home according to claim 1, characterized in that: The environmental data perception module includes an AHT20 temperature sensor, a photosensor and an MQ-2 combustible gas sensor, which can collect environmental data in real time and upload the data through a cloud platform.
3. The Internet of Things system suitable for smart home according to claim 1, characterized in that: The host computer mobile phone APP module includes a user interface module and a control logic module, so that users can interact with the system for data control more conveniently. It can connect to the BAFTA cloud platform through a wireless network and control and monitor the internal devices of the BAFTA cloud platform. The host computer mobile phone APP module uses the appinventor Android development environment for logic design and human-computer interface development, and the implementation of the system's internal functions is based on the MQTT protocol.
4. The Internet of Things system suitable for smart home according to claim 3, characterized in that: The user interface module includes a temperature and humidity data real-time display module, a light intensity data real-time display module, a door opening and closing status display module, an RGB light status prompt module and an RGB light control module, and the above modules are all based on the MQTT protocol.
5. The Internet of Things system suitable for smart home according to claim 4, characterized in that: The control logic module includes the Broker server address module, the port network port number module, the KeepAlive heartbeat packet time interval module and the ClientID customer service ID module. After setting up, it can be connected to the Baffa cloud platform.
6. The Internet of Things system suitable for smart home according to claim 1, characterized in that: The environmental monitoring indicating device adopts a linear voltage stabilization solution, and the power management chip uses an LDO linear voltage stabilization chip RT9193-33GU5 to achieve linear voltage stabilization of the system power supply, and adopts an internal power supply method to ensure the stability of the device and improve the mobility of the device.
7. The Internet of Things system suitable for smart home according to claim 1, characterized in that: The central control device, environmental monitoring indicator device and access control device all use private data protocols, and the main data include temperature, humidity, light intensity, MQ-2 value, access control status, as well as judgment bit and end bit.
Citation Information
Patent Citations
Household environment remote monitoring system
CN116047969A
Universal Internet of Things terminal
CN209570928U
Smart home control device based on Internet of Things
CN214751383U
Internet of Things home control system based on Ali cloud
CN215599519U
Intelligent greenhouse monitoring control system based on Internet of Things
CN217279349U