So I would like to make a heartbeat sensor. This is easy in android as it has the camera and the flash LED but would be impossible to make in PC without the right software... Unless i would use the sensor that the optical mouse uses to capture the laser. At this point i am not asking if this would be accurate or something like that i am just interested in knowing, how does one access the sensor information?

  • The only way I can think of is to write your own mouse device driver. – DavidPostill Mar 15 '17 at 15:51
  • 1
    I don't think it is possible. Android camera heart rate monitors are working with color/tone change detection. Mouse sensor is detecting the motion and is likely to ignore the color/tone change. So even if you ignore the complexity of low level access to mouse sensor data, I don't thinks this is the right tool for the job – Art Gertner Mar 15 '17 at 16:00
  • Why do you want to measure the user's pulse anyway? A user on a treadmill, or riding an exercise bike, might not have a mouse (or even a laptop) nearby. – unforgettableidSupportsMonica Mar 15 '17 at 19:11
  • @unforgettableid it was not meant to track while exercise, neither was it to be used for long sessions. – wannabeLearner Mar 16 '17 at 9:52
  • @ArtGertner makes sense never thought of that actually. But do they only work with tone change? Isn't it with the calculation of the amount of light that comes through? And i know it's not the right tool. But thought it was a possible tool. – wannabeLearner Mar 16 '17 at 9:58

The mouse is installed to your computer as a human interface device (USB device type HID), so you do not have direct access to the sensor data via the usual means. Unless the mouse supports some other mode you would have to access the information directly from the hardware of the mouse, which is beyond the scope of your question

| improve this answer | |

A mouse generally doesn't provide direct access to the sensor(s).

Consider using a PC webcam instead. After all, it is the camera sensor on the phone (with light from the LED) which detects the heart rate.

GitHub - thearn/webcam-pulse-detector

A python application that detects and highlights the heart-rate of an individual (using only their own webcam) in real-time.

| improve this answer | |
  • yhea but the point is not actually needing external hardware but i now see it is a hard task. Plus not all webcams would work because some have their led far away from the lens. – wannabeLearner Mar 15 '17 at 18:49
  • As long as you have adequate lighting, the webcam-pulse-detector can detect your heartbeat without requiring an on-board LED – Steven Mar 15 '17 at 19:11
  • 1
    Really? never thought you could measure without a "strong" light-source going through you. Good stuff – wannabeLearner Mar 16 '17 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.