In this assignment you will build a pulse/oximeter, use the DAQ toolbox to interface to the computer, then write software to extract your heart rate and blood oxygenation from the fluctuating voltages.
Modern pulse/ox units use two LEDs and a photosensor to get the absroption of light through your finger tip at two different wavelengths. From the ratio of absorption of the two wavelengths, you can derive the hemoglogin oxygen level. We are going to use IR, 940 nm (LTE4208), and red LEDs, 660 nm, and a OPT101 photosensor. The OPT101 is useful because it includes a photodiode and a transimpedance amplifier to convert photocurrent into voltage. The IR and red LEDs need to be alternately turned on around 100 times/second so that absorbance measurements of both wavelengths can be made in a small fraction of a heartbeat cycle.
The circuit below uses two transistors to gate the LEDs from the NIDAQ or from a 555 timer. The design below uses a 555 timer to generate a square wave. A CD4066 quad switch sample and hold is used to demux the two signals. A LM358 will be used as sample and hold buffer and for gain/filtering. To test the IR led you can see a slight glow in the IR emitter with your cell phone camera because the camera is slightly sensitive to infrared light. You will need to input four voltages to the NIDAQ.
A slow analog input program shows how to set up the DAQ interface for one channel, and plots the data without scrolling. This may be useful for debugging. You will need to make a movie of your scrolling data. The following code (taken from the Matlab command
help addframe) shows how to make an AVI file which can be played using Windows Media Player. An example AVI shows a startup transient as I put my thumb into the sensors, then several seconds of heart beat, then a transient as I removed my finger. At about 25-28 seconds into the recording, I did a gentle Valsalva maneuver which reduces heart stroke volume. You can see the reduced signal during these few seconds.
fig=figure; set(fig,'DoubleBuffer','on'); set(gca,'xlim',[-80 80],'ylim',[-80 80],... 'nextplot','replace','Visible','off') vidobj = VideoWriter('example.avi'); open(vidobj); x = -pi:.1:pi; radius = 0:length(x); for i=1:length(x) h = patch(sin(x)*radius(i),cos(x)*radius(i),... [abs(cos(x(i))) 0 0]); set(h,'EraseMode','xor'); frame = getframe(gca); writeVideo(vidobj,frame); end close(vidobj);
Example from 2013, but with only the IR channel. See old lab.
To compute the blood oxygen level, refer to the references
Quitbutton should end the data acquisition and close the figure.