All Projects → GCY → Atrial-Fibrillation-Detection-Blood-Pressure-Monitor-Oscillometric-Method-

GCY / Atrial-Fibrillation-Detection-Blood-Pressure-Monitor-Oscillometric-Method-

Licence: MIT license
Atrial Fibrillation Detection Blood Pressure Monitor (Oscillometric Method)

Programming Languages

c
50402 projects - #5 most used programming language
C++
36643 projects - #6 most used programming language
assembly
5116 projects

Projects that are alternatives of or similar to Atrial-Fibrillation-Detection-Blood-Pressure-Monitor-Oscillometric-Method-

pid-stm32f746
Embedded graphical interface for PID control
Stars: ✭ 29 (+3.57%)
Mutual labels:  stm32, pid-control
DHT11-DHT22-STM32-HAL
Библиотека для работы с датчиками DHT11/DHT22/AM2302/AM2301 на STM32
Stars: ✭ 26 (-7.14%)
Mutual labels:  stm32, stm32f4
automatic-ecg-diagnosis
Scripts and modules for training and testing neural network for ECG automatic classification. Companion code to the paper "Automatic diagnosis of the 12-lead ECG using a deep neural network".
Stars: ✭ 156 (+457.14%)
Mutual labels:  atrial-fibrillation, atrial-fibrillation-detection
stm32DevelopmentBoards
Development boards and software templates for STM32 MCU
Stars: ✭ 41 (+46.43%)
Mutual labels:  stm32, stm32f4
android-stm32-dfu-programmer
Android application programmer for STM32 microcontrollers using the DFU protocol
Stars: ✭ 77 (+175%)
Mutual labels:  stm32, stm32f4
DonkeyDrift
Open-source self-driving car based on DonkeyCar and programmable chassis
Stars: ✭ 15 (-46.43%)
Mutual labels:  stm32, pid-control
PrntrBoardV2
32-bit 3D Printer controller board using STM32F407 and replaceable TMC2660/2209 stepper drivers.
Stars: ✭ 31 (+10.71%)
Mutual labels:  stm32, stm32f4
STM32-base.github.io
Github Pages for the STM32-base project.
Stars: ✭ 27 (-3.57%)
Mutual labels:  stm32, stm32f4
STM32 HAL FREEMODBUS RTU
FreeMODBUS RTU port for STM32 HAL library
Stars: ✭ 111 (+296.43%)
Mutual labels:  stm32, stm32f4
STM32 TimerInterrupt
This library enables you to use Interrupt from Hardware Timers on an STM32F/L/H/G/WB/MP1-based board. These STM32F/L/H/G/WB/MP1 Hardware Timers, using Interrupt, still work even if other functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software timers using millis() or micr…
Stars: ✭ 27 (-3.57%)
Mutual labels:  stm32, stm32f4
Jled
Non-blocking LED controlling library for Arduino and friends.
Stars: ✭ 197 (+603.57%)
Mutual labels:  stm32
Blog
A set of various projects based on ESP8266, ESP32, ATtiny13, ATtiny85, ATtiny2313, ATmega8, ATmega328, ATmega32, STM32 and more.
Stars: ✭ 198 (+607.14%)
Mutual labels:  stm32
EthernetWebServer SSL
Simple TLS/SSL Ethernet WebServer, HTTP Client and WebSocket Client library for for AVR, Portenta_H7, Teensy, SAM DUE, SAMD21, SAMD51, STM32F/L/H/G/WB/MP1, nRF52 and RASPBERRY_PI_PICO boards using Ethernet shields W5100, W5200, W5500, ENC28J60 or Teensy 4.1 NativeEthernet/QNEthernet. It now supports Ethernet TLS/SSL Client. The library supports …
Stars: ✭ 40 (+42.86%)
Mutual labels:  stm32
oberon-07-compiler
Oberon-07 compiler for x64 (Windows, Linux), x86 (Windows, Linux, KolibriOS), MSP430x{1,2}xx, STM32 Cortex-M3
Stars: ✭ 45 (+60.71%)
Mutual labels:  stm32
Frosted
Frosted: Free POSIX OS for tiny embedded devices
Stars: ✭ 194 (+592.86%)
Mutual labels:  stm32
can-prog
Command-line tool to flashing devices by CAN-BUS
Stars: ✭ 66 (+135.71%)
Mutual labels:  stm32
Dapboot
DFU Bootloader for STM32 chips
Stars: ✭ 194 (+592.86%)
Mutual labels:  stm32
Runcpm
RunCPM is a multi-platform, portable, Z80 CP/M 2.2 emulator.
Stars: ✭ 192 (+585.71%)
Mutual labels:  stm32
Opensimplelidar
Open Source scanning laser rangefinder
Stars: ✭ 2,206 (+7778.57%)
Mutual labels:  stm32
STM32Primer2 GNSS Tracker
GNSS Tracker For STM32 Primer2
Stars: ✭ 24 (-14.29%)
Mutual labels:  stm32

Atrial-Fibrillation-Detection-Blood-Pressure-Monitor-Oscillometric-Method-

This project is electronic blood pressure monitor research platform with Oscillometric method, include SBP and DBP estimate algorithm, Atrial Fibrillation detection algorithm, calibration curve, GUI tool for fine-tune BP algorithm...etc, ofcourse, this is research use only.

alt text

Blood Pressure Measurement Oscillometric Method

The oscillometric method was first demonstrated in 1876 and involves the observation of oscillations in the sphygmomanometer cuff pressure which are caused by the oscillations of blood flow, It uses a sphygmomanometer cuff, like the auscultatory method, but with an electronic pressure sensor (transducer) to observe cuff pressure oscillations, electronics to automatically interpret them, and automatic inflation and deflation of the cuff. The pressure sensor should be calibrated periodically to maintain accuracy.

A new analysis of relevant anatomy, physiology and physics reveals the mechanisms underlying the production of cuff pressure oscillations as well as a way to extract systolic and diastolic pressures from the envelope of oscillations in any individual subject. Stiffness characteristics of the compressed artery segment can be extracted from the envelope shape to create an individualized mathematical model. The model is tested with a matrix of possible systolic and diastolic pressure values, and the minimum least squares difference between observed and predicted envelope functions indicates the best fit choices of systolic and diastolic pressure within the test matrix.

In practice the different methods do not give identical results; an algorithm and experimentally obtained coefficients are used to adjust the oscillometric results to give readings which match the auscultatory results as well as possible. Accurate extraction of systolic and diastolic pressures from the envelope of cuff pressure oscillations remains an open problem in biomedical engineering. Since many oscillometric devices have not been validated, caution must be given as most are not suitable in clinical and acute care settings.

via wiki.

Features

  • Blood Pressure Measurment - Systolic, Diastolic, Mean
  • Atrial Fibrillation Detection - Irregular Pulse Peak , Irregular Heart Beats
  • GUI Toos - Algorithm Finetune
  • ADC Clibration to Mercury Manometer Pressure - Polynomial Curve Fit
  • RAW Data Record

Hardware

Project create is Eagle PCB 8.1.0 .

V2 version, D1(BAT20) should be replaced with zero ohm resistor.

alt text

alt text

alt text

Key Component List

  • Electronics
    • TB6612FNG (for PUMP and VALVE PID control)
    • MPS-3117-006GC A2/A3(MEMS Wheatstone Bridge)
  • Mechatronic
    • 3V DC Air Pump Motor(JQB032-3A or DQB030-A-3V)
    • 3V DC Electric Solenoid Valve(JQF1-3C1/DC3V Mini 10mm*15mm)
  • Cuff and Tubing
    • 2mm*4mm Silicone Rubber Tubing x 2(20cm~30cm, for wrist cuff input and output)
    • 2mm*4mm Silicone Rubber Tubing x 3(5cm~10cm, for T Type connector)
    • 2mm*3mm T Type Plastic Barbed Connector
    • 2mm*3mm Straight Plastic Barbed Connector x 3
    • Wrist Air Cuff Input/Output(2 pinhole 2mm~3mm)

Configure for Motor Electric Drives With Independent Power Supply - Battery2(U$19)

  • J1, J2 pin1 connect to pin2 - battery2 charge
  • J1, J2 pin2 connect to pin3 - motor drive with independent power supply
  • JP1 pin1 connect to pin2 - motor drive with VCC
  • JP1 pin2 connect to pin3 - motor drive with independent power supply

Firmware

Build and Burn The .elf

  • 1.cd src/BPM
  • 2.make
  • 3.load main.elf

Key Parameters

PWM_Freq is DC Motor PWM frequency.
TIM_Prescaler = (168M/2)/1M = 84M
TIM_Period = TIMER_PWM_MAX/PWM_Freq = 1000

TIM = 84M / TIM_Prescaler = 1M
TIM = 1M / TIM_ClockDivision = 1M
1M / (TIM_Period + 1) = 1000Hz (1ms)


const uint16_t PWM_Freq = 1000;

ARR = TIMER_PWM_MAX;
CCR = 0 to TIMER_PWM_MAX = 0 to 100% PWM.
In this case, PID PWM step 1 to 100 mapped to 100000 to 1000000.
TIMER_PWM_33 and TIMER_PWM_40 is 33% and 40% PWM for calibration hand control.


const uint32_t PID_PWM_MIN = 1;
const uint32_t PID_PWM_MAX = 100;
const uint32_t TIMER_PWM_MIN = 100000;
const uint32_t TIMER_PWM_MAX; = 1000000;
const uint32_t TIMER_PWM_33 = 330000;
const uint32_t TIMER_PWM_40 = 400000;

This is PID parameter, you need to redefine in ResetMeasurementParameter() function.


Kp = 2, Ki = 0.3, Kd = 0.001; // for JQB032-3A

AC signal amplitude point of Systolic and Diastolic BP.


