Charles Gwellem
Posts: 12
Joined: Sun Dec 07, 2014 6:52 pm

Interfacing a Pulse oximeter with a RPI

Mon Dec 08, 2014 8:26 am

Hello dear folks,
I am a beginner with the RPI and a beginner too with computer technology. But I have been given an assignment : I need to read data from a pulse oximeter device using an RPI and display the data on a display.
How can I go about this?
I would be very grateful for any proposals.

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Interfacing a Pulse oximeter with a RPI

Mon Dec 08, 2014 8:45 am

Hi and welcome to the forum.
It would help if you could supply a link to the oximeter, as I'm guessing that most of us will have no idea what it is or how to connect to it otherwise.
rgds,
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Charles Gwellem
Posts: 12
Joined: Sun Dec 07, 2014 6:52 pm

Re: Interfacing a Pulse oximeter with a RPI

Mon Dec 08, 2014 8:58 am

Dear Mr.Texy,
I am honored by your kind attention here is the link:
http://www.medlab-gmbh.de/english/modul ... ry/eg00352

The datasheet and technical specifications for the poximeter are found in this link under the ''download'' rubric
Last edited by Charles Gwellem on Mon Dec 08, 2014 9:44 am, edited 8 times in total.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Interfacing a Pulse oximeter with a RPI

Mon Dec 08, 2014 9:05 am

They have several , please link directly to the product page
and the datasheet.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Charles Gwellem
Posts: 12
Joined: Sun Dec 07, 2014 6:52 pm

Re: Interfacing a Pulse oximeter with a RPI

Mon Dec 08, 2014 9:18 am

Dear Ghan,

I thank you for your attention..here is a more precise link:
http://www.medlab-gmbh.de/english/modul ... ry/eg00352

the datasheet and technical specifications for the poximeter is found in this link
Last edited by Charles Gwellem on Mon Dec 08, 2014 9:45 am, edited 1 time in total.

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Interfacing a Pulse oximeter with a RPI

Mon Dec 08, 2014 9:37 am

Charles Gwellem wrote:Ok thank you for your attention..here is a more precise link:
http://www.medlab-gmbh.de/english/modul ... ry/eg00352

the datasheet and technical specifications for the poximeter is found in this link
The technical pdf suggests it can communicate via the Pi's serial link. Possibly without modification as it says CMOS level and is powered from a Pi safe 3V3.

Charles Gwellem
Posts: 12
Joined: Sun Dec 07, 2014 6:52 pm

Re: Interfacing a Pulse oximeter with a RPI

Mon Dec 08, 2014 9:43 am

Dear Joan,
I am honored by your kind attention and reply.

Do you mean I can just go ahead and connect the POX to the PI without modifiying anything? Did I get you well? If not please enlighten me more about your response.

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Interfacing a Pulse oximeter with a RPI

Mon Dec 08, 2014 9:52 am

Charles Gwellem wrote:Dear Joan,
I am honored by your kind attention and reply.

Do you mean I can just go ahead and connect the POX to the PI without modifiying anything? Did I get you well? If not please enlighten me more about your response.
What I would do and what you should do are two separate things. You will have to read the pdfs yourself to determine whether you think it is safe or not. Perhaps a colleague at work could help?

Charles Gwellem
Posts: 12
Joined: Sun Dec 07, 2014 6:52 pm

Re: Interfacing a Pulse oximeter with a RPI

Tue Dec 09, 2014 10:27 am

Hello Joan,
I have gone through the data sheet and the technical manual of the pulse oximeter. Please can you enlighten me on the major steps i need to carry out especially with the software aspect of the project?My project consists of displaying the pulse oximeter data on a raspberry PI.Very very few of my colleagues know about the Raspberry pi.

thanks

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Interfacing a Pulse oximeter with a RPI

Tue Dec 09, 2014 12:41 pm

Have you a working Raspberry Pi?

I would make the following connections between the Pi and the unit.

Code: Select all

Pi                   Unit
Header               JP2

