watchOS 2 Heart Rate Sensor - watchkit

Does anyone know how to access the heart rate sensor available in watchOS 2 in Xcode 7 beta?

watchOS 2 allows you to use HealthKit. Within this kit, you may use HKWorkout to access variables such as the heart rate.

Apple isn't technically giving developers access to the heart rate sensors in watchOS 2.0. What they are doing is providing direct access to heart rate data recorded by the sensor in HealthKit. See the stack overflow answer to this question for more detail.

Many of software kits for iOS are now available for watchOS, such as
HealthKit.
You can use HealthKit (HK) functions and classes in order to calculate burned calories, find heart rate, etc.
You can use HKWorkout to calculate everything about workouts and access the related variables such as heart rate, just like you did with iOS before.
Read developer documentations from Apple in order to learn about HealthKit. They can be found in developer.apple.com.
Resources
For more details about HKWorkout, you should check out the HKWorkout Class Reference and the HKWorkoutSession Class Reference from Apple.
Also don't forget to check out this great WWDC15 video.

Related

Some questions for bluetooth low energy as an indoor proximity sensor for building or school campus

My professor recently approved our research paper which will also be used in our final year thesis. Basically our main purpose is to create a system for location tracking and attendance automation for students and staffs. We would like to use the power of bluetooth low energy modules for this project.
I have actually done quite few research about this but I am having trouble which keywords to use in order for me to filter the right answers for my question. So instead, I'll just put all my questions here.
I provided an image to further understand the concept I am talking about.
Basically, the broadcaster/advertisement mode modules are for students and staffs. While the observer mode modules are initially installed in every rooms or spaces in our building/campus.
Broadcast and Observer mode
I would like to clarify first that the location tracking is only basic, it only detects which rooms are the students and staffs located.
Here are my questions:
What is the maximum advertisement/broadcaster module can the observer module detects at the same time?
Our target is about 50 students per room, 300 students in cafeteria, will the observer module have a large amount of latency upon scanning advertisement packets?
Do we have to use different module for observer mode, or will the same module for broadcaster mode be just fine?
Since this is supposedly embedded to school IDs, we would like to use a coin cell battery, how long will it last?
According to my research, BLE range is about 100 meters, but we will be using coin cell battery, is it really possible to achieve 100m for broadcasting and observing? If it is, can we perhaps decrease it by programming?
My apologies for too much question, as this is actually our first time doing applied hardware stuffs due to pandemic. Most of our laboratories are basically tinkercad base. Face-to-face classes are allowed for only medical students for now.
A few answers:
BLE scanners can detect hundreds of distinct broadcasters at the same time. There is no hard limit, but the more broadcasters the longer it will take the scanners to detect each broadcaster.
Most BLE modules support both peripheral mode (broadcaster) and central mode (scanner) simultaneously.
Scanning 50 broadcasters in a single room will easily detect 90% of packets, so if the advertiser is going at 1 Hz it will usually take one second to detect, but sometimes 2-3 seconds of packets are missed.
The indoor range is closer to 40 meters with no walls obstructing the signal. Outdoors with clear line of sight the range is higher. Walls often block signals almost entirely, depending on materials.
A CR2032 coin cell can power a BLE broadcast at 1 Hz and max power for about 30 days.
Creating an embedded solution is cool and valid but just remember that broadcasters already exists as each and every student carries a smartphone with BLE embedded into it and your observer can be any BLE capable device from smartphone through PC with BLE dongle all the way to Arduino and alike.
Your broadcasters (or BLE peripherals as they should be called) will need an Android / iOS app and you will have to deal with working in the background without the operating system stopping your app.
Your observer (or Central in BLE language) can be any stationary PC if such exists in the class which can make development and deployment a lot easier.

BLE Device with Haptic Feedback

Is there an off-the-shelf beacon I can just buy that also has support for triggering Vibration / Haptic Motor over BLE? Amazon / whatever links are welcome.
Context: I'd like to trigger vibration from iOS in a small independent device. BLE seems ideal as I need to support more than one and all devices should be within range. I'm trying to rapidly prototype something instead of cranking out my own HW.
For prototyping you may be able to use a few sub-$20 Xiaomi Mi Band devices (or Band 2 which should be under $30 and has a screen). And then use API like this to trigger vibration: https://github.com/betomaluje/Mi-Band
They both can be removed from the wristband and look like a 2 cm long pill, and last weeks on a charge with normal use, maybe months when not counting steps.

Can you develop an app for the Microsoft band, without a corresponding mobile app always being connected?

I have several Microsoft bands, to be used as part of a group health initiative. I intend to develop a single app on a tablet which will pull the data from the bands. This will be a manual process, there will not be a constant connection to the tablet and no connection to Microsoft Health.
Does anyone know if this is possible?
Thanks
Emma
The general answer is no: Historical sensor values are not stored or buffered on the Band itself.
It does however depend on what sensors you are interested in. The sensor values are not buffered, so you can only read the current (realtime) value of the sensors.
But sensors such as pedometer and distance are incrementing over time, so these values will make sense even though you are only connected once in a while. Whereas for, e.g., the heart rate and skin temperature, you will only get the current (realtime) value.
So it depends on your use case.

Calculating the pulse rate using sensors

I have really work on a final year project in 4th year computer science. I need to calculate the blood pressure level of a human in a real time and alert to him.
Do we have any sensors for Ardino or Resbrry PI boards.
I have search on enter link description here but I have seen lots of sensors for heart rate but non of them for blood pressure.
Do you think is there any sensors available to get the blood pressures from ardino or rasberry PI ?
You've got a BIG project ahead of you. Automated blood pressure monitors are expensive medical devices, but I'll get you started.
Take a look at this link and think about the physical functions you must accomplish.
http://homepage.smc.edu/wissmann_paul/anatomy1/1bloodpressure.html
First, you have to build a pneumatic control system to inflate a blood pressure cuff and then slowly deflate it.
Second, you have to build an acoustic monitor to listen for the heartbeat below the cuff and a digital signal processing algorithm to detect the heartbeat.
For the first project look online for small pneumatic pumps and solenoid control valves. You will control these with the Arduino and a power transistor to switch the power on and off.
For the second project you will need to build a microphone and amplify that. You can find plenty of examples of microphones on the Arduino forum. The trick part will be designing the DSP filter to identify heartbeats and then count them. See Simon Monk's book, "Beyond Sketches" for an intro to DSP on the Arduino.
Get started and post some more and I'll check back to see if I can help on specific problems as you go forward.

Sub Second iBeacon Monitoring

I have no hands on experience with BLE and beacons at this point, and am having a hard time figuring out the viability of using them in a particular manner. Wondering if anyone can provide some high level feedback about the viability of this use case:
The goal is to use beacons to track a running race. Runners with their smartphones would be able to log times when they hit various beacons spread throughout an indoor course. Pretty simple scenario.
The problems that I foresee are 1) the ability to continuously scan for beacons at sub second intervals, and 2) the ability to then determine closest range to the beacon at sub second intervals.
I've tried parsing through the estimote and kontakt.io SDKs and am not certain that what I want to do is entirely possible or feasible with these particular beacons (or any for that matter). Further, would there be any device (the smartphones) specific limitations that would apply?
Thanks!
If you are using Estimote SDK you can set this property on BeaconManager.
See BeaconManager#setForegroundScanPeriod. SDK Docs

Resources