Avatar for Graham_Jones

Graham_Jones

Member since Aug 2020 • Last active Jan 2024
  • 0 conversations
  • 17 comments

Author of OpenSeizureDetector - free, open source tools to detect epileptic seizures and raise an alarm to warn carers that someone may need assistance. http://openseizuredetector.org.uk

Most recent activity

  • in Bangle.js
    Avatar for Graham_Jones

    @d3nd3-o0 - thanks for this detail - I will go through it and reply properly, but it might be tomorrow evening or the one after. A couple of quick thoughts:

    I will check the ID from the sensor - I was starting to wonder if maybe I have a different sensor (I only purchased the Bangle2 recently)

    For me, a LED current value of 15 seemed about right - the automatic adjuster varied it from about 13 to 22, so our watches do seem to be behaving differently if you had to use a much lower current (unless our skin colours are very different maybe - that might have an effect, so could be another reason for needing automatic current control for different users.).

    My copy of the app store is very minimalist on purpose - I am thinking of pointing users of my seizure detector app to it if I can get the heart rate measurement working reliably, and I only want them to install apps that I now will not interfere with the seizure detector (some users like to fiddle.....).

    Alas, I had to disable the graph drawing part of my little HRM test app because drawing to the screen seemed to take such a long time (over 1 second), and it blocked the HRM measurement while it was happening - it seems that the HRM measurements are not interrupt driven so if I want to achieve 40ms sample period I have to be very careful about not doing too much.... My little app is based on one of the others in the app store - I modified it to try to make it easier to try out different settings (and the idea was to have a graph at the same time to see the effect in real time). I don't get on very well with javascript so had a bit of a sense-of-humour failure at it and de-scoped my intentions for the test app!

    Regards

    Graham.

  • in Bangle.js
    Avatar for Graham_Jones

    Pin 29 was not true. Its only for bangle 1, please delete that information, sorry for that.

    No problem - that accounts for why I was measuring noise!

  • in Bangle.js
    Avatar for Graham_Jones

    Thank you for the graph. The peaks in your data do look easier to see than mine (but that might just be the graph scale - I'll have a proper look later) It looks like just over 60 bpm. Is that right? Did the watch report something similar?
    Regards

    Graham

  • in Bangle.js
    Avatar for Graham_Jones

    But something is also wrong with it :D, like it gets stuck often. Or wanders into weird hrm territory for no reason.

    I found that I was getting occasional I2C errors when reading registers from the HRM device. In the end I caught these errors and re-set the HRM device when it occurred - that seems to have stopped my problem with logging freezing (https://github.com/OpenSeizureDetector/B­angleSD/blob/master/apps/hrmtest/app.js#­L240)

  • in Bangle.js
    Avatar for Graham_Jones

    I have made a little test app that will record raw HRM data to a file, and allow me to vary the LED power by swiping the screen up or down.
    The things I have found are:

    1. The photodiode reading varies from 8190 counts (13 bits?) to zero
    2. Increasing the LED current decreases the reading
    3. The default current register value of 15 (decimal) is pretty good and gives a mid range photodiode reading.

    As long as I don't try to plot the graph on the watch screen, I can log at about 40 ms intervals, and can pull it into a speadsheet to look at it:

    graph

    From a visual inspection of the first 5 seconds, I can see about 5 peaks, which is consistent with my actual heart rate of around 60 bpm, which is encouraging. Unfortunately the watch is reporting over 100 bpm, which is not so impressive. It sounds like this is the opposite to what other users are reporting, as others are reporting low indicated heart rate compared to actual.

    So I'm still not sure what to make of this, so I'm going to try to do the same on Pinetime and see how it compares, as I am still suspecting that the HRM sensor in my watch is not really working very well. If anyone else could try to collect a similar set of data on a different watch, I'd be interested in seeing the comparison of different BangleJs watches.
    Thanks

    Graham.

  • in Bangle.js
    Avatar for Graham_Jones

    Thank you very much for this example, d3nd3-o0. I have never seen inline C code in javascript before, so this is a bit of an education for me!
    I will have a go with your example tomorrow because my attempt to implement the PineTime HRM graph app in javascript is not being very successful - I was assuming that the 'on hrm-raw' functions etc. were interrupt driven, but I was taking too long to draw the graph and blocking it, so need to be more careful.

    I see from the source code that there is another register that is supposed to adjust the LED current - but I find that if I try to set this, then the HRM stops updating after about 50 samples. I can see the LED intensity changing with register 0x17 as you suggested though.
    But so far, I have not seen a stunning effect on the measured signal - will do some more digging tomorrow - thank you all for your suggestions!

  • in Bangle.js
    Avatar for Graham_Jones

    @user140377 If there is a plastic film cover over my sensor, it is very well attached - I can't detect it.
    I thought from reading this thread that most people were finding that the Bangle bpm was lower than manual measurements, but I am seeing higher - it is consistent with my watch as I had someone else wear it and got a similar answer. I'll try the LED intensity and see if it makes any difference.

  • in Bangle.js
    Avatar for Graham_Jones

    Thanks - I hadn't realised I could alter the LED intensity without rebuilding the firmware - I'll try that first, then have a look at using the analogue output as you suggest.

  • in Bangle.js
    Avatar for Graham_Jones

    I have been looking at the BangleJS2 HRM without much success for the last week or so (I was hoping to just add some filtering and error checking...) - so I thought I'd share where I have got to in case someone else has already tried my ideas and know it is not the problem.
    I am using the latest BangleJS2 firmware (2v19, commit cfbc4040d).
    I used a slightly modified version of the HRM data exporter app which records the sample time as well as the ppg reading in case the sample frequency was not what I was expecting.

    I was surprised that I could not see a heart rate signal from a simple visual examination of the data, so I did some processing to try to get rid of the baseline drift on the signal, but still can not really see anything that looks like my heart rate. The calculated heart rate from the bangleJS is nowhere near correct - it shows something like 90 bpm where my heart rate is probably more like 50 bpm when I am sitting still.
    I have done a little comparison to the signal from a PineTime HRM and the heart rate signal is obvious from that - you can see some graphs etc. on my bug tracker issue here.
    So I am really doubting whether the BangleJS2 HRM is actually working - one thing that is really noticeable is the LED brightness - the pine time is much, much brighter than BangleJS2 (Pinetime on the left, BangleJS on the right)

    I think that if I want to increase the LED brightness, I need to build my own firmware, so I think I'll look at that next, but thought I'd share where I have got to in case anyone else has a better idea?
    Thanks
    Graham.

  • in Bangle.js
    Avatar for Graham_Jones

    Thank you - I had missed that post - will try the save to watch option and see if that works.

    Graham

Actions