pin 1 (3V3)    <---> pin 2 VCC (3V3)
pin 6 (ground) <---> pin 1 (ground)
pin 10 (RXD)   <---> pin 6 (TXD)
The following assumes you have a terminal window open on the Pi.

I would then issue the following command at the Pi to set the serial baud rate to 9600.

stty -F /dev/ttyAMA0 9600

The unit should be continuously transmitting (binary) data. Check that it is operating properly by

cat </dev/ttyAMA0 | od -x

The above command should print lots of data. Stop by pressing ctrl+C.

If you cut & paste then post some of the data it should be easy to confirm correct operation. The software to decode the binary is straightforward. Examples are in the pdf.

It should be an hour or so to write and test the software (then a couple of weeks to document and review and obey all other company procedures!).

Charles Gwellem
Posts: 12
Joined: Sun Dec 07, 2014 6:52 pm

Re: Interfacing a Pulse oximeter with a RPI

Wed Dec 10, 2014 6:16 am

Dear Joanna,
I am extremely grateful for all your help.It is helping me alot. I have tried to type in the Source code example for protocol 2 (which is in Turbo C) into the LX Terminal of the RPI. But each time I try to save and compile, I recieve various error messages either about syntax and other features concerning the source code protocol.How can I solve this problem(i.e.the problem of entering the source code, in Turbo C, into the RPI)?

Thank you very much..

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Interfacing a Pulse oximeter with a RPI

Wed Dec 10, 2014 8:26 am

Charles Gwellem wrote:Dear Joanna,
I am extremely grateful for all your help.It is helping me alot. I have tried to type in the Source code example for protocol 2 (which is in Turbo C) into the LX Terminal of the RPI. But each time I try to save and compile, I recieve various error messages either about syntax and other features concerning the source code protocol.How can I solve this problem(i.e.the problem of entering the source code, in Turbo C, into the RPI)?

Thank you very much..
Did you manage to get any output from the device? If so what does it look like?

Charles Gwellem
Posts: 12
Joined: Sun Dec 07, 2014 6:52 pm

Re: Interfacing a Pulse oximeter with a RPI

Mon Jan 12, 2015 2:24 pm

Hi Joanna,
I connected the serial port of theb pulse ox to the USB of the RPi using a serial to usb cable....I powered the Pulse ox with a well regulated 3V3 voltage supply...i issued the following commands in their respective order;

1)to know the name of the usb->serial adapter device on the RPi .

pi@raspberrypi ~ $ lsusb

2)I set the baudrates and other parameters using this command:

stty -F /dev/ttyUSB0 9600 cs8 -parenb -cstopb -crtscts


3) To see the out put:

cat /dev/ttyUSB0

BUT THE OUTPUT I SAW ON THE LX TERMINAL WAS A SERIES OF UNREADABLE CHARACTERS....Please how can go over?

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Interfacing a Pulse oximeter with a RPI

Mon Jan 12, 2015 2:30 pm

Look back at my post, in particular look at the cat command I suggested.

scotty101
Posts: 3958
Joined: Fri Jun 08, 2012 6:03 pm

Re: Interfacing a Pulse oximeter with a RPI

Mon Jan 12, 2015 2:32 pm

There are a few problems with the test you performed.

1. According to page 9 of the datasheet Datasheet, there are 2 protocols; one uses 9600 baud and the other used 4800 baud, check which one you are using.

2. The pulse oximeter does not output in a human readable format. You need to process the data in order to decode the binary data. There are example of c code to do this in the datasheet.

Your next steps
1. Learn how to compile a basic C "Hello World" program on the raspberry pi
2. Learn how to open a serial port with C and print the raw data to the screen.
3. Use the examples in the datasheet as a starting point to decode the binary data from the pulse oximeter to grab the heart rate/oxygen levels etc.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

Charles Gwellem
Posts: 12
Joined: Sun Dec 07, 2014 6:52 pm

Re: Interfacing a Pulse oximeter with a RPI

Mon Jan 12, 2015 8:50 pm

