Gas station without pumps

2016 February 21

Optical pulse monitor software

Filed under: Circuits course,freshman design seminar — gasstationwithoutpumps @ 18:43
Tags: , , ,

I have previously written several posts about doing an optical pulse monitor as a lab exercise in the applied electronics course or as a project in the freshman design seminar. Most of what I’ve written up as has been the electronics design, with recording using PteroDAQ and post-processing using filters written in Python for display using matplotlib or gnuplot.

I decided today to try writing the software to do the pulse monitor on the Teensy and report the pulse rate out the serial port.  This meant sampling at a fixed rate, doing digital bandpass filtering to remove drift and noise that is not eliminated by the electronics, detecting rising edges in the filtered output (with hysteresis to increase noise immunity), and converting the measured period to beats per minute.  I used the LED on the board to report the pulses detected (flashing the light synchronized with the pulse).

I also added some tests to see if the pulse has been lost, and only report the pulse rate if there have been enough pulses properly detected since the last loss so that a smoothed pulse rate can be reported.

I output the time, the unsmoothed pulse rate, and the smoothed pulse rate to the serial monitor, and I can save that output to a file for plotting:

The movement artifacts around 20s and 40s are greatly reduced by either averaging or median filtering, but median filtering provides a more stable output. At 70s, I removed my finger from the sensor for about 2s, so that the pulse was lost and had to be reacquired.

The movement artifacts around 20s and 40s are greatly reduced by either averaging or median filtering, but median filtering provides a more stable output.
At 70s, I removed my finger from the sensor for about 2s, so that the pulse was lost and had to be reacquired.

 

 

 

Before anyone asks, the pulse rate of 44 bpm is normal for me when resting—this is not likely to be a timing bug.

I’ll also want to try the 240×320 RGB ILI9341 TFT display that I bought, so that I can display the pulse (and maybe the pulse waveform) without needing a USB connection for anything but power.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.