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.
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.