Build Log: Blood Pressure Triggering System for MRI

Topic: Blood Pressure Triggering System for MRI

I'm an engineering student working in collaboration with a group of scientists in a major Canadian hospital. The goal of this project is to build an open-source triggering system for retrospective gating in fetal MRI. I think that this project will be of interest here, so I've decided to keep an build log here.


The data collection rate of MRI is very slow. This means that when imaging the heart, the image will be subject to substantial motion artifact. The solution to this problem is a technique known as retrospective gating. In retrospective gating, MR compatible ECG leads connect the patient directly to the scanner. This allows the scanner to synchronize it's data collection with the cardiac cycle, and the result is a video of the heart with reasonable quality.

ECG signals are well suited to being used for cardiac gating, because they are highly consistent, easy to collect in a non-invasive manner, they're an electrical signal, so they propagate quickly, and they have nice sharp points that lend themselves well to digital signal processing. By comparison, blood pressure is relatively inconsistent, propagates slowly, and is substantially more difficult to process in real time.

For our upcoming experiments in the MR lab, we are attempting to image fetal hearts prenatal (first in animals). It is essentially impossible to acquire an ECG signal of sufficient quality from a fetal heart, so we're going to be using blood pressure wave-forms instead.

My goal is to design a system with Arduino due which will collect this waveform from an instrumentation pathway, process the signal in real time, and send a 5V TTL signal in real time to scanner at consistent point in the pressure waveform after every heartbeat.


  1. The pressure waveform is collected by an MR compliant pressure catheter, amplified and converted into a 625Hz digital signal by a proprietary signal conditioning unit.

  2. Triggering the MRI requires a 5V TTL pulse signal applied for >2ms through an audio style connector

  3. The unit's pulse detection sensitivity must be manually adjustable by the experimenter to ensure that it doesn't fire too often or miss beats.

  4. The Arduino must send sample values and the precise timing of its trigger pulses to an attached computer in near real time, so that the scanner operator can tell whether or not the system is operating properly. This data is also useful for diagnostic and algorithm testing purposes, so it must be permanently saved.

  5. The system must be sufficiently robust that it will continue to operate properly without code modification or rewiring after I leave my research position.

My code for this project is stored here: GitHub - JoshBradshaw/mriTriggering: A project on Arduino Due for converting an arterial pressure waveform into a triggering signal for MRI


  1. Low pass filter of the input signal using a modified version of the arduino signal filtering library.

  2. Detection of the pressure peaks on the waveform using a modified version of the slope-sum function algorithm (developed at MIT, paper named in my code) and a naive peak detection algorithm. This algorithm detects the peaks with ~20ms delay, which is acceptable for our application because that the latency is consistent. This software was tested against the pressure waveforms in the SLPDB:

TODO: provide an image representing the output of the algorithm in response to standard blood pressure pulses

  1. A working prototype in which I run the peak detection code on the Arduino, and simulate the pressure waveform using a digital arbitrary waveform generator connected to Analog Input 1.


  1. Adding a level shifter to the 3.3V digital output to amplify it to 5V.

  2. Using a USB host shield to read in the digital pressure values from our signal conditioning module (the output is very similar to the digial scale in this tutorial: so that will be my starting place)

  3. Collecting some more data to test the system with in collaboration with the cardiology department of the hospital.

  4. Attaching connectors to the Arduino so that lab techs will be able to connect and switch cables easily.

  5. Building a housing to store the finalized device in that will make it easy to transport the setup and connect everything to it very quickly. Time in the scan room is costs many thousands of dollars, so its important that everything is professionally labelled and assembled nicely.

  6. Writing a small real time plotting application using python's matplotlib library so that the experimenter can watch the blood pressure waveform in real time and see the triggering signal fire.

Please excuse the messiness of my code. I'm pretty new to this platform and the C++ programming language. Any suggestions are welcome.

If anyone has any questions about the science/experiments I will happily provide further readings.

Thanks for sharing with us, looks very good, you're acting quite professional.

Waw, congratulation for your work! :smiley:

After a couple months of hard work, this build is nearly finished. The full build log, photos and information are available on my github.

Project site and documentation: Arterial BP Triggering

Code Repository: GitHub - JoshBradshaw/Arterial-BP-MRI-Triggering-Unit: An MRI triggering unit developed for animal experiments

I ended up using a Teensy for the final implementation, because it was fast and had good quality ADCs. The notes in my build log should be instructive for anyone working with pressure sensors or pulse oximeters.

I want to extend a big thanks to the community for developing all of the tools that made building this such a pleasant process. Experiments in the MRI start in two weeks, and I'm very excited!