Using the max30102/maxrefdes117 heart rate and blood ox sensor on GrovePi+

I am trying to connect my HR/blood ox sensor (maxrefdes117) through the i2c port on the GrovePi+. I created the library to interface with the sensor through the SDA and SCL pins on the Raspberry Pi (4) and can read and write to it successfully. When reading the grovepi library and the di_i2c module, It’s not very clear exactly how i can make the sensor work through the daughter board. It appears they have presets for all the developed sensors, but it can’t understand from reading them why my code shouldn’t work through the daughter board without alteration considering how i2c communication works. The comments in the library don’t explain how the pin is used to get the correct port for i2c devices only for the digital and analog ports. But again i don’t see how it needs a pin assigned to it as it is i2c and should be found using the devices block instead.
Any help much appreciated. I am very new to i2c communications and expect i am missing something very obvious here.

I’m running Raspberry Pi 64-bit Bullseye OS on Raspberry Pi 4, and yes i know the GrovePi+ is working with the Pi as i am running another Analog sensor on the device.

2 Likes

I don’t know that much about the GrovePi+ … a look at the schematic shows there are three dedicated I2C connectors on the GrovePi+ (I2C1, I2C2, I2C3) which are connected to the ATMega328. My guess is the ATMega328 is performing a voltage level shift / hub function to the Raspberry Pi.

When you plug your I2C sensor into the GrovePi+ I2C1, does i2cdetect -y 1 see your sensor?

If so you may not need to change anything in your code.

The GrovePi code might default to using the DI software I2C which allows clock stretching for sensors that need that - they refer to that as RPI_1SW. You may need to set the bus to “RPI_1” to use the hardware I2C.

Like I said, I don’t actually know much about the GrovePi+ but I’m hoping the best for your project.

2 Likes

using i2cdetect -y 1 returns empty addresses sadly, this was the first check i made. Looking at the schismatic it shows the i2c ports should connect directly to the i2c GPIO pins if i remember correctly which is even more confusing. I attempted to use the di_i2c module but it wasn’t clear on what functions i should use as it is given the pin value from the grovepi.py file which i have no understating how they are used. The software RPI_1SW setting doesn’t seem necessary for my application but i will try using both RPI_1 & RPI_1SW to see which one works.

2 Likes

GrovePi+, Bullseye and I2C do not play well together. Do you really need to be on the 64 bit version?
Can downgrading to Buster be acceptable?

3 Likes

Yeah, the 64-bit OS is required for other aspects of the project.

2 Likes