Shenzhen ZTRON Microelectronics Co., Ltd
Telephone
0755-8299 4126

Personal consumer electronics

Smart watch circuit control program development


This article designs a multifunctional smart watch that can monitor human body temperature and count exercise steps in real time. Body temperature is the result of the body's continuous metabolism. At the same time, body temperature is an important guarantee for the normal functioning of the body's functional activities. Under normal circumstances, the human body temperature does not change with changes in the external environment temperature and remains at around 37°C. But when certain functions in the human body change or lesions develop in certain parts, the constant body temperature will change. In clinical medicine, body temperature is an important physiological parameter. The patient's body temperature provides doctors with important information about physiological conditions, and can also actively prevent and warn some major diseases or hidden health problems in the body. effect. Therefore, people need and must understand their own body temperature in real time to maintain their body temperature in a relatively stable state.


In response to people's demand for real-time monitoring of body temperature, this paper designs a smart multi-functional watch with a 128×64 OLED display. It mainly uses STM32F103C8T6 single-chip microcomputer as the main control unit of the system, and uses TMP100 designed and produced by Texas Instruments as a temperature acquisition sensor. The watch can record collected data and daily exercise volume in real time, and monitor human body temperature in real time. When users obtain their own health data, they can take corresponding measures to keep themselves healthy. On this basis, this paper adopts the main control chip and peripheral devices with lower power consumption to improve the battery life of the device and optimize the user interface, so that the device can be truly used in life and provide the possibility for real-time health monitoring.


1. Function introduction of smart watch system


The smart watch designed in this article mainly has clock function, real-time body temperature detection function and step counting function.


(1) In the clock function interface, the user can choose to manually calibrate the time. (2) Under the body temperature detection function interface, users can check their own body temperature at the moment and the changes in their body temperature that day. (3) Under the pedometer function interface, users can view the accumulated steps of the day and understand their own exercise level.


In addition, once the user's body temperature drops or rises, below or exceeds the threshold, the system will send a warning to the user to remind the user that the body temperature is in an abnormal state at the moment, and the user can deal with it in time according to his own situation.


2. Smart watch hardware design


2.1 Smart Watch Hardware Composition and Principle


The hardware of the multifunctional smart watch system is mainly composed of a power management module, a main control chip module, a temperature sensor module, an acceleration sensor module, an OLED liquid crystal display and buttons. The composition and connection relationship of the hardware system are shown in Figure 2. The power management module converts the unstable battery voltage into the 3.3V stable voltage required by the system and delivers it to each module. The main control chip acquires and collects data from the temperature sensor and the acceleration sensor, performs algorithmic processing on the data, and finally displays it through the human-computer interaction module.


2.2 Smart watch hardware module design


STM32F103C8T6 is a microcontroller based on the ARM 32-bit CortextM3 core. It has a wide voltage supply range of 2.0~3.6V, the CPU operating frequency can reach up to 72MHz, and has single-cycle multiplication instructions and hardware division functions, as well as a programmable priority interrupt system. At the same time, it also has 64KB FLASH memory and 20KB SRAM memory, and integrates a wealth of on-chip peripherals, such as watchdogs, timers, GPIO ports, DMA controllers, ADC, UART, SPI interfaces, I2C interfaces, etc., with low cost Low cost, fast speed, high cost performance and other advantages.


The human body temperature acquisition sensor uses TMP100 produced by Texas Instruments. TMP100 is a two-wire serial output temperature sensor in SOT23-6 package. It does not require other components and has an accuracy of up to 0.0625°C. In addition, TMP100 has compatibility with system management bus and I2C interface, and can mount 8 devices on the bus. The operating temperature is -55~125℃, and the measurement accuracy can be selected through programming. The device address of TMP100 is determined by the ADD0 and ADD12 pins. The relationship between pin input and device address is listed in Table 1. According to the design principle and the grounding of the ADD0 and ADD1 pins in the figure, the device address of TMP100 should be 0x48.


The acceleration sensor module uses Freescale, which is a relatively new MMA8452 acceleration sensor. Freescale is an intelligent low-power, three-axis, capacitive micromachined acceleration sensor with 12-bit resolution. Its main features are as follows:


(1) You can feel the acceleration signals of three degrees of freedom, X, Y, and Z, and perceive human body motion information in all directions.

(2) With optional range of ±2g/±4g/±8g. The sensitivity of the sensor is 1024 digits/g in the ±2g range, and the sensitivity accuracy is ±2.5%.


The collected acceleration data can be output in real time through the high-pass filter inside the sensor. The cutoff frequency of the filter can be set through software, or it can be output directly without filtering. The output signal is converted into a 12-bit digital signal and output through the I2C interface. The output data rate is adjustable between 1.25~800Hz. The power management chip uses the TPS79333 designed and produced by Texas Instruments. It has ultra-low noise, high PSRR, fast radio frequency, and high-level enabled 200mA low-dropout voltage regulator, which can stabilize the power supply voltage of 3.7~5V at 3.3V. It has a small size Small size, high efficiency, low noise and so on.


