Back

MATLAB Pulse Oximeter

Laboratory project for Medical Instrumentation and Devices course.

Project Overview

  • Goal: build a pulse-oximeter system capable of estimating real-time SpO2
  • Designed the hardware front-end to convert the photodiode output from a Nellcor probe into a usable photoplethysmograph (PPG) signal
  • Created a two-way communication link between MATLAB and Arduino for LED control and data streaming
  • Developed a real-time processing and visualization GUI to display signals, metrics, and system status

Final Product

Pulse Ox Hardware
Design Features
  • Pulse-ox sensing using red/IR photodiodes front-end and synchronized LED driving.
  • Full analog conditioning chain, delivering a clean PPG waveform.
  • Bidirectional MATLAB-Arduino link for LED control, timing, and transmission of PPG data.
  • Robust packet handling with checksums, timestamps, and error reporting for reliable data acquisition.
  • Real-time digital signal processing pipeline for filtering and AC/DC amplitude extraction.
  • Live SpO2 estimation using R-ratio calculation.
  • Interactive MATLAB GUI for data visualization and system control.

System-Level Block Diagram

Pulse Oximeter Schematic

Click on the expandable tiles below for detailed technical information on each component of the system.

Hardware Front-End

Click to expand

Pulse Oximeter Schematic: Front-End
Results
MCU Acquisition & Serial Protocol

Click to expand

Pulse Oximeter Schematic: Protocol
Digital Signal Processing

Click to expand

DSP Block Diagram
DSP block diagram: signal flow for filtering and AC/DC ratio calculation.
  • Fourth-order Butterworth low-pass filter (4 Hz cutoff) to suppress remaining quantization noise and high-frequency artifacts
  • AC Component: Took maximum peak-to-trough distance, enforcing a minimum peak separation of ~0.4 s (~150 BPM)
  • DC Component: Took median value of super low-pass filtered (0.5 Hz cutoff) signal
  • Computed AC/DC ratio for both red and IR wavelengths to calculate R value:
$$R = \frac{(\text{AC}/\text{DC})_{\text{Red}}}{(\text{AC}/\text{DC})_{\text{IR}}}$$
  • From here, R was fit to an empirical calibration curve to estimate SpO2 using a linear approximation:
  • $$\text{SpO}_2\ (\%) = -25R + 110$$
Graphical User Interface

Click to expand

MATLAB GUI demo: controls, live traces, and diagnostics.

I built a MATLAB App interface that acts as the dashboard for the pulse-oximeter system, allowing for device control and real-time visualization of incoming data and the DSP pipeline.

Key Design Features
  • Configurable LED Control: User-defined red/IR LED duration, intensity, and deadtime, transmitted over USB-CDC serial.
  • Live Data Acquisition: Continuous streaming of timestamped PPG samples from the Arduino with packet validation and error tracking.
  • Real-time Data Visualization: Dynamic plotting of received PPG signals with scrolling time windows.
  • Real-time DSP Display: Visualization of filtered signals, DC baseline estimation, and AC amplitude extraction.
  • Physiological Metrics: Live computation and display of R-values and SpO2 estimates.
  • Diagnostics Console: Packet rate, checksum/framing errors, and system warnings shown in real time for transparent firmware debugging.
  • Acquisition Controls: Start/stop logic managing serial state, buffers, and command sequencing.
Mixed-Signal Circuit Design
Embedded Arduino Firmware
Custom Serial Protocols
Digital Signal Processing
Real-Time Data Acquisition
GUI Design