Need some advice on interfacing with an I2C device.

1,289 views
Skip to first unread message

Charles Puffer

unread,
Jan 29, 2016, 5:54:06 PM1/29/16
to Reading Hackspace
I a student project that is stuck on getting communication working with an I2C device.
Anyone have some time to advise or provide a bit of support.
We are trying to get communication and control of a Max30102.
It is a muti function device for making hart rate and O2 measurements. It is used in a number of health devices.

So far I have had little luck (no) luck getting an arduino to talk to it in any useful way.

Thanks
Charles Puffer

Andy Noyes

unread,
Jan 29, 2016, 7:17:34 PM1/29/16
to Reading Hackspace
Do you have the datasheet? They want you to sign some sort of non-disclosure to get it.

The I²C module seems to have an extra interrupt pin.

Manoel Trapier

unread,
Jan 29, 2016, 7:48:00 PM1/29/16
to Reading Hackspace
Have you tried to discuss with the component with a "well known working tool" like a bus pirate?

If it's i2c it need at least to answer to an address, and a tool like a bus pirate can scan all the valid addresses, and tel you if something answered or not to that address.

What informations do you have currently? (from manufacturer and from your experimentation)
A lot of i2c devices use the "EEPROM" protocol, but not all, the i2c protocol tell how to select a specific device and how to send/read data from/to but that's all, if a device want to use a non standard way to chat on top of i2c you absolutely need the documentation.

Manoel

PS: You can use any linux based card like the BeagleBone or the Pi connect the component to one of the i2c bus and use the i2c eeprom applications to try to get more information, but if the chip does not follow the i2c eeprom protocol you will only be able to enumerate the device on the bus.
Address scanning should be possible with an arduino but I would prefer in your case to use something which is know to work, just to be sure

Mark Robson

unread,
Jan 30, 2016, 6:40:45 AM1/30/16
to reading-...@googlegroups.com
If you have a Raspberry Pi (or some other Linux-based system with an i2c interface) then you can connect that to the device, and it's much easier to play around with testing things than in (e.g.) Arduino.

In particular, there's a program called "i2cdetect" which will scan the bus and show you some info.

You can use the Python i2c library or write to /dev/i2c1 (or /dev/i2c0 or whatever number it is).

The 3v3 (Pi) vs 5v (Most Arduinos) doesn't matter with I2C, because the data/clock lines are "open collector" and the pull-ups are usually on the master side, so provided the ground pins are connected, it should "just work".

Mark

--
You received this message because you are subscribed to the Google Groups "Reading Hackspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reading-hacksp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Richard Ibbotson

unread,
Jan 30, 2016, 7:00:55 AM1/30/16
to reading-...@googlegroups.com
Get the full data sheet and the application note. The abridged data sheet doesn't say anything about I2C voltages or if tolerant.


Sent via Richard's Phone
07871 256772
--

Richard Ibbotson

unread,
Jan 30, 2016, 7:06:54 AM1/30/16
to reading-...@googlegroups.com
I see the data sheet for the MAX30100 is published looks quite similar



Sent via Richard's Phone
07871 256772

Charles Puffer

unread,
Jan 30, 2016, 8:29:40 AM1/30/16
to Reading Hackspace
We have the data sheets. They are under NDA but I do not see anything that looks special I think they are just being Maxus.

I have used the arduino scanner to see the chip in a demo circuit. (but we do not want to risk this circuit as it may be need later)
The student had mounded several more of the chips onto adapter boards and I am working to get one of those up and working.
Bit stuck as the chips is a 1.8v Vdd and a I do not have any 1.8v regulators, a simple voltage divider is not going to cut it as the load is not a significant resistance).

Do not know if coming over to the lab will help as I am not sure who or what is there.

While I am starting to set myself up with more kit (Rigol DS1052E coming tomorrow) I am well short on parts and tools.
I am a bit blocked in all directions. I have to admit when I took on this student I was thinking this would be a bit easer.

Will focus on the android side of the problem for a while. But you alls advice and suggestions would be a big help.

Manoel Trapier

