Code Monkey home page Code Monkey logo

Comments (8)

aromring avatar aromring commented on September 13, 2024

Well, no wonder the SpO2 and HR numbers are zero: in your code you have commented out rf_heart_rate_and_oxygen_saturation() - the very routine that does all the signal processing!
Here, try this code and let me know of the outcome. Please copy and paste full output in the Serial monitor.

RD117_ARDUINO_new2.zip

from max30102_by_rf.

jaredwong92 avatar jaredwong92 commented on September 13, 2024

Previously I tried to use the rf_heart_rate_and_oxygen_saturation() routine but it will not run pass that routine. That is why I commented out. Below is the full output in the Serial Monitor

Vbatt= 1.62
blink LED
Initialise MAX30102
Start calculate heart rate
Vbatt= 0.19
blink LED
Initialise MAX30102
Start calculate heart rate

from max30102_by_rf.

aromring avatar aromring commented on September 13, 2024

All right, it's time to see the raw data coming from the sensor. I need it to debug this issue. Please run the attached code and report full output in the Serial monitor.

RD117_ARDUINO_new3.zip

from max30102_by_rf.

jaredwong92 avatar jaredwong92 commented on September 13, 2024

This is the full output in the Serial monitor.
output.txt

from max30102_by_rf.

aromring avatar aromring commented on September 13, 2024

Ah, we are getting somewhere. It looks like your microcontroller is reaching rf_heart_rate_and_oxygen_saturation(), can't handle it, then quits and restarts. This is why it runs setup() repetitively. My guess is that it runs out of memory.
Thus: what microcontroller do you use? When you compile the code (with Arduino IDE, I presume) you get the report of memory usage: what does it say about % memory used by code and data, respectively?

Adalogger's Cortex M0 microcontroller has enough memory and computational power to handle my algorithm. Yours may not...

from max30102_by_rf.

boblongoria avatar boblongoria commented on September 13, 2024

I admire your heart or service for the rookie problems of jaredwong92.
I will attempt to learn from his mistakes and also benefit from your analisis.
Regards,
Bob

from max30102_by_rf.

jaredwong92 avatar jaredwong92 commented on September 13, 2024

I am using ATmega32U4. You are right that the memory usage is very high.
Sketch uses 15160 bytes (46%) of program storage space. Maximum is 32256 bytes.
Global variables use 1902 bytes (92%) of dynamic memory, leaving 146 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur.
Guess I need to use another algorithm to get the HR and SPO2

from max30102_by_rf.

aromring avatar aromring commented on September 13, 2024

Jared,
I suggest a better MCU; apparently ATmega32U4 is insufficient.
Unless you have other issues I consider this issue to be closed.

from max30102_by_rf.

Related Issues (20)

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.