float as_am_value = 0.65f;
float ad_am_value = 0.7f;

Polynomial curve fitting is generated from 『Calibration ADC-DC to Mercury Manometer Pressure』, you'll need to create 『curve.csv』and execute PC-GUI software main.app or BPM.exe in the same folder, it will output the『equation.txt』.
e.g. degree = 2, equation.txt format is : (-1.0620516546)x^0+(0.1262915457)x^1+(-0.0000012119)x^2


float a[3] = {-0.0000012119f,0.1262915457f,-1.0620516546f};

If pulse_value_N / total_pulse_value_mean > IPP_Ratio, pulse_N is irregular pulse peak, and IPP ratio range 15%~25%.
If IPP number / total_pulse_number > IHB_Ratio, this measurement is irregular heart beat.
If two or more IHB of the three BP measurements, AF detected.


const float IPP_Ratio = 0.2f;
const float IHB_Ratio = 0.2f;

Operation Flowchart

alt text

DC/AC Signal Process Flowchart

alt text

Measurment Flowchart

alt text

BPM Mode Demo

Audi R8

Software

AFib-BPM GUI Demo

Audi R8

Build

  • Win10
    • 1.Open BPM.sln
    • 2.Rebuild
  • Mac High Sierra
    • 1.make

Dependence

  • Win10
    • wxWidgets 3.1.2
    • VS2017 - MSVC 10.0.17763-SDK
  • Mac High Sierra
    • wxWidgets 3.x
    • g++

Parameters Setup

When burning the firmware for the first time, you must set the PID control and blood pressure algorithm parameters. After the PC-Host and VCP are successfully connected, select the Tuning menu to adjust the parameters.

alt text
alt text

Display the parameters that have been set. If the parameters are unset, the value is "0xFFFFFFFF" in sector11 of flash. The PID parameters shown in the figure need to be divided by hundred. (for example, P = 290, in firmware, P is 2.9 .)

alt text

Mac High Sierra GUI

alt text

Win10 GUI

alt text

Operation Manual

  • Menu Tools -> VCP is connect to device.
  • "Ad/Am" and "As/Am" text box is Diastolic and Systolic BP Point of AC signal amplitude.
  • "Measurment" button is BP measurment after VCP connected.
  • "USB Mode" button is switch from "USB Mode"(Measurment) to "Calibration Mode", and vice versa.
  • "Pressurize" and "Leak" button for control mercury manometer high and low in calibration mode.

Oscillometric Method

The two chart below show AC signal types, all of types are correct.

Type1 AC Signal

alt text

Type2 AC Signal

alt text

Calibration ADC-DC to Mercury Manometer Pressure

Pressure calibration reference is Mercury Manometer(Sphygmomanometer) or Aneroid Sphygmomanometer, you can buy products from Yuwell, Welch Allyn...etc

PC-GUI Software Control Steps

  • 1.Connecting device and PC-GUI software.
  • 2.Click USB Mode button switch to Calibration Mode, after this, OLED display show you ADC0 value per-second.
  • 3.Control Mercury Manometer high and low with Presurize and Leak button.
  • 4.Record Mercury Manometer pressure point and OLED ADC0 value to 『curve.csv』file, at least 10-points and pressure range 0~250mmHg.
  • 5.checking curve.csv is located in the same folder as the PC-GUI software.
  • 6.Close PC-GUI software than reopen it, it will generate the『equation.txt』.
  • 7.copy equation and replace firmware parameter 『float a[3]』 in main.c.

Column A is ADC0-value, B is Mercury Manometer mmHg pressure.
alt text

Atrial Fibrillation In Oscillometric Method Detect Algorithm

Below are a few real world cases of the AFib(for example PCV, PAC), envelope wave lost some peaks.

Premature Atrial Contractions

alt text

alt text

Premature Ventricular Contractions

alt text

alt text

Reference

  • Kabutoya, T., Imai, Y., Hoshide, S., & Kario, K. (2017). Diagnostic accuracy of a new algorithm to detect atrial fibrillation in a home blood pressure monitor. The Journal of Clinical Hypertension, 19(11), 1143-1147.

  • Ogedegbe, G., & Pickering, T. (2010). Principles and techniques of blood pressure measurement. Cardiology clinics, 28(4), 571-586.

  • Babbs, C. F. (2012). Oscillometric measurement of systolic and diastolic blood pressures validated in a physiologic mathematical model. Biomedical engineering online, 11(1), 56.

  • Geddes, L. A., Voelz, M., Combs, C., Reiner, D., & Babbs, C. F. (1982). Characterization of the oscillometric method for measuring indirect blood pressure. Annals of biomedical engineering, 10(6), 271-280.

  • C++ Program for Polynomial Fit (Least Squares) : https://www.bragitoff.com/2015/09/c-program-for-polynomial-fit-least-squares/

LICENSE

MIT License

Copyright (c) 2019 Tony Guo

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

OSHW Certification

https://certification.oshwa.org/tw000002.html

alt text

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].