4 Replies Latest reply on Mar 10, 2018 3:31 AM by ShrutikaNipane

    Max30100(SpO2 sensor) with PSOC 4 BLE


      Hi, I'm working on an implementation of Max30100 sensor with my PSOC 4 BLE kit. As mentioned in the datasheet I am getting 4 bytes of data. First two bytes represent IR values, while the next two represent Red values. But I am unable to understand which one is for AC level and which is for DC?


      Datasheet of Max30100 - https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf

      Psoc project file -


        • 1. Re: Max30100(SpO2 sensor) with PSOC 4 BLE

          Can you clarify your question more? What do you mean that there is an AC and DC signal? The values you are reading from the FIFO are ADC counts for the IR and Red LEDs respectively?


          PS: Based on the data in the image, it looks like you have the Low and High bytes flipped for endianness, as the Low bytes are not changing as much compared with the High bytes changing widely

          • 2. Re: Max30100(SpO2 sensor) with PSOC 4 BLE

            Yes, these are the ADC counts for IR and Red LEDs. In order to get 1 complete sample we have to read the data register four times. Out of these 4 bytes, the 1st 2 bytes represent IR data and the next two represent Red LED's data (i've plotted it as 2bytes separately in order to avoid confusion). So, the problem is they haven't mentioned which byte represent DC value anywhere in the data sheet. It is required as I have to put it in a formula which is            

            R = (AC_R/DC_R)/(AC_IR/DC_IR)


            Also, if I plot IR and Red LED's data separately on serial plotter, then it shows a proper plethysmogram but RED LED's data toggles between just 2 values when plotted simultaneously with IR. What could be the possible reason behind this?

            • 3. Re: Max30100(SpO2 sensor) with PSOC 4 BLE

              The chip does not give values for AC versus DC, it gives voltage readings at the specified rate for the IR/Red readings. You will need to process the data from the raw ADC voltage readings into separate AC/DC values in order to calculate your heart rate measurement, and will need to deal with the calculations that that entails.


              Based on these documents:



              And the datasheet for the sensor: https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf

              I tried running some of the calculations in an excel sheet, but I must be doing the math wrong, or missing something, as the oxygenation levels are too low. But, either way I believe the values from the sensor are only raw data and need to be processed before use. The AC component I took to be the difference between the maximum and minimum measurements on the data, and the DC is the average of the data measurements. Also, it would seem that the data is stored/output as High Byte, Low Byte, but it is weird that the low bytes are not changing much. Also, unless you are setting up the Maxim sensor before reading values, it could be set in the wrong mode/settings as well.

              1 of 1 people found this helpful
              • 4. Re: Max30100(SpO2 sensor) with PSOC 4 BLE

                Thank you very much. I have one more doubt. The 4 bytes of data we get is in uint8 format. As I require ratio of some values, I have to convert that data into float. I've tried using type casting but the program unexpectedly stops running. Is there any other way to do it?


                So, we tried to send these bytes to node-red using this code

                var abc=msg.payload.split(" ");

                var IR_H={payload:parseFloat(abc[3])};

                var IR_L={payload:parseFloat(abc[4])};

                var R_H={payload:parseFloat(abc[5])};

                var R_L={payload:parseFloat(abc[6])};

                var R=R_L/IR_L;


                return R;


                Still, it is not working in Node-RED.