This paper mainly studies the design of the hardware structure and software structure of smart watches, and studies the design of Android mobile phone APP. The hardware and software functions of the wristband need to be defined based on the function. The hardware structure includes STC12C5A60S2 microcontroller, three-axis digital accelerometer ADXL345, and Bluetooth module HC-05. The wristband transmits health data to the health APP via Bluetooth, and displays it on the mobile phone screen. It also reminds users through vibration at critical moments.
The software functions are reflected in three parts: power monitoring, exercise monitoring and sleep monitoring. When the bracelet is in exercise monitoring, the number of exercise steps can be calculated, and when the pre-set number of exercise steps is reached, it will vibrate to remind you; when in sleep monitoring, the total sleep time, light sleep time and deep sleep time of the day can be counted; at the same time, the bracelet also needs to send power monitoring to the mobile terminal application.
01 System operation process
The mobile phone APP relies on Bluetooth to transmit different control characters to the watch. The microcontroller responds to the serial port receiving interrupt and judges the content in the receiving register, and performs corresponding operations to realize the control of the bracelet.
02 Pedometer Algorithm Design
When users walk, the wearing position and direction of portable devices such as bracelets are random, so it is unreliable to analyze only one axis of the three-axis acceleration sensor. Therefore, after collecting the three-axis acceleration information, this system first performs acceleration synthesis, that is, vector summation, and then performs gait analysis.
It can be seen that the acceleration curves are irregular, but the synthetic acceleration curve after vector summation can better reflect the acceleration changes of the human body when walking.
After obtaining the synthetic acceleration, the digital filter is used for filtering, which can effectively eliminate the misjudgment of the system caused by jitter. The synthetic acceleration curve is filtered by recursive average filtering and limiting filtering. In a jitter test, the synthetic acceleration curve after digital filtering is shown in the figure.
The results after digital filtering are used for gait analysis, and the three conditions for determining a valid step count are:
1) The curve crosses the dynamic threshold downward. The dynamic threshold is updated every 1 second, and the average of the maximum and minimum values generated in the previous second is taken.
2) The frequency of human walking is between 0.5 and 5 Hz, that is, the time interval between two step counts must be within the time window of 0.2 to 2 s, otherwise it will be invalid.
3) The acceleration change caused by human walking will have a peak and a trough, and its peak value must be greater than the preset value, which is set to 1.5 m/s2 in this system.
03 Database Design
Since the application needs to run in the hardware system, the common large commercial databases such as Sqlserver and DB2 do not meet the requirements of the embedded system for being simple, small and sufficient. At the same time, the Android mobile intelligent operating system comes with an embedded lightweight database SQLite database, which has good embedded system applicability and can meet the needs of software operation and products. The characteristics of the SQLite database mainly include: independence, non-service, zero configuration, meta-processing and openness. These characteristics not only ensure the simplicity and speed of database operation, but also ensure the security of database data.
When we design a database, we must ensure that the functions we want to achieve are met. In addition, in order to make the database particularly clear, we finally present the database in the form of two tables, one for storing sleep information and the other for storing exercise time.
04 Hardware module design
05 Application software design
The application software layer contains all the functions of this smart device. It is an interface for human-computer interaction and provides direct services to users. Here, the upper-layer application development of this smart device is basically the research on mobile phone APP based on Android mobile intelligent operating system, so the content in traditional system software development can be used in the mobile phone APP software development of this smart device. According to the working idea of "overall architecture, integrated development, step-by-step implementation, and continuous improvement", this mobile phone APP should have complete exercise and sleep data. It is also for the purpose of making maintenance more convenient and easier to use in the future. On this basis, it should also have a comfortable and beautiful interface, so that users can have a good visual experience.
In terms of functions, the health application software of the smart health watch needs to monitor the user's sleep and exercise, and organize the user's exercise data and sleep data during use. Because this smart watch should be used together with the mobile phone, all the organized information is finally sent to the mobile phone.
The user can observe the data of his/her exercise and sleep during use through this APP, and monitor whether he/she has completed the task according to the preset value, so as to monitor whether the user has completed his/her task, and let the user persist in exercising and improve his/her physical fitness. On this basis, the mobile phone APP should also send the sorted information to the mobile phone and read the preset information.
According to the user's requirements for functions, we divide the mobile phone APP into three parts: power management module, motion monitoring module and sleep monitoring module. On this basis, the motion detection module is divided into two parts: the number of steps taken by the user during use and the vibration reminder when the preset number of steps is reached; the sleep detection module is divided into three parts: the total sleep time during use, the deep sleep time during use and the light sleep time during use.
This mobile APP mainly has three parts. First, the user should transmit information to the health management module of this mobile APP according to the mobile phone, and transmit the user's expected health information input by the user on the mobile phone to the program on the watch for health monitoring. The mobile APP is mainly for the purpose of monitoring exercise quality and sleep quality, so it should include two modules related to health monitoring, namely: exercise monitoring module and sleep monitoring module, to monitor the user in use.
Among them, the health management module is a sports monitoring information setting module. The watch side will receive the pre-set information entered by the user on the mobile phone side, and then process the information. The information of each submodule is used by other submodules.
The motion detection module is mainly divided into two parts, namely the total number of steps taken by the user in use and the motion reminder module when the preset number of steps is reached. When the working mode of the health application software is the motion monitoring mode, the application software user obtains the user's walking event from the underlying accelerometer (ADXL345) driver and counts the number of steps based on time.
The sleep detection module is mainly divided into three parts, which are to count the user's longest sleep time, deep sleep time and light sleep time. At this time, the running state of the mobile phone APP should be the sleep monitoring state. The application software obtains the user's turning over event from the underlying acceleration sensor (ADXL345) driver, and counts the user's turning over frequency based on time. At the same time, according to the set health data and statistical algorithms, the user's total sleep time, total light sleep time, and total deep sleep time are counted based on time.
The power monitoring function monitors the remaining power of the watch when it is currently in use, and displays it on the top of the mobile phone APP screen, so as to achieve real-time monitoring of the watch's power to avoid affecting the user's normal use due to insufficient power.
Previous article:Design of barcode scanning system based on single chip microcomputer
Next article:51 single chip microcomputer - digital tube dynamic display
Recommended ReadingLatest update time:2024-11-23 11:39
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- [Start at 10:30] Interpretation of TI's latest smart lock, visual doorbell, and network camera solutions, and recommendations for its core components
- C6678 multi-core DSP development - connected domain marking of vlib application
- Altium Designer v20.1.10.176
- After the stm32 timer is set to input capture, can the level of TI1 be changed by software?
- DSP library expands TI's embedded vision engine for driver assistance systems
- CMOS and TTL
- STM32 Cube study notes (16 articles)
- 3D Printer Controller Project Report
- STM32 HAL library UART interrupt reception issue
- 3 RTC configuration and timed wake-up