Polar heart rate receiver
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- joeycampbell60
- Posts: 3
- Joined: Fri Feb 26, 2016 6:57 am
Polar heart rate receiver
Hi I have purchased the heart rate receiver that works with the Polar chest strap. I want to try and determine the heart rate numerically but I am unable to locate a sample sketch to show this. All I can find is this sketch but it only outputs the word 'beat' at every heart beat (http://learn.parallax.com/node/386). Can anyone send me a link of a sketch for use with this product: https://www.adafruit.com/product/1077
- Franklin97355
- Posts: 23940
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Polar heart rate receiver
This code: Prints a "Beat" every heartbeat. You can use the same code to figure out the rate by measuring the time between pulses or counting pulses over a measured time.
Code: Select all
sample = digitalRead(HR_RX); //Store signal output
if (sample && (oldSample != sample)) {
Serial.println("Beat");
heartBeat();
- mbeldar
- Posts: 7
- Joined: Fri Feb 24, 2017 3:21 pm
Re: Polar heart rate receiver
I am only getting bit 0 from sensor's receiver. what might be the problem? PLEASE HELP
- Franklin97355
- Posts: 23940
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Polar heart rate receiver
Don't know. Post the code you are running. Please useI am only getting bit 0 from sensor's receiver. what might be the problem? PLEASE HELP
Code: Select all
tags when posting code or logs to the forums by clicking the </> button above the reply box and pasting your code between the tags created. Could you post large (less than 1meg), clear, detailed pictures of both sides of your board showing any soldering you have done and the connections to it?
- mbeldar
- Posts: 7
- Joined: Fri Feb 24, 2017 3:21 pm
Re: Polar heart rate receiver
Code: Select all
//Definitions
const int HR_RX = 8;
byte oldSample, sample;
void setup() {
Serial.begin(9600);
pinMode (HR_RX, INPUT); //Signal pin to input
pinMode (8, OUTPUT); //Signal pin to input
Serial.println("Waiting for heart beat...");
//Wait until a heart beat is detected
//while (!digitalRead(HR_RX)) {};
// Serial.println ("Heart beat detected!");
}
int count=0;
float avg=0.0;
float total=0.0;
int max1=0;
int min1 = 999;
int br = 0;
void loop() {
br++;
//sample = digitalRead(HR_RX);
sample = analogRead(A0);//Store signal output
if (sample && (oldSample != sample)) {
if(min1>sample)
min1 = sample;
if(max1<sample)
max1 = sample;
// Serial.println(min1);
Serial.println(sample);
delay(2);
// Serial.println(max1);
total = sample + total;
count++;
if(count%200==0)
{
avg = total/count;
total = 0;
count = 1;
}
}
digitalWrite(8, LOW);
oldSample = sample; //Store last signal received
if(br==100000 )
while (true) {};
}
Last edited by mbeldar on Sun Feb 26, 2017 4:41 pm, edited 1 time in total.
- Franklin97355
- Posts: 23940
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Polar heart rate receiver
How do you have things connected? Can you post pictures?
- mbeldar
- Posts: 7
- Joined: Fri Feb 24, 2017 3:21 pm
Re: Polar heart rate receiver
Code: Select all
int sensorPin = 0;
double alpha = 0.75;
int period = 100;
double change = 0.0;
double minval = 0.0;
int c=0;
void setup ()
{
pinMode(8, INPUT);
Serial.begin (9600);
c=0;
}
static double oldValue = 0;
static double oldChange = 0;
void loop ()
{
c++;
int rawValue = digitalRead (8);
//double value = alpha * oldValue + (1 - alpha) * rawValue;
if(rawValue!=0)
{
Serial.println (rawValue);
Serial.println (c);}
oldValue = rawValue;;
// delay (period);
}
- mbeldar
- Posts: 7
- Joined: Fri Feb 24, 2017 3:21 pm
Re: Polar heart rate receiver
Strange things is happening!
When I am putting strap on my chest there is no signal. But when I tap it on table it's giving me the output as 1.
The problem is definitely with the belt.
When I am putting strap on my chest there is no signal. But when I tap it on table it's giving me the output as 1.
The problem is definitely with the belt.
- Franklin97355
- Posts: 23940
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Polar heart rate receiver
You might also redo the soldering on the top pin.
- mbeldar
- Posts: 7
- Joined: Fri Feb 24, 2017 3:21 pm
Re: Polar heart rate receiver
Issue got resolved. :)
The problem was, my skin was dry. When I applied some gel on it, its working like charm
The problem was, my skin was dry. When I applied some gel on it, its working like charm
- mbeldar
- Posts: 7
- Joined: Fri Feb 24, 2017 3:21 pm
Re: Polar heart rate receiver
One quick question.
Will this sensor give ECG data.
The one with which you can plot the data?
Will this sensor give ECG data.
The one with which you can plot the data?
- asteroid
- Posts: 300
- Joined: Tue Oct 22, 2013 9:10 pm
Re: Polar heart rate receiver
>Will this sensor give ECG data.
Not to my knowledge. If you want to display electrical activity, here's one way:
https://www.youtube.com/watch?v=pbVGKQp ... e=youtu.be
Requires an Arduino UNO, Olimex EKG Shield, and an Adafruit 2.8" TFT screen.
Not to my knowledge. If you want to display electrical activity, here's one way:
https://www.youtube.com/watch?v=pbVGKQp ... e=youtu.be
Requires an Arduino UNO, Olimex EKG Shield, and an Adafruit 2.8" TFT screen.
- habibim
- Posts: 1
- Joined: Sun Mar 12, 2017 12:32 am
Re: Polar heart rate receiver
Hello, I purchased the Heart Rate Educational Starter Pack with Polar Wireless Sensors (https://www.adafruit.com/product/1077) two weeks ago. And I have not been able to make it work. The problem is that the receiver output is 0 all the time. I am not sure if the problem is transmitter or receiver? is there any way to test them individually?
Thank you
Thank you
- jbf
- Posts: 21
- Joined: Thu Dec 04, 2014 8:24 pm
Re: Polar heart rate receiver
I am having the exact same issue.
Ive tried everything.
I get random pulses in my processing sketch with the receiver and sensor near one another (and sensor attached) but heart rate only randoly is accurate. Intermittent pulses.
When remove heart rate sensor from my chest, it still gives me a similar pattern of pulses intermittently.
Disconnecting the receiver and it stops pulsing.
Ive tried everything.
I get random pulses in my processing sketch with the receiver and sensor near one another (and sensor attached) but heart rate only randoly is accurate. Intermittent pulses.
When remove heart rate sensor from my chest, it still gives me a similar pattern of pulses intermittently.
Disconnecting the receiver and it stops pulsing.
Please be positive and constructive with your questions and comments.