Frontiers in Computing and Intelligent Systems ISSN: 2832-6024 | Vol. 8, No. 3, 2024 49 Research on Wearable Devices Based on the Internet of Things Liu Ao, Xude Zhang, Piaoyun Wang, Ruiwen Wang, Zhengju Jia Kaili College, Kaili Guizhou, 556011, China Abstract: Wearable devices are closely related to people's lives. This project is based on WIFI wireless communication transmission technology, supplemented by Cortex-M3 microprocessor and MQ-7 gas sensor to design a wearable device. This wearable device can not only achieve basic clock timing, but also achieve functions such as CO concentration detection, voice intelligent recognition, and automatic alarm. In addition, the device adopts an embedded design and adds blockchain technology to achieve data information security and privacy protection. Keywords: Wearable Devices; Bluetooth WIFI; Cortex-M3 Microprocessor; Gas Sensor. 1. Introduction In modern times, people are paying more and more attention to their own health issues with the development of the times, but their awareness of diet and indoor environmental safety is still very shallow. The most common example is carbon monoxide gas poisoning, which leads to death. The reason why carbon monoxide can pose a threat to human life is because CO can bind to the carrier protein for transporting oxygen in the human body, which leads to insufficient oxygen supply to the body. Mild symptoms can include severe dizziness, headaches, and even death. In order to improve people's understanding of CO gas and reduce the occurrence of such death events, this project is based on the ESP8266 WIFI wireless communication transmission module, and uses hardware devices such as Cortex-M3 microprocessors and MQ-7 gas sensors to design an intelligent wearable device. It not only adds some new features to the original functions of wearable devices, but also allows people to track the people wearing the device in real time and let the wearer know the concentration of CO in their current environment in a timely manner, thereby reducing the incidence of such events. 2. Overall Structural Design This wearable device is an intelligent wearable product designed on the basis of the convenient mode of high-speed transmission of data information through the Internet of Things. The overall system structure design is shown in Figure 1, which uses CO concentration as the sample carrier for data collection and uses Cortex-M3 microprocessor The ESP8266 WIFI wireless communication module is used to complete functions such as automatic alarm, detection of the security of the user's current environment when wearing the product, and automatic voice conversion. Figure 1. Overall Structure Design Framework of the System 50 3. Hardware Design This wearable device is based on the development board STM32F103C8T6 and adds modules for information transmission, collection, and display. By using the ESP8266 WIFI wireless communication module, the collected data is transmitted to the mobile end and the main control board for unified management; Add a GPS positioning module to synchronize and update the current location information of the device in real-time. Utilize embedded technology to integrate the relevant system operation modules on a small circuit board, and maximize the effect in a small space. As shown in Figure 2: Figure 2. System Hardware Design Block Diagram 3.1. Wireless Transmission Module 3.1.1. WIFI Performance The ESP8266 WIFI module can transmit data faster and serve as a carrier for intelligent speech recognition, which is beneficial for smoother device operation. At the same time, this module can complete the remote transmission of data information that users need, solving the problem of information loss caused by obstacles. After analyzing different types of WIFI modules, ESP8266 was ultimately chosen for this project. The ESP8266 development board not only integrates WIFI function, but also adds TCP/IP protocol stack. At the same time, it uses serial port to connect with STM32F103 microcontroller to complete device communication. In addition, it also has the characteristics of low cost, high cost-effectiveness, and a wide range of applications, which is very in line with the core proposition of this project. 3.1.2. Working Principle Connecting ESP8266 to MCU, controlling ESP8266 through AT commands and serial communication functions, can generate connectable WIFI signals, and then connect wearable devices to the WIFI signals emitted by ESP8266, The MCU transmits the packaged data to wearable devices through a serial port and displays it. Figure 3. Schematic diagram of WIFI module 3.2. Detection of CO For gas detection, there are many types of gas sensors available on the market, and for this project, the MQ-7 gas sensor is the optimal choice. This mainly depends on the variety of gas types detected by the gas sensor, and the corresponding functions can be adjusted according to the requirements of the equipment. The circuit design diagram is as follows: The MQ-7 sensor is mainly used to detect the concentration of CO, which not only has the advantages of ultra-high sensitivity, fast response speed, and strong stability, but also can accurately exclude other non combustible irritating gases, with a monitoring range of 10-10000ppm. This sensor adopts a high and low temperature cycle detection method. Once the detected concentration of carbon monoxide increases and the resistance decreases, its corresponding conductivity will also increase and output an analog signal. At the receiving end, the analog-to-digital converter converts the received electrical signal into a digital signal, which is then displayed on the display screen. 51 Figure 4. MQ-7 circuit design diagram 3.3. Main Control Module To meet the requirements of small size, easy portability, and low power consumption of wearable devices, after comparing the performance and volume data of various types of MCUs, the STM32 series microcontroller was ultimately chosen for this project. Compared to other microcontrollers, this series of microcontrollers has low power consumption, high integration within the chip, and flexible static memory, which makes its cost-effectiveness very considerable. Among the STM32 series microcontrollers, the STM32F103C8T6 microcontroller was specifically selected. This microcontroller adopts LQF48 pin packaging design, with a working voltage range of 2V to 3.6V, ensuring stable performance and meeting the low power consumption requirements of wearable devices. The working temperature is -40°C-85°C, and it has a large memory and abundant peripheral resources, which greatly meets the system functions developed in this project and effectively reduces hardware development costs. The minimum system of STM32F103C8T6 microcontroller is mainly composed of reset circuit, power circuit, and crystal oscillator circuit. Its clock can not only be provided by internal crystal oscillator, but also generated by external clock circuit. The clock circuit YSCLK can choose HSI HSE or PLL as the clock source. The partial circuit of STM32F103C8T6 is shown in Figure 5. Figure 5. Partial Circuit Diagram of STM32F103C8T6 From the above figure, it can be seen that the STM32F103C8T6 microcontroller contains more than 40 pins, and each pin corresponds to the corresponding function and multiplexing function. In order to achieve the implementation of the equipment function in this project and collect the required data information, it is necessary to correspond the function of each pin to the multiplexing function one by one. These pins include the power management circuit, reset circuit, crystal oscillator circuit, LCD display, buttons, and corresponding interface pins of each sensor module that enable the system to function properly. 3.4. Data Acquisition Module Install a monitoring device system on the data acquisition module, which can collect data values of indoor CO 52 concentration. The values are automatically compared with the agreed data in the system and transmitted to the management platform through wireless communication transmission modules. The server obtains the data reported by the monitoring device according to the interface specifications and standards agreed upon by the platform, and relevant personnel handle abnormal data. 3.5. Automatic Alarm Module The staff input the standard CO gas concentration into the agreed conditions of the automatic alarm mechanism. When the MQ-7 gas sensing element circuit inside the equipment detects that the concentration of carbon monoxide in the indoor environment exceeds the national air quality standard, the alarm mechanism is automatically activated and the relevant abnormal values are transmitted to the terminal. At the same time, the current gas concentration value will also be displayed in real-time on the equipment display screen; When the indoor gas concentration is lower than the set value, the system returns to normal and stops alarming. The circuit principle is shown in the following figure: Figure 6. Automatic Alarm Principle Diagram 3.6. Speech Intelligent Recognition The speech intelligent recognition module added in this project is based on the LD3320 chip, which can receive non- specific person voice. The interface wiring diagram is shown in Figure 7. Burn the edited program code into the LD3320 chip, start the system, debug and run the module, complete the recognition of voice signals, transmit the recognized signals to the input of the MCU, convert the data, and finally display them on the display screen. Figure 7. Interface Wiring Definition Diagram 3.7. Blockchain Design Blockchain is a new technology for data recording, storage, and transmission, which can achieve mutual trust and value transfer without relying on third-party trust institutions. In wearable devices, based on the decentralized, immutable, and distributed characteristics of blockchain, it is applied for identity authentication and data security protection. The data generated by the device is stored on different servers, and encryption algorithms and consensus mechanisms are adopted to ensure that user information is not tampered with, deleted, or lost. In addition, blockchain also has the characteristics of smart contracts, which can automate the control and interaction between devices. For example, when a threshold for carbon monoxide concentration is detected, the smart contract can transmit abnormal data to wearable devices on its own and control the alarm to sound an alarm. 4. Software Design When the entire system is powered on, STM32F103C8T6 MCU power on reset occurs first, and the operation of the system main program starts. After the initialization program starts smoothly, the LCD screen immediately displays a normal working state. Then the system starts scanning the buttons to detect if there are any input commands for the buttons. Once a button is detected as pressed, the system will respond quickly and process the instructions entered by the button accordingly. After processing, the material information required for control set by the system is collected, and the data received by the receiving end is saved in the memory. After A/D conversion, this data is then transmitted to the MCU, MCU control data is displayed on the LCD screen, allowing people to obtain real-time data. When the data transmitted to the microcontroller is compared with the standard threshold, if the received data is not less than the standard threshold, the MCU will send an alarm signal to the automatic alarm module, the buzzer will emit a sharp sound, and the indicator light will continue to flash, reminding the user to take timely processing measures, and finally return to the button scanning location; If the received data is less than the standard threshold, the program will directly return to the key scan and start a new cycle. When the microcontroller receives the speech signal sent by the intelligent speech recognition module, it converts the analog signal into a digital signal through an internal analog-to-digital converter, and broadcasts the converted speech information through a buzzer. 53 Figure 8. Overall System Software Block Diagram 5. Conclusion This article uses the STM32F103C8T6 development board as the core controller, equipped with relevant sensors, automatic alarm system, and voice intelligent recognition system. The sensors of each module transmit the collected data to the terminal management system and compare it with the initial values agreed upon by the system. Real time detection and transmission of indoor CO concentration are completed. When the data does not match, the equipment automatically starts the alarm device. In addition, the intelligent manhole cover system also assists with a positioning and navigation system and blockchain information privacy security protection, allowing users to enjoy the convenience brought by technology without worrying about personal information leakage, thereby affecting their quality of life. Acknowledgments College Student Innovation and Entrepreneurship Training Program Project (S202210669037), Guizhou Provincial Department of Education Youth Science and Technology Talent Growth Project (Qian Jiaohe KY Zi [2022] No. 079). References [1] Gao Haiwen. Design and Implementation of Indoor Air Quality Testing Instrument Based on STM32 [D]. East China Jiaotong University, 2018. [2] Liu Qiaoping, Jie Qiyang, Wang Tingting, et al. Design of gas alarm device based on STC89C52 microcontroller [J]. Henan Science, 2018,36 (08). [3] Xie Zhenyu, Liu Wei. Design of Smart Home Voice Control System Based on Microcontroller [J]. Science and Technology Innovation, 2021, (31). [4] Zhong Chenfan. Design and Development of Speech Recognition System Based on LD3320 Chip [D]. Nanjing University, 2015. [5] Zhao Jintao. Design and Application of Automatic Irrigation System for Farmland Based on Wifi [D]. China University of Mining and Technology, 2020. [6] Yan Wenting. Research and Implementation of Data Transmission Based on Bluetooth Technology [D]. Nanjing University of Technology, 2004. [7] Ma Tianyue. Design and Implementation of IoT Module Based on ESP8266Wi Fi Chip [D]. Shanghai Jiao Tong University, 2017.