Code Monkey home page Code Monkey logo

protocentral / afe4490_oximeter Goto Github PK

View Code? Open in Web Editor NEW
46.0 15.0 26.0 22.65 MB

This pulse oximetry shield from ProtoCentral uses the AFE4490 IC to enable your Arduino to measure heart rate as well as SpO2 values.

Home Page: https://www.protocentral.com/biomedical/996-afe4490-pulse-oximeter-shield-kit-for-arduino-642078949425.html

License: Other

Processing 3.48% HTML 83.21% CSS 0.09% Java 13.22%
pulse-oximeter pulse-oximeter-shield arduino spo2 afe4490 ppg

afe4490_oximeter's Introduction

ProtoCentral AF4490-based Pulse-oximeter shield for Arduino

Dont have it yet? Buy one here: ProtoCentral AFE4490 Pulse Oximeter Shield for Arduino – v2 (PC-MED-0406) Pulse Oximeter Shield

Dont have it yet? Buy one here: ProtoCentral AFE4490 Pulse Oximeter Breakout Board Kit (PC-MED-0405) Pulse Oximeter Breakout

If you're looking for the Arduino library, it's now moved here: https://github.com/Protocentral/protocentral-afe4490-arduino

This pulse oximetry shield from ProtoCentral uses the AFE4490 IC to enble your Arduino to measure heart rate as well as SpO2 values. Pulse oximetry is an indirect method of measuring the oxygen levels in the blood. The sensor measures the skin's absorbance of red and IR light wavelengths to calculate the oxygen levels. The measurement is done by a probe that clips on to a finger and contains emitters as well as a light sensor. Since the amount of blood flowing through any blood vessel varies (pulses) with the rate of blood from the heart, this can also be used for measuring heartrate without the need for connecting any ECG electrodes. Used along with Brainbay, this shield can display the real-time PPG as well as heart-rate values in addition to SpO2.

Features:

  • TI AFE4490 Single chip pulse pulsoximetry front-end IC
  • Standard Nellcor compatible DB7 connector for probe
  • Calculates Spo2 values with provided code
  • Real-time display of PPG (Photoplethysmogram)

Includes:


  • 1x ProtoCentral Pulse Oximetry shield for Arduino
  • 1x Set of stackable Arduino headers
  • 1x "Nellcor compatible" Pulse oximetry finger probe.

Repository Contents


  • /arduino - Arduino library and example sketch
  • /hardware - All Eagle design files (.brd, .sch)
  • /extras - datasheets and extras
  • /processing - Processing-based Application

Connecting the shield to your Arduino


Connect the ECG/Respiration shield to the Arduino by stacking it on top of your Arduino. This shield uses the SPI interface to communicate with the Arduino. Since this includes the ICSP header, which is used on newer Arduinos for SPI communication, this shield is also compatible newer Arduino boards such as the Arduino Yun and Due.

The Arduino library for this is now available here: https://github.com/Protocentral/protocentral-afe4490-arduino

Wiring the Breakout to your Arduino


If you have bought the breakout the connection with the Arduino board is as follows:

AFE4490 pin label Arduino Connection Pin Function
GND Gnd Gnd
DRDY D2 Data ready(interrupt)
MISO D12 Slave out
SCK D13 SPI clock
MOSI D11 Slave in
CS0 D7 Slave select
START D5 Conversion start Pin
PWDN D4 Power Down/ Reset
DIAG_END NC Diagnostic output
LED_ALM NC Cable fault indicator
PD_ALM NC PD sensor fault indicator
VCC +5v Supply voltage

Using Processing - Data Visualization Software


Processing is a data visualization software, in existence since 2001, used by artists and scientists alike. It’s an open source coding framework based on Java. If you are familiar with the Arduino environment, the Processing IDE is similar and you won’t have much of a learning curve to climb!

The following are the steps to run the code:

1. Download and Install Processing

Download the processing ide latest version from the link

Once downloaded, unzip the archive and install the app as per your OS.

2. Download the Processing code for Pulse Oximeter visualization

a. Download the necessary files & directories or clone to your desktop from GitHub.

b. Unzipping the archive should make a folder by name AFE4490 Oximeter Shield that contains the visualization code.