unread,
Jan 30, 2016, 8:36:28 AM1/30/16
to Reading Hackspace
Even if it's an open collector, using 5V on i2c line on a 3.3v device is going to disaster, so you'll still need to be careful with that, the reverse may work, but could also be disastrous for other reason or just not working at all, you need to check the datasheet for that.

Hopefully there are some nice component like the TXS0102 which are made especially for crossing voltage domain for open collector bus like i2c

Or you also can use a CMOS transistor (I've done that for crossing 5V/3.3V on PS/2 and ADB open collector bus)
On that subject I recommend reading this AN: http://www.nxp.com/documents/application_note/AN10441.pdf

Manoel

Richard Ibbotson

unread,
Jan 30, 2016, 8:44:07 AM1/30/16
to reading-...@googlegroups.com
Come down to RLab on Tuesday for the hardware hacking if you want some help.
For the regulator use an LM317
Looks like the I2C is 5v tolerant


Sent via Richard's Phone
07871 256772
--

Charles Puffer

unread,
Jan 30, 2016, 12:26:57 PM1/30/16
to Reading Hackspace
I may try to make it down I have a adapter mounted version of the chip.
If there will be some folks there is would be a big help.
Any suggestions in the mean time. would be cool.

Richard Ibbotson

unread,
Jan 30, 2016, 1:08:35 PM1/30/16
to Reading Hackspace
If you have an LM317 or similar the that will give you the 1.8V from the 5V with a couple of resistors.
You can pull up the two I2c lines to the 1.8V with 1K resistors
There might be some LM317 at the space, but I can bring some down Tuesday

Charles Puffer

unread,
Feb 2, 2016, 12:49:34 PM2/2/16
to Reading Hackspace
OK I am going to be driving over tonight look forward to seeing you all.


On Friday, 29 January 2016 22:54:06 UTC, Charles Puffer wrote:

Richard Ibbotson

unread,
Feb 2, 2016, 1:58:13 PM2/2/16
to reading-...@googlegroups.com

Sure will be down around 19:30.

Will bring some LM317.

Cheers,

Richard

--

Charles Puffer

unread,
Feb 2, 2016, 2:35:53 PM2/2/16
to Reading Hackspace
Richard started the drive and realised I had forgotten a bunch of stuff from walltet to the documentation.
Would it be ok to reschedule for tomorrow? I know things will be busier tomorrow.

Charles Puffer

Richard Ibbotson

unread,
Feb 3, 2016, 12:30:54 PM2/3/16
to Reading Hackspace
I will be down around 19:30 tonight.
Richard

Charles Puffer

unread,
Feb 6, 2016, 1:04:32 PM2/6/16
to Reading Hackspace
Richard;

Set up the circute you helped me build.
Checked things and tried to power it up.
Found I was only getting 0XFF from all addresses.
While looking at it I found the l317 was getting hot, and so I powered down and seperate off the parts of the circuite.
In the end it seems the BloodO2 chip is sucking up current and pulling down the voltage.
It seems something must have gone wrong with the chip.

So I am going to try the other (less advanced chip).
Will you be around on Tuesday or Wednesday as I may need your help again.

Thanks
Charles

Anisha

unread,
Feb 29, 2016, 8:24:48 AM2/29/16
to Reading Hackspace
Richard...

I need some help in interfacing the MAX30100 using atmega328. I am done with hardware interfacing. and am able to read out the adc data also. But am not sure whether the data are correct or not. As i am not able to retrieve the heart rate from the data.
And Charles, would like to help you in setting up the hardware interface if you tell me the present status.

Richard Ibbotson

unread,
Feb 29, 2016, 11:30:03 AM2/29/16
to reading-...@googlegroups.com, keltoum...@hotmail.fr

The data you read from the MAX30100 are the raw samples from the ADC from the photodiode. These arrive at your sample rate ( we used 100 samples per sec).

Though we used the MAX30102, they should be much the same.

 

There are sources of input to the photodiode:

1) Ambient Light which is not related to the LED pulses. This is removed by the chip before the along with 50/60Hz.

2) Reflected light from tissue etc. This is a very large value, probably about half scale on your ADC amplitude range depending on settings, and dependant on skin contact.

