Pulse Oximeter Module Problem

I have problems with the pulse o2 meter.
I just got my FEX Cobra II Net board and the pulse o2 module.
Connected the module to port 5 and copyed the code from here:
https://www.ghielectronics.com/community/forum/topic?id=10950

The issue I have: when I dont have my finger in the module it get the the pulseOximeter_ProbeAttached event and
pulseOximeter_Heartbeat event. When I insert my finger the pulseOximeter_Heartbeat event stops and I cant measure any readings.

If I boot the device with the finger inserted no events are fired.

Have looked over the code and not much I can do or change, the triggers for these events are deep under my code.

Any tips or known issues?
Have tried to search the forums without any luck.

The code:
In ProgramStarted()

            pulseOximeter.ProbeAttached += new PulseOximeter.ProbeAttachedHandler(pulseOximeter_ProbeAttached);
            pulseOximeter.ProbeDetached += new PulseOximeter.ProbeDetachedHandler(pulseOximeter_ProbeDetached);
            pulseOximeter.Heartbeat += new PulseOximeter.HeartbeatHandler(pulseOximeter_Heartbeat);

The functions:

  void pulseOximeter_ProbeDetached(PulseOximeter sender)
        {
            Debug.Print("Probe Detached");
 
        }
 
        void pulseOximeter_ProbeAttached(PulseOximeter sender)
        {
            Debug.Print("Probe Attached");
 

 
            _pulse = 0;
            _spo2 = 0;
        }
         
        
        void pulseOximeter_Heartbeat(PulseOximeter sender, PulseOximeter.Reading reading)
        {
            Debug.Print("Heartbeat");
            Debug.Print("Pulse: " + reading.PulseRate);
            Debug.Print("SPO2: " + reading.SPO2);
            Debug.Print("Signal: " + reading.SignalStrength);
 
             
            if (_pulse != reading.PulseRate || _spo2 != reading.SPO2)
            {
 
                _pulse = reading.PulseRate;
                _spo2 = reading.SPO2;
            }
        }

-Thomas

Here is a demo project I did with source code for the Pulse Oximeter perhaps there is something in here that can help.

https://www.ghielectronics.com/community/forum/topic?id=10663&page=1

@ Duke Nukem,

I basically copied your code so thanks for the example. It looks like my probe does the invers of what it should do. I get a heartbeat when there are no finger and no heartbeat with the finger inserted. It does not detect any Attached/detached events other than attached at program startup if there are no finger attached.

Cant understand what the problem is other then maybe a broken probe but it is brand new…

I have not given up on my Pulse SPO2 project but cant get it to work. Tried a couple of samples but they all give the same result.

If I start the program without my finger in the probe the ProbeAttached is fired at startup, and I keep getting Heartbeat event with static readings.

If I insert my finger, Heartbeat stops and no other events are fired. Remove finger and Heartbeat start firing again.
If I start my application with the finger in the probe the ProbeAttached event is NOT fired before I remove my finger and then I get Heartbeat events. It look inverted in some sort.
I have included my code latest test code but cant see what can be wrong.

Any pointers from GHI on this? Is my probe defect?

     // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
            /*******************************************************************************************
            Modules added in the Program.gadgeteer designer view are used by typing 
            their name followed by a period, e.g.  button.  or  camera.
            
            Many modules generate useful events. Type +=<tab><tab> to add a handler to an event, e.g.:
                button.ButtonPressed +=<tab><tab>
            
            If you want to do something periodically, use a GT.Timer and handle its Tick event, e.g.:
                GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
                timer.Tick +=<tab><tab>
                timer.Start();
            *******************************************************************************************/


            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.

            // Event will fire when the probe has been placed on a finger
            pulseOximeter.ProbeAttached += new PulseOximeter.ProbeAttachedHandler(pulseOximeter_ProbeAttached);

            // Event will fire when a probe has been removed from a finger
            pulseOximeter.ProbeDetached += new PulseOximeter.ProbeDetachedHandler(pulseOximeter_ProbeDetached);
            pulseOximeter.Heartbeat += new PulseOximeter.HeartbeatHandler(pulseOximeter_Heartbeat);

        }



        
        void pulseOximeter_ProbeDetached(PulseOximeter sender)
        {
            Debug.Print("Probe Detached");
 
        }
 
        void pulseOximeter_ProbeAttached(PulseOximeter sender)
        {
            Debug.Print("Probe Attached");
 
        }
         
        
        void pulseOximeter_Heartbeat(PulseOximeter sender, PulseOximeter.Reading reading)
        {
            Debug.Print("Heartbeat");
            Debug.Print("Pulse: " + reading.PulseRate);
            Debug.Print("SPO2: " + reading.SPO2);
            Debug.Print("Signal: " + reading.SignalStrength);

        }

Have you tried using the module on different sockets if any are available? Or different boards if you have any?

I’d also try swapping Gadgeteer cable and checking for damaged/bent pins; it could be a signal integrity issue

One other person I helped figured power problems were the cause of similar problems they were having (driving a display and the oximeter), I don’t have a FEZ Cobra II so I can’t try to replicate your project here, but maybe someone else can.

@ Duke Nukem, external power supply did the trick, thanks for the tip…

Should be dockumented some place, I am running the FEZ Cobra II Net with only this module, no display nothing and it was not able to power the system using USB…

Thanks again :slight_smile: