Is it possible to get PPG(Photoplethysmogram) data from a smart watch via android?
Asked Answered
D

3

7

I want to develop a health care app using Android smart watch devices that have an optical heart rate sensor. Examples of such devices are: Samsung gear live, Moto360, LG G watch R, etc.

To do this, I need the raw PPG signal data from those devices, but I found that the Android API only supports heart rate data by BPM unit.

Does anyone know if the raw signal data is accessible, and if so, how do I get access to that data?

Deliquesce answered 14/2, 2015 at 6:37 Comment(0)
H
1

Yes, It is possible to do that. I have answered a similar question here :Android Wear: How to get raw PPG data?

Basically, try to follow these steps:

1- Get the sensor type (represented by a number) of your PPG sensor (it is a constant that describes the sensor). This can be done by listing all the available sensors on your device:

List<Sensor> sensorList = mSensorManager.getSensorList(Sensor.TYPE_ALL);
        for (Sensor currentSensor : sensorList) {
            Log.d("List sensors", "Name: "+currentSensor.getName() + " /Type_String: " +currentSensor.getStringType()+ " /Type_number: "+currentSensor.getType());
        }

2- Then, try to find the sensorType of your PPG sensor. In your output, you will find one of the sensors containing the word ppg in it's type. For instance here is what the ppg sensor of my Huawei watch 2 looks like:

Name: AFE4405 light Sensor /Type_String:  com.huawei.watch.ppg /Type_Number: 65537

3-Register your listener using the the type_number of your ppg sensor, mine is 65537 so I would do this:

sensorManager.registerListener(this,sensorManager.getDefaultSensor(65537),SensorManager.SENSOR_DELAY_NORMAL);
Hhd answered 9/10, 2018 at 15:37 Comment(7)
Even this is a good workaround, in some cases it is not applicable because string type is not always != null. Therefore "ppg" string is not always available (i've tested on a ticwatch 1)Pesticide
Can you please paste what you get when you list your sensors ? (It's point 1 in my answer)Hhd
I/MainActivity: Name: Cywee Accelerometer Sensor Type_String: android.sensor.accelerometer /ype_number: 1 I/MainActivity: Name: Cywee Magnetic field Sensor Type_String: android.sensor.magnetic_field /ype_number: 2 2019-02-24 18:52:03.864 6972-6972/thecave.forge.biowatchapp I/MainActivity: Name: Cywee Gyroscope Sensor Type_String: android.sensor.gyroscope /ype_number: 4 : Name: Cywee Heart Rate Type_String: android.sensor.heart_rate /ype_number: 21 : Name: Cywee Heart Rate Touch Type_String: /ype_number: 33171030Pesticide
I didn't understand something... you can listen for raw ppg values or just the heart rate?Collator
Indeed, I do get the raw PPG data with around 100HZ frequency. This has been tested on Huawei Watch 2.Hhd
@MehdiBoukhechba Thanks for your answer! I'd like to try this myself but I don't really want to buy an expensive watch for this. Any chance you can point me towards a device that's on the cheaper end of the spectrum but should still work with your approach?Platelet
@StefanFalk I have tested this approach on multiple watches and found that Huawei watch 2, fossil Gen 5 (and probably gen 4 as well), Galaxy watch 4 (Samsung reverted back to Wear os) are all exposing the raw PPG through a dedicated chanel. You just need to find the right sensor ID by listing the available sensors on the watch using the approach above.Hhd
M
0

Yes, it is possible (at least on a Samsung mobile device such as the S5, S6 etc.).

See this link: http://developer.samsung.com/galaxy#sensor-extension

From the Samsung website:

The HRM Sensor is located on the rear panel of the phone. If you place your finger, measurement starts. The photoplethysmogram(PPG) signal means the amount back of IR / RED light that reflected from blood vessel in the finger.

Use Samsung's SDK and it will give you the raw values (values range from 0 to ~64600 if I remember correctly).

Mala answered 17/3, 2016 at 3:31 Comment(2)
this is for a smartphone, but what of the wristbands?Collator
@Collator for Samsung wristbands like Gear S2 and S3 you could look into the following SDK docs for collecting ppg raw data from Gear S2/S3: developer.samsung.com/forum/thread/…Kathlenekathlin
B
-1

No, I have searched rigorously to extract the raw values but wasn't successful. AsteroidOS (asteroidos.org/) is a custom rom for few compatible watches, even after going through the entire source code, I could only find a single place where the Heart Rate Monitor was used.

Implementation File

https://github.com/AsteroidOS/android_frameworks_native/blob/e88bdd18c91c313b2102445eb5eb6213814bc124/libs/gui/Sensor.cpp

The reason I feel why It wouln't work because the Hear Rate is computed by the Hard Ware internally.

For experimental purposes you could build your own PPG sensor externally

www.sparkfun.com/products/11574

and connect it to aurdino.

Or could search for some wireless PPG sensor and build one of your own.

Baryta answered 6/12, 2016 at 22:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.