Bangle.js 2 Cutting Edge - new heart rate algorithm

Posted on
Page
of 4
First Prev
/ 4
  • So you're seeing this issue with the offset HRM value as well?

    I have not looked too closely for that. Can do that if you want!

    I just wanted to add comparison data for the open algorithm now that I have a chest strap.

  • Ok, great! I think you should still be able to create useful data even with a 'normal' build using the binary blob. While the recorded HRM will be from the binary blob, the raw sensor data will be off the sensor, so when the test harness runs it'll still be able to return data from the open source algorithm.

    Well, now you have the chest strap if you've got time I'd be interested to see if you find that the data from the binary blob is off by 10% as well - I'm not sure if it's something to do with the older VC31 sensor in the original Bangles, or if it applies to the VC31B as well

  • HRM Accelerometer Event Recorder fails with

    Uncaught TypeError: Puck.connect is not a function
        at connect (custom.html:253:8)
    

    So maybe a change in one of the app loader core updates?

  • Ahh, ok - thanks for looking into it. It's because normally a custom file would communicate with the watch via the functions provided by lib/customize.js but you're including the Puck.js library directly and actually creating a new Bluetooth connection.

    I added Puck.eval and .write to lib/customize.js a while back (and it's const Puck) so that must have messed it up. I'll see if there's a nice way to make to work or if we need to bodge it to use the Puck.js library again

  • Ok, if you try the development app loader then I think it should all work!

  • Thanks!

    It works for the most part. Enabling "Store on bangle" and downloading it from the bangle works. The default mode will start the program on the watch, but not start the count in the app loader and not save any logging.

    Attached is the log downloaded from the bangle and the image generated by running ./plotfiles.sh.

    Captured on custom built firmware (based on 2v19.36 I think) switched over to open source algorithm (last commit before switch to open source algo: 442c0c78892f0756f74ceb3522a6d70e2c885763­).


    2 Attachments

  • That's odd - it might be a GitHub caching issue though that means you hadn't got the latest of all files - it's definitely something I tried here with success before pushing

  • Hello all,

    very interesting developments here!
    I have been trying the new algorithms myself too. I had the Heart Rate Monitor app on the Bangls JS (version 2 bought from Kickstarter campaign, FW 2v19), and another smartwatch plus a PPG from the samrtphone on the other arm. I have noticed some differences, especially at lower HRs, but couldn't do this very systematically. I am planning to do some more tests with a bluetooth Polar ECG belt in the coming days and will report back.

    I have read in this thread that the manufacturer's library also supports SPO2 and Blood Pressure. It would be extremely interesting to receive these 2 as well. I do not trust BP at all, but SPO2 is doable and has been proven reliable on other devices (for example Withings). Is there any plan to support these? And /or to allow collecting PPG from the 2 LEDs (my understanding is that there is a green LED and an Infrared LED)?

    Thanks!

  • I believe the IR value is available via vcEnv although to get these readings at the same time as the green readings you need to reconfigure the HRM using I2C. There's an example of doing that at https://espruino.github.io/BangleApps/?i­d=flashcount though (although it may not work as-is on the KickStarter bangles with the VC31 sensor).

    However, just to be clear on this:

    • I do have an SPO2 algorithm binary blob for the VC31B HRM sensor that is in watches that are sold now and (mostly) since the KickStarter, but it requires the sensor to be reconfigured when sensing SPO2 and there are a lot of questions about exactly what's needed (https://github.com/espruino/Espruino/blo­b/master/libs/misc/hrm_vc31.c#L767-L776)
    • I don't have SPO2 for the VC31 in the KickStarter Bangles - if we can force them to take an IR reading as fast as a green reading then we might be ok but I'm not sure exactly how we'd do that.
    • I don't have a Blood Pressure algorithm at all, for either sensor

    I don't have any immediate plans to implement it but if someone wanted to take a look I could send the binary blob and what info I have. Effectively all you need to do is call the function with IR and green readings at the right speed and it gives you a value

  • I don't have any immediate plans to implement it but if someone wanted to take a look I could send the binary blob and what info I have. Effectively all you need to do is call the function with IR and green readings at the right speed and it gives you a value

    I am willing to take a shot at implementing this

  • That's great, thanks!

    Actually it seems I couldn't email you the zip so I'll attach it here. It's mostly in Chinese so it can be a bit tricky to dig through, but:

    One of the important bits is probably:

    		case VCWORK_MODE_SPO2WORK:
    			regConfig[0] = 0x47;
    			regConfig[1] = 0x2F;
    			regConfig[6] = 0;
    			regConfig[7] = 0x80;
    			regConfig[13] = 0x96;
    			regConfig[16] = 0x04; // OverSample
    			break;
    

    Which you need to get put in https://github.com/espruino/Espruino/blo­b/master/libs/misc/hrm_vc31.c#L767-L776 when SPO2 mode is to be enabled.

    Right now we don't auto-calibrate the HRM speed which their code does - I'm not sure if that's going to end up causing problems or not.


    1 Attachment

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Bangle.js 2 Cutting Edge - new heart rate algorithm

Posted by Avatar for Gordon @Gordon

Actions