3) Reflected light from the flowing blood. This is small maybe about 1/1000 th of the value above.

 

So when the MAX sensor is in contact with the body, you see a large rise in sample value. To see the heart rate data, you need to filter out the blood signal by high pass filtering the samples at around 0.5Hz. Then you see the blood signal seperated from the tissue signal.

 

Though nice sensors, Maxim seem very secretive with their analysis algorithms. You may want to look at these for guidance on analysis.

https://www.element14.com/community/docs/DOC-47978/l/cypress-an2313-application-note-for-sensing-pulse-oximeter-with-psoc-1

 

http://www.nxp.com/files/32bit/doc/app_note/AN4327.pdf?tid=AMdlDR

 

http://www.ti.com/lit/an/sprab37a/sprab37a.pdf

 

http://www.ti.com/tool/TIDM-EKG-PULSE

 

For the hardware make sure you have a supply capable of supplying enough current for the LDEs, and with plenty of decoupling local to the MAX.

 

Richard

 

 

 

From: reading-...@googlegroups.com [mailto:reading-...@googlegroups.com] On Behalf Of Anisha


Sent: Monday, February 29, 2016 1:20 PM
To: Reading Hackspace

--

Droi Deka

unread,
Mar 10, 2016, 10:53:29 AM3/10/16
to Reading Hackspace, keltoum...@hotmail.fr
Interesting coincidence that I was looking through the forum while considering joining the hackspace and I noticed this post.
I just "blagged" a couple of free samples of the MAX30102 while getting some more thermocouple amp ICs.  
I thought the MAX30102 would make for an interesting project but I hadn't realised how small these things are now I'm wondering if I might have been a little ambitious :)
So I was wondering if any progress was made interfacing with these devices or if anybody could share an example circuit?  I managed to get some chips, but I don't qualify for the NDA required for the full data sheet and the abridged sheet is fairly sketchy..

I've done SMD soldering before but it looks like these devices would probably need to be done in an oven, (they don't even have exposed legs point an iron at), I assume rlab has such facilities? I would to give that a go...
This could well be the project that gives me that incentive to join and make use of the space, with the various equipment I have been reading about but more especially with the expertise that seems to be around. 

Cheers

DD

mikethebee

unread,
Mar 10, 2016, 4:37:08 PM3/10/16
to Reading Hackspace, keltoum...@hotmail.fr
Hi Droi,

All good reasons to join the space, it is only a month by month commitment but it sounds as though you are the right sort to get loads of value from membership. For me the sheer brilliance of some of the smd device design and soldering skills of members new and older is alway amazing. Come and visit on a Wednesday and you will find this for yourself.

-MTB

Richard Ibbotson

unread,
Mar 11, 2016, 1:17:54 PM3/11/16
to reading-...@googlegroups.com

Seems daft they sample these , then won't give the data sheet. There is no way to be able to program it without the data sheet. At least the lower spec. MAX30100 has a full datasheet.

 

We have success on the hardware and getting data off these devices, there is stiil a lot to do to get a relaible heart rate and oxygen level reading.

We have soldered using both hot air and reworked by hand, though we had to make the PCB pads quite large.

 

Let us know when you can come down, though Ryan and I will be away from 20th March to 3rd April.

Richard

José Francisco Beltrán Sánchez

unread,
Apr 1, 2016, 9:08:07 PM4/1/16
to Reading Hackspace
Hi Mr. Puffer. I have requested the full datasheet to MAXIM, but I have no response yet. Could you share it with me? Thank you in advance.

Richard Ibbotson

unread,
Apr 2, 2016, 12:11:40 AM4/2/16
to reading-...@googlegroups.com
The MAX30102 datasheets are under non disclosure and watermarked so cannot be shared. The MAX30100 datasheets are available for on Maxim. It is crazy that Maxim will sample these chips, but not give data.



Sent via Richard's Phone
07871 256772
--

Dipika Vasava

unread,
Apr 2, 2016, 1:37:01 AM4/2/16
to Reading Hackspace
Can you help me with how to solder the max30100 sensor as it is very small. 

Ryan .

unread,
Apr 2, 2016, 1:40:33 AM4/2/16
to reading-...@googlegroups.com