..
Last edited by Charles Gwellem on Fri Jan 16, 2015 2:42 pm, edited 3 times in total.

User avatar
mikronauts
Posts: 2783
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Interfacing a Pulse oximeter with a RPI

Mon Jan 12, 2015 9:17 pm

See http://pyserial.sourceforge.net/pyserial.html
Charles Gwellem wrote:Thank you all very much for your suggestions...But I wish to work with Python programing language, thanks to its simplicity
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Charles Gwellem
Posts: 12
Joined: Sun Dec 07, 2014 6:52 pm

Re: Interfacing a Pulse oximeter with a RPI

Sun Jan 25, 2015 11:56 am

Please can someone write a simple example code I can use to test the pulse oximeter atleast for a begining?
Last edited by Charles Gwellem on Sun Jan 25, 2015 12:20 pm, edited 1 time in total.

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Interfacing a Pulse oximeter with a RPI

Sun Jan 25, 2015 12:00 pm

Charles Gwellem wrote:Please can someone help me write a simple code I can use to test the pulse oximeter?
cat /dev/ttyUSB0 | od -x

Charles Gwellem
Posts: 12
Joined: Sun Dec 07, 2014 6:52 pm

Re: Interfacing a Pulse oximeter with a RPI

Sun Jan 25, 2015 12:24 pm

Thanks alot Joan...I tried that and it produced raw data that looked like this:
"zyz�J�0|zyz�J�0|zyz�J�0|zyz�J�0|zyz�J�0|zyz�J�0|zyz�J�0|zyz"


I am now seeking for a simple example of a program that would contain the source code on page 13 of the puls ox manual
Last edited by Charles Gwellem on Sun Jan 25, 2015 12:35 pm, edited 1 time in total.

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Interfacing a Pulse oximeter with a RPI

Sun Jan 25, 2015 12:27 pm

Charles Gwellem wrote:Thanks alot Joan...I already tried that and it produced raw data...I am seeking for a example of a program that would contain the source code on page 13 of the puls ox manual
If we had sight of the raw data we could see if the results are as expected.

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Interfacing a Pulse oximeter with a RPI

Sun Jan 25, 2015 12:36 pm

You may be able to run the C# program using Mono on your Raspberry Pi. (There's going to be an article on Mono in the next issue of the MagPi magazine, so I've got a Mono test bed set-up, my problem is not having the SpO2 hardware.)

http://www.medlab-gmbh.de/english/downl ... x2pc_c.zip
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Charles Gwellem
Posts: 12
Joined: Sun Dec 07, 2014 6:52 pm

Re: Interfacing a Pulse oximeter with a RPI

Sun Jan 25, 2015 12:47 pm

we expect to see data like this unbder normal circumstances

SPO2=096% BPM=106 PI=01.68% SPCO=--.-% SPMET=--.-% DESAT=-- PIDELTA=+--

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Interfacing a Pulse oximeter with a RPI

Sun Jan 25, 2015 1:19 pm

Charles Gwellem wrote:Thanks alot Joan...I tried that and it produced raw data that looked like this:
"zyz�J�0|zyz�J�0|zyz�J�0|zyz�J�0|zyz�J�0|zyz�J�0|zyz�J�0|zyz"


I am now seeking for a simple example of a program that would contain the source code on page 13 of the puls ox manual
Are you sure? I can not see how the command I suggested could possibly result in that output.

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Interfacing a Pulse oximeter with a RPI

Sun Jan 25, 2015 3:38 pm

Charles Gwellem wrote:Thanks alot Joan...I tried that and it produced raw data that looked like this:
"zyz�J�0|zyz�J�0|zyz�J�0|zyz�J�0|zyz�J�0|zyz�J�0|zyz�J�0|zyz"


I am now seeking for a simple example of a program that would contain the source code on page 13 of the puls ox manual
When you get data like that it's normally one of two things. 1. Baud rate is wrong. 2. Protocol (start bits, stop bits, parity bits) is wrong.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Interfacing (DSI, CSI, I2C, etc.)”