Grove - Finger-clip Heart Rate Sensor with shell Coding

Hi i am currently working on a project whereby i am using a Grove - Finger-clip Heart Rate Sensor with shell with an Arduino UNO. I am using the following; GND, 5V, A4 and A5 connections.

I am having problems obtaining the sensors i2c address. All i2c scanners are not finding any devices.

I am using the following coding to use the sensor;

#include <Wire.h>

void setup()
{
  Serial.begin(9600);
  Serial.println("Heart Rate Sensor");
  Wire.begin();
}
void loop()
{
  Wire.requestFrom(0xA0 >> 1, 1);    // request 1 bytes from slave device
  while (Wire.available())          // slave may send less than requested
  {
    unsigned char c = Wire.read();   // receive heart rate value (a byte)
    Serial.println(c, DEC);         // print heart rate value
  }
  delay(500);
}

Someone please help me URGENTLY and let me know where i am going wrong and how i can get the sensor working. I am not an expert with arduinos so i may be a silly mistake that i am making.

Thanks! :slight_smile:

What is the urgency, exactly?

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

What do you see in the serial monitor, you have the monitor speed set at 9600bd?

Thanks.. Tom... :slight_smile:

aarg:
What is the urgency, exactly?

Well I am currently working on a project and i need to get coding working asap to meet deadline. :frowning:

Do you have any solutions to this problem?

i think it may be the i2c address... but i am unable to obtain an i2c witht the i2c scanner..........

If the scanner can't see it, it isn't wired correctly.
Do you have 4.7k pullup resistors on a4 and A5? (maybe the Grove already has those but you didn't post a link)
Are SDA (A4) and SCL (A5) wired correctly?

Pete

el_supremo:
If the scanner can't see it, it isn't wired correctly.
Do you have 4.7k pullup resistors on a4 and A5? (maybe the Grove already has those but you didn't post a link)
Are SDA (A4) and SCL (A5) wired correctly?

Pete

Yeah i am using a universal grove 4 pin cable and connecting SDA-A4 and SCL-A5.
Also sorry i am new to Arduino so i do not fully understand what you mean by 4.7k pullup resistors on a4 and a5??? can explain further please.

Thanks

This is the schematics for the grove heart rate sensor

https://www.pdf.investintech.com/preview/723c8f32-6a96-11e7-922a-002590d31986/index.html

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile:

TomGeorge:
Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile:

These are images of the actual basic component connection

And these are the schematic drawings of the uno

(Although this is not an original Arduino UNO being used, i also have an original Arduino UNO and have slotted the wires in the correct slots SDA (A4) and SCL (A5). Still get the same results)

@TomGeorge
@el_supremo
Thanks!!

Here is a clearer link of the schematics if needed.

https://drive.google.com/drive/folders/0B6uNNXJ2z4Cxc3VwZHNaUkM3eGs

Is my wire.requestfrom() wrong??

The diagram in the latest link you posted makes it possible to read the circuit labels. The circuit does not appear to have pullups on SDA and SCL. If the pullup resistors aren't hidden in the Open-Smart board, you'll have to add a 4.7k resistor from A4 to +5V and from A5 to +5V.

Pete

Is my wire.requestfrom() wrong??

Yes, but you need to get the I2C scanner to see the device before worrying about that.

Pete

el_supremo:
The diagram in the latest link you posted makes it possible to read the circuit labels. The circuit does not appear to have pullups on SDA and SCL. If the pullup resistors aren't hidden in the Open-Smart board, you'll have to add a 4.7k resistor from A4 to +5V and from A5 to +5V.

Pete

Oh right! secondly how do i add 4.7k resistors as pull up resistors A4,A5??

@el_supremo

Thanks!!

Adding a 4.7k pullup resistor? Or do i need to modify wire.h file???

wire.h file has nothing to do with it. You need to add two physical resistors as I described previously.

Pete

el_supremo:
wire.h file has nothing to do with it. You need to add two physical resistors as I described previously.

Pete

Watch this youtube video:

The only thing is that this guy has not added any additional resistors. I have also used my arduino uno and plugged into female pins as the guy in the video has but still locating on I2C scanner.

@el_supremo

:frowning:

I saw another video of a guy using the sensor with a real UNO and he didn’t have pullups either. In that case I don’t know why the scanner doesn’t find the I2C address.

Pete

el_supremo:
I saw another video of a guy using the sensor with a real UNO and he didn't have pullups either. In that case I don't know why the scanner doesn't find the I2C address.

Pete

hmm maybe mine is faulty i will try purchasing another and see how that goes

Thanks!!