c. Locate the Processing sketchbook directory on your computer. This should have been created automatically when you installed processing. Depending on your operating system, the path will be as follows:

  • On Windows: c:/My Documents/Processing/
  • On MAC: /Users/your_user_name/Documents/Processing/
  • On Linux: /Home/your_user_name/sketchbook/

Note: This directory appears as "Processing" on Windows/Mac, and goes by the name "Sketchbook" on Linux. Create a subdirectory by name "libraries" if one doesn't exist already.

d. From the above mentioned "AFE4490_Oximeter-master" directory Copy/Move the contents of the AFE4490_Oximeter-master/processing/openview_pulseox folder to the Processing sketchbook directory which is also mentioned above (Locate the Processing sketchbook)

e. Finally, copy the G4P directories from AFE4490_Oximeter-master\Processing\libraries and paste them into the libraries directory of your Processing sketchbook.

f. You are all set now to get your first PPG wave form and SpO2 reading visualized from the AFE4490 Oximeter Shield!

3. Uploading Arduino Sketch For AFE4490 Oximeter Shield

a. Open the Arduino IDE to load the embedded code for AFE4490 Oximeter Shield.

b. Click on File -> Open and Browse the .ino code for Arduino from AFE4490_Oximeter-master\arduino and export the application to Arduino.

4. Open Processing & launch the ces_view_oximeter

a. If Processing IDE was open, close it and reopen to refresh the libraries and sketches. The repositories are not refreshed if the IDE was open while the Sketches and Libraries were being updated.

b. Double-click any of the .pde files in the openview_pulseox directory to open all of the pulse oximeter code in the Processing IDE.

c. If everything done so far was good, clicking the "run" button on the top left corner of the IDE, should run the code! If it does not, make sure you installed your libraries correctly.

d. Once the GUI is running, select the port connect with pulse oximeter shield from the "SELECT PORT" dropdown as shown in the figure below

Port Selection

e. Once the port selection is appropriate the START button gets enabled. Click "START" to initiate visualization

f. You should see the PPG ( RED and IR) waves generated with the values obtained from the AFE4490 Oximeter Shield Breakout Board as shown below.

PPG Wave Form in Processing

License Information

This product is open source! Both, our hardware and software are open source and licensed under the following licenses:

Hardware

All hardware is released under Creative Commons Share-alike 4.0 International. CC-BY-SA-4.0

You are free to:

  • Share — copy and redistribute the material in any medium or format
  • Adapt — remix, transform, and build upon the material for any purpose, even commercially. The licensor cannot revoke these freedoms as long as you follow the license terms.

Under the following terms:

  • Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.

Software

