当前位置:网站首页>Bluetooth smart Bracelet system based on STM32 MCU
Bluetooth smart Bracelet system based on STM32 MCU
2022-07-28 22:40:00 【The poorest are beggars and immortals will always come out】
This smart Bracelet system includes the following : Step number record 、 Take your temperature 、 Heart rate measurement 、RTC Real time clock 、APP Look at the relevant data
Main hardware procurement links :
| stm Minimum system board | https://m.tb.cn/h.fNy7pcW?tk=XKLr2f8YwWD | Third package |
| BT06 Bluetooth module | bluetooth 3.0 modular SPP transparent transmission compatible HC-05/06 Slave JDY-31 Bluetooth module -tmall.com Tmall | |
| ADXL345 Acceleration sensor module | ADXL345 ADXL335 Digital The acceleration tilt angle sensor module senses Send information -tmall.com Tmall | The second set meal |
| Pulse Sensor Heart rate sensor | 1pcs pulsesensor pulse heart rate sensor open source hardwar- TaoBao (taobao.com) | The first set meal |
| DS18B20 Temperature sensor | DS18B20 chip Programmable digital thermometer / Temperature sensor TO-92 Direct insertion new - TaoBao (taobao.com) | |
| IIC 4 The needle OLED | 0.96 " OLED display SSD1306 Drive LCD 4/7 The needle IIC/SPI The interface is white, yellow and blue -tmall.com Tmall | Third package |
These purchase links are just for your reference , Be careful when shopping .
One 、 Physical display

Two 、 Principle explanation
1、 Heart rate measurement function

Heart rate refers to the number of heart beats in a minute , The dumbest way to get your heart rate is to count the number of pulses in a minute . But in this way, every time the heart rate is measured, you have to wait for a minute before you get the result , Extremely inefficient . Another way is to , Measure the time interval between two adjacent pulses , Divide that interval by one minute to get the heart rate . The advantage of this is that the pulse can be calculated in real time , Efficient . This leads to IBI and BPM The concept of two values :IBI: The interval between two adjacent pulses ( Company :ms)
BPM: heart rate , The number of heart beats in a minute
be BPM = 60 / IBI
Here is how to detect heart rate :
The primary goal is to recognize a pulse signal ( Because only by finding the pulse signal can time be calculated )
Identify the pulse by detecting the peak
( How to find the crest )
Set a threshold to judge the peak
( When the analog signal exceeds the set threshold , It is considered to have reached the peak )
( How much threshold should be set ? It can be a fixed value ?)
The threshold cannot be a fixed value , Dynamic threshold needs to be set
( Multiple acquisition , Find the maximum 、 minimum value , Perform relevant calculations )
Dynamically calculate the threshold
As for why the threshold cannot be set to a fixed value , Need to set dynamic threshold ? Because people have different pulse intensity at different times , It cannot be measured by a fixed value , Therefore, it is necessary to calculate the appropriate threshold at the current time , As shown in the figure below .

therefore , The measurement of pulse signal is divided into two steps :① First calculate the reference dynamic threshold
② Use the dynamic threshold to judge the peak , So as to find the wave crest
Find the pulse waveform , Calculate the time of two adjacent times
This design adopts the method of feature points , Define the signal rising to half of the amplitude as the characteristic point , In this way, the time interval between two characteristic points can be measured to obtain the time interval of two adjacent pulses .

As shown in the figure , The time interval between two adjacent feature points is IBI, And then use 60/IBI Is the heart rate .
2、 Number of steps
For the detection of the number of steps , Most designs use pressure sensors , This design adopts acceleration sensor , With “ The acceleration ” For related parameters , More research significance .

As shown in the figure ,ADXL345 The acceleration sensor can detect the acceleration in the three-axis direction , Among the features that can be used to analyze running or walking , We choose “ The acceleration ” As relevant parameters . individual ( And its related axes ) The motion of includes three components , They are forward (“ rolling ”)、 vertical (“ Yaw ”) And lateral (“ pitch ”).

Pictured , Let's consider the characteristics of walking . A step , We define it as the unit walking cycle . Walk with your left foot ( Shadowy ) Will produce corresponding acceleration , Speed up 、 Decelerate and reciprocate , And there will be a peak at some point . Through the capacitive voltage converter 、 Gain amplification 、 After filter and temperature compensation Voltage signal output similar to sinusoidal waveform .

