Heart Rate Click: On EasyPIC v7 (with MikroC code)

10
Some of the links on this blog are affiliated links. READ MORE

The Heart Rate click from MikroElektronika is a pulse-oximeter featuring one MAX30100 sensor, plus all the required additional circuits, including the 1.8V power supply implemented with an AP7331 low dropout regulator. The click boards requires only a 3.3V power supply (sorry Arduino users, there’s no 5V version of this click board). Communication with the host is done via I2C interface, plus one INT pin that can be configured in software.

The MAX30100 is an optical, reflective sensor that combines one IR and one red LED, a photodetector, plus a low noise analog processing stage, which among other things performs ambient light cancellation. The analog signal is fed into an A/D converter with programmable resolution and integration time. A digital filter follows, then the signal is sent to the host microcontroller via I2C. A temperature sensor is also provided, as temperature compensation is needed in precise SpO2 determination.

With this being said, at the first glance things should be nice – just let the sensor do the hard work. In practice things are not that bright – the sensor does return only the IR and Red reflectance, leaving the tasks to determine the heart rate and SpO2 to the user. Moreover, there’s a complicated procedure to read the acquired data, involving FIFO register as circular buffer, with read and write pointers stored in separate registers. Another register stores the number of FIFO overflows (the number of lost samples). This overflow register tops sat 0x0F, after that we don’t know how many samples we have lost.

EasyPIC v7 with Heart Rate Click

EasyPIC v7 with Heart Rate Click

I have spent over one week to try to understand how this sensor works, and all I could do so far is to get a steady data flow, and to show the red and IR reflectance data on an LCD. The development board used in this blog post is an EasyPIC v7, with PIC18F45K22 microcontroller, at a clock frequency of 8MHz. The reason for using this clock rate is that the LCD refuses to work on higher frequencies when powered from 3.3V.

Only I2C communication is used. The interrupt pin of the MAX30100 is not used, as the INT pin of the click board is shared with the LCD data lines, and is set as output by the LCD routine.

1 2 3 4 5
Share.

10 Comments

  1. Hi TEODOR !
    I’m working on this project, too. All I got is just as you. I still don’t know how to determine the SpO2 and heart hate information.
    Hope you find this soon!

    • Yes, one can use the serial port to send real time data to PC. There’s even an FTDI USB-UART chip on the EasyPIC v7, so sending the data to PC should be easy.

      • But what about if i dont use that EasyPIC v7? I’m trying to run it on MSP430 launchpad and also stucked to the spo2 algorithm.
        Thanks

          • Yeah, but slaa655 isn’t good example for my project… Your is pretty close to mine, however. Did you find some spo2 algorithm wich could be interpreted to EasyPIC v7?

  2. Thank you for this useful post!

    This technique is based on Photoplethysmography PPG that detect blood volume change in the vessels by the mean of non-invasive optical technique.

    The idea behind the HR and SpO2% is quite simple and can be acquired very easily:

    1- For HR you need to detect two sequence peaks or troughs of the signal ( in this case value (two sequence lowest or two highest) and then multiply (sample rate * 60)/difference between two (peaks or trough) to acquire heart beat per mints ( bpm)
    2- For SpO2% you need to do calibration of this particle sensor (MAX10030) to get highly accurate result but for the sake of limit resource and get good results one can use empirical curve or table that you need to save it in the chip and decided which ratio represent oxygen level.
    The algorithm
    ratio of ratio (RR)= (Ratio of Red/Ratio of IR)= [ ( AC amplitude/ DC )of red ] / [ ( AC amplitude/ DC )of IR ]
    and you will get RR and every RR is correspondence to oxygen level %

    I hope this is useful and for more details you can look at my publications

    http://www.mdpi.com/2079-6374/5/2/288

    http://www.mdpi.com/1424-8220/15/10/25681

    http://spie.org/Publications/Proceedings/Paper/10.1117/12.2076582

    http://spie.org/Publications/Proceedings/Paper/10.1117/12.2044640

    • SIMRANPREET KAUR on

      Sir I am working with heart rate 3 click which uses SFH 7050 and AFE 4404. MicroC code is given in its documentations. I am not able to cope up with it and need a arduino code. So please tell me step by step what all i need to do to operate this module.
      relevant data shoul be mailed on ksimranpreet1@gmail.com

      • Hi!

        It just happens that I have one Heart Rate 3 click on its way to me. Next week I will have it, and I will do some testing on Arduino.

Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.