AntonKilk / FA_app

algorhytm to identify FA rhytm
3 stars 1 forks source link

Mobile Application #8

Open ivan-kleshnin opened 4 years ago

ivan-kleshnin commented 4 years ago

How to measure human pulse?

React to OS connector?

Raw beat series?

dmitrij-schmidt commented 4 years ago

https://dzone.com/articles/miband-3-and-react-native-partnbsp1 https://dzone.com/articles/miband-3-and-react-native-part-two https://github.com/Spayker/rn-miband-connector https://medium.com/machine-learning-world/how-i-hacked-xiaomi-miband-2-to-control-it-from-linux-a5bd2f36d3ad

dmitrij-schmidt commented 4 years ago

Basic assumption is that:

Once the "Measurement" button pushed, the app counts consecutive heartbeats for approximately 10-15 seconds.

Wrist-worn wearables might be not the best option:

  1. Unpredictable results 1.1 if worn too tightly, the band can interfere with blood flow and affect the results 1.2 if worn too loosely, the optical heart-rate monitor may not capture a heart rate at all
  2. Inaccurate data 2.1 most wrist-worn wearables (watches/bands) seem to provide average BPM data and not real time beat series. 2.2 for Xiaomi MiBand 3 (test device), single measurement lasts ~12 seconds. It is unclear whether raw data can be obtained without affecting device's OS.

More research is needed, possibly via

ivan-kleshnin commented 4 years ago

It would be great if @dmitrij-schmidt take a look at our options this week, so we could decide about the rationality of going mobile. If it's too hard (expensive in terms of our time) I'd rather not and limit ourselves with input emulation.

dmitrij-schmidt commented 4 years ago

I'll check these two tonight and see if I can get any meaningful result. https://github.com/creotiv/MiBand2 https://github.com/vshymanskyy/miband-js (specifically https://github.com/vshymanskyy/miband-js/issues/20)

dmitrij-schmidt commented 4 years ago

I do not see a way to treat my MiBand as a consistent source of data. I am attaching three consecutive runs of miband-js demo app run from Chrome on Xiaomi Redmi Note 5.

It does connect to the band, but amount of registered beats during 30s measurement is different every time, what can lead to biased results.

Screenshot_2019-11-19-22-27-11-862_com android chrome Screenshot_2019-11-19-22-28-31-818_com android chrome Screenshot_2019-11-19-22-25-48-021_com android chrome

dmitrij-schmidt commented 4 years ago

Further comments:

  1. I was not able to test miband-js locally, since my laptop doesn't have BT (or has some kind of issues with it). I'll check tomorrow if I still have my USB BT dongle, and try again.
  2. For some reason, I was also not able to test it on my web server (I have PHP only environment, without Node.js support so couldn't build on the server itself)
    • using locally built files
    • using index.html and linked *.js file copied from working demo in original author's repo
  3. Working demo ( github ) uses a lot of async with timeouts. I wonder if we could listen for like 10 consecutive pingbacks from the wearable device and try to estimate the ratio between beats from there.
  4. I did 10 consecutive runs via demo app, just as on screens in previous comment. Here are the results
    [
    [90, 92, 94, 92, 90, 91, 92, 91],
    [90, 88, 88, 87, 86],
    [88, 88, 90, 91, 90, 88],
    [88, 86, 82, 84, 83, 84, 85],
    [98, 84, 86, 88,  90, 88, 87, 88],
    [88, 90, 88, 88, 89, 88, 87],
    [80, 83, 84, 86, 85, 84],
    [84, 83, 80, 80, 81, 82],
    [86, 84, 82, 81, 82],
    [86, 86, 84, 86, 85, 86, 86]
    ]

    @ivan-kleshnin - if we decide to go on with this and not with mock data, I might need some help getting this demo app up and running.

ivan-kleshnin commented 4 years ago

I think the best way to go with such app/project would be to create its own hardware. Because, as we see, mobile phones and other "standard" wearable devices do not provide a) raw pulse series, only rates in the best case b) results are innaccurate.

I think our goals in this project is to a) learn something new b) get a valuable record in portfolio. If the current hardware is problematic it's best to reposition this project as an IDEA CONCEPT.

If our progress is well described, it's not hard to imagine that some investor can become interested and sponsor a hardware (and further software) development. At least, we have to make it look like this which will satisfy our goals.

The project on itself is a tool, not a goal. Therefore, I'd like us to agree on the "concept project" (instead of MVP) positioning so we can move further. It's normal for a non-trivial project to delay/suspend an MVP and elaborate concepts instead.

If we agree, we should:

1) Make a web application which emulates a device and mobile application (filling our missing "hardware + mobile app" piece). 2) Make a web admin panel (real) 3) Keep going with docs / prototypes / images / design

cc @AntonKilk

dmitrij-schmidt commented 4 years ago

@ivan-kleshnin - I totally agree on proposed above.

@AntonKilk - can you please have a look how much of a competitor is this company to us? https://elitehrv.com/ IMO they did good job defining compatibility requirements:

To accurately measure Heart Rate Variability, your heart rate monitor of choice must:

  • Capture and transmit accurate R-R Intervals (also called Inter-beat Intervals or IBIs)
  • Transmit the unaltered R-R intervals via Bluetooth 4.0 or ANT+ (ANT+ receiving only available on certain mobile devices)

they also have compatible and not compatible devices listed here, as well as their own device, which isn't exactly a wearable https://elitehrv.com/corsense

Now, for the further hardware options: 1) compatible chest strap

We can leave hardware aside for now, I'm leaving it here so that is is documented when we get back to this topic.