3. Smart watch system software design


3.1 Construction of the main framework of the smart watch program


This article is designed to use an operating framework that combines the main loop and timer interrupts. The OLED display function is implemented in the main loop. The timer can perform data collection and algorithm processing on the temperature and acceleration sensors at regular intervals.


3.2 Clock function design and implementation


The clock module is mainly based on timer interrupts. When a timer interrupt is turned on, the interrupt time is 0.1s. A total of 600 times plus 1 minute, and a total of 60 minutes plus 1 hour.


3.3 Design and implementation of body temperature monitoring function


TSP100 temperature sensor is a digital sensor with I2C communication method. ADD0 and ADD1 are connected to ground at the same time. According to the table, the device address is 0x90. After initializing the I2C of STM32F103C8T6, the data collected by TSP100 can be obtained. Compared with other equivalent sensors, the TSP100 temperature sensor has higher accuracy, but it will also produce some noise due to environmental and other factors (the noise is controllable). This article uses median filtering to solve this problem.


3.4 Design and implementation of step recording function


The MMA8452 acceleration sensor is a digital output sensor that collects temperature in the same way. The difference is that the acceleration sensor is an inertial sensor and can show good stability in a static state, but its data changes greatly after movement. If the return value of the accelerometer in motion is set as the X axis and the value as the Y axis, it will show a smooth curve when it is static, but it will be chaotic noise when it is moving, so it is very difficult to filter the collected values of the acceleration sensor. necessary. This design uses a combination of low-pass filtering and anti-pulse interference average filtering.


When the data collected by the acceleration sensor is processed, the currently obtained value is the actual value by default, and then the data is analyzed to convert it into the required number of steps. According to research, distance, speed, acceleration, etc. can be used as parameters to describe the walking state of the human body. In recent years, due to the rapid development and superior characteristics of MEMS acceleration sensors, they have been widely used for human motion detection. When walking, the feet, legs, waist, and arms are all moving and will produce corresponding accelerations. The acceleration signal in the vertical direction changes the most. Analysis of the process of human walking: when the foot leaves the ground, it is the beginning of a step. At this time, due to the reaction force of the ground, the vertical acceleration begins to increase, and the center of gravity of the body moves upward. When the foot reaches the highest position, the vertical acceleration reaches the maximum, and then the foot moves toward During the downward movement, the vertical acceleration begins to decrease until the foot touches the ground, the acceleration decreases to the minimum value, and then the next step occurs. It is feasible to use the vertical acceleration of the waist to detect the number of steps. The number of walking steps can be obtained by detecting the peak acceleration.


A pair of continuous wave peaks and wave troughs represents a step of human walking. This article uses the method of counting wave peaks to count the number of steps. Since human movement generally does not exceed 5 steps/s, that is, theoretically there will be no more than 5 wave peaks within 1 second, and the time difference between two consecutive wave peaks will not be less than 0.2s. Set the sampling frequency to 50 times/s, and record the sampling time t and the Z-axis acceleration information Acc. If the Acc value of a point is greater than the two sampling values before and after, it is regarded as a maximum value and the time difference Δt between the information and the previous extreme value and the Acc value are stored in a two-dimensional linked list. The time difference Δt represents the time difference between two hypothetical steps. If Δt is less than 0.2s, the smaller Acc of the two maximum values will be regarded as sampling noise, removed from the two-dimensional linked list, and the remaining data will be combined with Compared with the previous record in the linked list, if it is greater than 0.2s and the Acc value is 20% or more smaller than the previous and previous Acc values, it is also regarded as noise and removed. The remaining maximum value is determined as an effective pace. Finally, the system can obtain more accurate step counting results.


epilogue


This article designs a smart wearable multi-function watch that can realize real-time monitoring of human body temperature and real-time statistics of exercise steps. Through the combination of theory and practice, starting from hardware implementation and software implementation, the design process of software and hardware is clearly demonstrated and solutions are provided. It can be seen from the implementation results that the design scheme of this article is feasible and can realize real-time monitoring of human body temperature and real-time recording of personal daily exercise. When the body temperature is at an abnormal data value, the smart watch can give corresponding prompts and warnings. , so as to facilitate users to make timely decisions on their own health status based on the obtained body temperature and exercise data.


The above is the smart watch development example introduced to you by Shenzhen Zuchuang Microelectronics Co., Ltd. If you have smart watch solution development needs, you can rest assured to leave it to us. We represent a variety of single-chip microcomputers, voice chips, dual-mode Bluetooth ICs, and wifi chips. Brands include Songhan MCU, Yingguang MCU, Jerry Bluetooth, Ankai Bluetooth, Allwinner, and Realtek. Our technical services include: PCB design, microcontroller development, Bluetooth solutions, software and hardware custom development, APP development, small program development, WeChat official account development, etc. It can also undertake the design of intelligent electronic products, the development of living appliances, the research and development of beauty equipment, the application of Internet of things platform, the smart home control system, the development of TWS earphones, Bluetooth earphone speakers, the development of children's educational toys, the design of electronic education products, etc.

  • TOP