I have done a lot of smd build and rework in my life and I barbecued two of them here in Shenzhen trying to build them onto boards. You're not the only one having trouble.

Stencil+reflow may be the only reliable way. Overall bottom side heat with a hotplate or IR may work well. Top side heat is not the way, the sensors are v. heat sensitive and melt easily.

--

Richard Ibbotson

unread,
Apr 2, 2016, 2:07:43 AM4/2/16
to reading-...@googlegroups.com
We did hand solder for prototype, but made pcb with long pads out from chip so we could get heat to the pad to the melt solder paste under chip. 



Sent via Richard's Phone
07871 256772
--

urvashi...@gmail.com

unread,
Jun 9, 2018, 1:45:26 PM6/9/18
to rLab / Reading's Hackspace
Hello 

I want to interface MAX30100 sensor to Raspberry pi but am not getting the proper library in python for that

code from https://github.com/mfitzp/max30100

library from https://github.com/kontakt/MAX30100 is not working. Pl suggest ASAP.

Brian Gregory

unread,
Jun 9, 2018, 3:53:09 PM6/9/18
to reading-...@googlegroups.com
Have you got pull up resistors on both I2C lines?

--
You received this message because you are subscribed to the Google Groups "rLab / Reading's Hackspace" group.

To unsubscribe from this group and stop receiving emails from it, send an email to reading-hacksp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Mark Robson

unread,
Jun 9, 2018, 3:57:30 PM6/9/18
to reading-...@googlegroups.com
Assuming you have connected sda and scl lines correctly, what output do you get from the "i2cdetect" command?

Are there any documented registers which you can read to check for the expected value?

In my experience, if you're reading back the address from every address (e.g. 0x7 from address 0x7) that is an electrical problem.

Mark

--
You received this message because you are subscribed to the Google Groups "rLab / Reading's Hackspace" group.

To unsubscribe from this group and stop receiving emails from it, send an email to reading-hackspace+unsubscribe@googlegroups.com.

Richard Ibbotson

unread,
Jun 9, 2018, 7:21:02 PM6/9/18
to rLab / Reading's Hackspace
I have not used the python libraries for Ras Pi, but have not had problems using the MAX30100 or MAX30102 over I2C after any physical or electrical issues are fixed. We used both these devices on 32 Bit arduino with no problems.
They chips are physically difficult to mount and have odd power supply needs, but they do interface to I2C OK. Follow the advice here to establish basic I2C detection and communication before moving on.
The big challenge with these devices is the subsequent data analysis due to the tracking and extraction of the small venous pulse related signals within a very complex and noisy background environment. That is where we spent most of our effort

URVASHI BHAT

unread,
Jun 11, 2018, 3:33:17 PM6/11/18
to reading-...@googlegroups.com

I have got two queries:

1. I want to interface MAX30100 sensor to Raspberry pi but am not getting the proper library in python for that

code from open source https://github.com/mfitzp/max30100

library from https://github.com/kontakt/MAX30100 is not working. Pl suggest ASAP. I am getting some error reg import of library MAX30100. May be that it is a c library and not python library, some problem like that.

2. Also I want to purchase low cost Galvanic Skin Response (GSR) sensor to interface with Raspberry pi. Can u pl suggest as I should get the python code also from open source.

Pl advise.



Thnx n Rgds,

Urvashi Bhat
Scientist/Engineer
Delhi Earth Station
ISRO
Sardar Patel Marg
P.B.No:5227
New Delhi-110021

On Sun, Jun 10, 2018 at 10:32 AM, URVASHI BHAT <urvashi...@gmail.com> wrote:
Hello
Pl help me in resolving the issue of interfacing Raspberry pi with MAX30100
I have connected the sensor as follows

Rpi                                             MAX30100
GPIO6                                        INT
Vcc 3.3v                                     Vin
GND                                           GND
SCL                                             SCL
SDA                                             SDA


Thnx n Rgds,

Urvashi Bhat
Scientist/Engineer
Delhi Earth Station
ISRO
Sardar Patel Marg
P.B.No:5227
New Delhi-110021

--
Reply all
Reply to author
Forward
0 new messages