As shown in the figure : Get waveforms in three directions , but Y The shaft waveform is stronger , The explanation is along Y Axis forward .
The rising edge of the waveform represents the acceleration rise , That is, people step on their legs ; The falling edge of the waveform represents the decrease of acceleration , That is, people close their legs .
3、OLED The screen shows
This project develops display function , The screen has two displays : One shows the perpetual calendar , Second, it shows the heart rate 、 They count 、 Temperature , Both displays use buttons K0 Switch .
① Display the perpetual calendar : By clicking K0 Switch to the time interface , When the time is wrong , Clickable K1 Press the key to enter the time setting interface , Press repeatedly K1 Set the year in chronological order 、 month 、 Japan 、 when 、 branch ( That is, by pressing the key K1 Set the time in different units , There are arrows in the screen >, Indicates the unit currently being set ) And then through K2、K3 Press the key to modify the time .
② Show physical status : When the sensor detects body temperature 、 They count 、 When indexes such as heart rate change , Update in real time , And every day 0:00 It will clear the number of steps , You can also use K2 Press the key to reset manually .

Physical condition display interface Real time clock Time setting interface
4、APP View the data
This design uses Bluetooth to transmit data , See the previous article about Bluetooth HC-05(ZS-040) Bluetooth module usage details ( Mobile phone and Bluetooth module 、 Mobile phone Bluetooth control MCU 、 Communication between a pair of Bluetooth )_ The poorest is begging for food 、 The blog that never dies will come out -CSDN Blog _zs040 How to use Bluetooth module
The receiving end of the mobile phone is a Bluetooth app, You can use some in the mall , You can also use AppInventor Development , Adopt graphical programming , It's simple , You can also master new knowledge by designing yourself , Learn more while you are young !!!!!! come on. !!!!!
About AppInventor Use , You can pay attention to a cloud platform “ Bafayun platform ”, It has a detailed introduction , You can also focus on b A blogger of the station “ Old witch's program world ”

5、 Thermometry
This design chooses 18b20, It's simpler , I won't repeat .
Welcome to correct and exchange , You can discuss the code together when you are free .
It's not easy to make , Thank you for your support , thank !!!!!!
-------------- A person who is working hard
边栏推荐
- Day3 classification management of Ruiji takeout project
- Why doesn't the icon on the elment plus icon input display
- Summary of common error types in JS
- 使用PCL批量将点云.bin文件转.pcd
- JVM -- custom class loader
- Excel-vba quick start (XIII. Common usage of date)
- PaddleNLP基于ERNIR3.0文本分类以中医疗搜索检索词意图分类(KUAKE-QIC)为例【多分类(单标签)】
- DOM programming + events
- Netease Yunxin 2022q2 product supply station, come and get your product supply plan!
- fatal error: io. h: No such file or directory
猜你喜欢

Day3 classification management of Ruiji takeout project

npm ERR code ETIMEDOUT npm ERR syscall connect npm ERR errno ETIMEDOUT npm ERR network reques...

使用PCL批量将点云.bin文件转.pcd

C language to realize string reverse order arrangement

Ultra detailed visual studio 2019 running littlevgl (lvgl) simulator

Sword finger offer II 055. Binary search tree iterator (medium binary search tree iterator)

JVM -- custom class loader

PaddleNLP基于ERNIR3.0文本分类以CAIL2018-SMALL数据集罪名预测任务为例【多标签】
![[connect set-top box] - use ADB command line to connect ec6108v9 Huawei Yuehe box wirelessly](/img/ab/624e9a3240416f8445c908378310ad.png)
[connect set-top box] - use ADB command line to connect ec6108v9 Huawei Yuehe box wirelessly

Netease Yunxin 2022q2 product supply station, come and get your product supply plan!
随机推荐
微信小程序使用canvas绘图,圆形头像,网络背景图,文字,虚线,直线
ngx+sql环境离线安装日志(rpm安装)
How about the actual use effect of common source oscilloscope
Sword finger offer II 067. maximum XOR (medium prefix tree bit operation array)
Solve Jupiter: the term 'Jupiter' is not recognized as the name of a cmdlet, function, script file
PHP库neo4j怎么安装及使用
Which is the file transfer command in the basic services of the Internet
STM32 - interrupt overview (interrupt priority)
redis相关
Ultra detailed visual studio 2019 running littlevgl (lvgl) simulator
DOM programming + events
STM32 - systick timer (cubemx configures systick)
使用PCL批量将点云.bin文件转.pcd
Solve various problems of sudo rosdep init and rosdep update
elment-plus图标input上面带的图标为什么不显示
20-09-27 the project is migrated to Alibaba toss record (the network card order makes the service unable to connect to DB through haproxy)
Ngx+sql environment offline installation log (RPM installation)
842. Arrange numbers
Lvs+keepalived high availability deployment practical application
Chrome encountered a problem when debugging the code. After modifying and saving the code in vscode, chrome did not update after refreshing