All software is released under the MIT License(http://opensource.org/licenses/MIT).

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Please check LICENSE.md for detailed license descriptions.

afe4490_oximeter's People

Contributors

balavaithy avatar manikandan12345 avatar protocentralashwin avatar venkateshbhat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

afe4490_oximeter's Issues

Layer 2 and 15 in brd

The layer 2 and 15 have any function? There isn't any wire or polygon connected

Best Regards

Pin configuration

Hi,
I am using the ProtoCentral AFE4490 Pulse Oximeter Breakout Board Kit with my Arduino UNO. I am following the instruction and it works as expected.

However, the same code is not working with Arduino UNO WiFi Rev 2.

I need some help in this regard.

Thanks.

Maitreya

About PPG

Hi brother,

It is not an issue, but I have some doubt in ppg probe. Brother whether you are using Transmissive probe or reflective sensor.

finger probe is not working

hi from the first time I run the shield with arduino the probe sometimes it is work normally and sometimes I it is not working it need to disconnect the port many times to work normally please tell me what to do

Ratio Question

Hi,

Would someone be able to explain the line of code (line 436) below and why the numerator is multiplied by 100? Also, possibly what the dc_max represents on the actual PPG signal?

an_ratio[n_i_ratio_count]= (n_nume*100)/n_denom ; //formular is ( n_y_ac *n_x_dc_max) / ( n_x_ac *n_y_dc_max)

Thank you

Porting this code

Hi guys,

I am trying to use this with a raspberry. I used this code and the BCM2835 for hardware management (GPIO etc....).

Most is working (communication, SPI, spo² value seems correct..) but the heartbeat is very unstable (78bpm then 150 then 90...).

Can you point at extra care to have to get this code working on another target? I have seen the "FS" constant that is supposed to be a sampling frequency, but I don't know how to adjust it for my target.

Thank you very much for your help.

How to invert the ppg signal

The ppg signal obtained through this code is an inverted graph nah? therefore i want to invert the ppg signal t get the proper output for my project. Also my project is to calculate hemoglobin concentration, how can i modify the above code to calculate hemoglobin concentration.

I want to get the ppg signal as below

image

Getting very less SPO2 values

Dear Protocentral,

I bought the spo2 shield recently and followed the instructions given in this git. Processing graph output values always shows values in range of 60 to 70. A normal healthy person like I should get values in 94+ range. I came across this section after a brief look at processing code:

` AvgYdata[arrayIndex] = (float)receivedVoltage_RED;
AvgZdata[arrayIndex] = (float)receivedVoltage_IR;
value1 = (float)( AvgYdata[arrayIndex] - averageValue(AvgYdata));
value2 = (float)( AvgZdata[arrayIndex] - averageValue(AvgZdata));
ydata[arrayIndex] = value1;
zdata[arrayIndex] = value2;

    float RedDC = (float) averageValue(AvgYdata);
    float IrDC = (float) averageValue(AvgZdata);

    arrayIndex++;
    if (arrayIndex == pSize)
    {  
      arrayIndex = 0;
      time = 0;
      RedAC = s.SPO2_Value(ydata);
      IrAC = s.SPO2_Value(zdata);
      float value = (RedAC/abs(RedDC))/(IrAC/abs(IrDC));

      /********  Emprical Formalae  *********/
      //float SpO2 = 10.0002*(value)-52.887*(value) + 26.817*(value) + 98.293;
      //  float SpO2 =((0.81-0.18*(value))/(0.73+0.11*(value)));
      
      float SpO2=110-25*(value);


      SpO2 = (int)(SpO2 * 100);
      SpO2 = SpO2/100;
      oxygenSaturation.setText(SpO2+"");`
  1. Is there any issue in the code or the hardware? Please rectify this issue.
  2. Further, the values are not consistent. Sometimes there is big difference between two consecutivve values. Is there any special care needed for finger position.

STMF103RB

Hello,
Using this microcontroller with AFE4490 Breakout Board Kit and Pulse Oximeter Shield I have the same bad problems:

2_method

I really haven't idea what to do, try much combinations buy finally my set-up doesn't work correctly. Additionally OpenView 64-bit return error log after chosing Port COM and Device so I try to use 32-bit. Please contact

Help

Hi guys, I'm having trouble getting this to work. I followed the instructions as best as I could. Unfortunately I'm not getting any readings. When I click the run button, I'm able to select the port and press start but I do not get any readings. The RED PPG is a flat green light while the IR doesn't register. No SpO2 value is displayed.

I'd be grateful if you could help me as I am inexperienced with such projects.

Pulse Waveform

Hello,

I am using this shield as part of a larger device and I am relatively inexperienced with Arduino. I have somewhat of an understanding of the code, however, I was wondering if you could provide some guidance for the extraction of the raw pulse waveforms? I am trying to graph the waveform along with waveforms from two other probes (one ear PPG and one ECG). Any help is much appreciated! Thanks!

Issue when running Processing

I followed the instructions on the Github page, and when running the .pde files in Processing, I got this error:

===================================================
G4P V4.0.4 created by Peter Lager

ControlP5 2.2.6 infos, comments, questions at http://www.sojamo.de/libraries/controlP5
################ EXCEPTION IN EVENT HANDLER ################
An error occured during execution of the eventhandler:
CLASS: openview_pulseox METHOD: start_click
Caused by java.lang.NullPointerException
openview_pulseox.start_click(openview_pulseox.java:829)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
g4p_controls.GAbstractControl.fireEvent(Unknown Source)
g4p_controls.GButton.mouseEvent(Unknown Source)
g4p_controls.GWindowImpl.mouseEvent(Unknown Source)
sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
processing.core.PApplet$RegisteredMethods.handle(PApplet.java:1436)
processing.core.PApplet.handleMethods(PApplet.java:1638)
processing.core.PApplet.handleMouseEvent(PApplet.java:2749)
processing.core.PApplet.dequeueEvents(PApplet.java:2652)
processing.core.PApplet.handleDraw(PApplet.java:2493)
processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)
processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)
##############################################################

What would cause this error? I am using the version 2 pulse oximeter shield.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.