All Projects → jeffmer → tinyPulsePPG

jeffmer / tinyPulsePPG

Licence: Unlicense license
ATTiny85 Pulse Oximeter with Photoplethysmogram (PPG) display

Programming Languages

C++
36643 projects - #6 most used programming language
objective c
16641 projects - #2 most used programming language
OpenSCAD
209 projects

Projects that are alternatives of or similar to tinyPulsePPG

open-watch
An open-source handmade smartwatch. All of the codes, PCBs and schematics are available. ⌚
Stars: ✭ 35 (-66.67%)
Mutual labels:  pulse-oximeter, max30102
ATtiny85-TinyDFPlayer
MP3-Player
Stars: ✭ 22 (-79.05%)
Mutual labels:  attiny85
antispy-jammer
Simplest ultrasonic ANTISPY voice recording jammer based on ATTINY13 / ATTINY85 / ARDUINO with PAM8403 module driving piezo ultrasonic transducers (and optionally AD8933 signal generator)
Stars: ✭ 39 (-62.86%)
Mutual labels:  attiny85
ATtiny85-TinyFMRadio
FM Radio with RDS
Stars: ✭ 51 (-51.43%)
Mutual labels:  attiny85
franzininho-diy-board
Placa Franzininho DIY - Placa compatível com Arduino no formato DIY para oficinas de soldagem
Stars: ✭ 100 (-4.76%)
Mutual labels:  attiny85
max30102
max30102 full function driver
Stars: ✭ 88 (-16.19%)
Mutual labels:  max30102
DigiOS
Mini OS emulator for Digispark (an Attiny85 based microcontroller).
Stars: ✭ 46 (-56.19%)
Mutual labels:  attiny85
ATtiny84-TinyCalibrator
OSC Calibrator and High-Voltage Fuse Resetter for 8-Pin ATtinys
Stars: ✭ 39 (-62.86%)
Mutual labels:  attiny85
micronucleus-firmware
Fork for the firmware / digispark part of the micronucleus repository
Stars: ✭ 50 (-52.38%)
Mutual labels:  attiny85
CorePartition
Universal Cooperative Multithread Lib with real time Scheduler that was designed to work, virtually, into any modern micro controller or Microchip and, also, for user space applications for modern OS (Mac, Linux, Windows) or on FreeRTOS as well. Supports C and C++
Stars: ✭ 18 (-82.86%)
Mutual labels:  attiny85
timonel
ATtiny85/45/25 I2C bootloader
Stars: ✭ 108 (+2.86%)
Mutual labels:  attiny85
AnalogClock
Project to sync analog clocks to a few milliseconds.
Stars: ✭ 29 (-72.38%)
Mutual labels:  attiny85
AttinySound
sound generation on the AVR-Attiny cpus
Stars: ✭ 40 (-61.9%)
Mutual labels:  attiny85
ATtiny85-USB-C-Tester
Simple USB-C Power Delivery Tester
Stars: ✭ 20 (-80.95%)
Mutual labels:  attiny85
max30102-tutorial-raspberrypi
This repository is unofficial porting of Arduino sample code of MAXRESDEF117#(max30102) HR/SpO2 sensor
Stars: ✭ 44 (-58.1%)
Mutual labels:  max30102
ATtiny85-TinyCharger
Single-Cell Li-Ion Battery Charger with Monitoring
Stars: ✭ 20 (-80.95%)
Mutual labels:  attiny85
Pjon
PJON (Padded Jittering Operative Network) is an experimental, arduino-compatible, multi-master, multi-media network protocol.
Stars: ✭ 2,615 (+2390.48%)
Mutual labels:  attiny85
ES-Timer
A USB timer powered by Digispark ATtiny85 according to 🍅 pomodoro time management technique
Stars: ✭ 45 (-57.14%)
Mutual labels:  attiny85
ATtiny85-TinyLoad
Electronic Dummy Load
Stars: ✭ 32 (-69.52%)
Mutual labels:  attiny85
avr-high-voltage-serial-programming
AVR high-voltage (HV) serial programming for ATtiny
Stars: ✭ 34 (-67.62%)
Mutual labels:  attiny85

tinyPulsePPG

This project implemented on an ATTiny85 displays a moving Photoplethysmogram together with pulse rate and estimates of SpO2 - blood oxygen percentage. It uses an SSD1306 128x32 OLED display and a Max30102 sensor. It is emphasised that this should not be used for medical purposes. The computation of SpO2 is very approximate and not calibrated in any way. The project is an exercise in software and hardware parsimony.

Hardware

The system was implemented on a prototyping board as shown below:

Image

The circuit diagram is:

image

The ATTiny85 is configured to run at 16 MHz using Spence Konde's ATTinyCore. Consequently, according to the datasheet, the supply voltage should be >4.5V. In fact, it seems to run quite happily from a lipo battery (3.7 - 4.2V).

Operation

After a few seconds the following screen is displayed:

image

When a finger is placed on the sensor, the PPG, heart-rate and two estimates of blood oxygen are displayed (discussed below):

image .......... image

The red led pulses once per heart beat. The PPG display is updated every 50ms.

Software

Needed library In order to build this to the ATTiny85 you need to install the library ATTinyCore This core can be installed using the boards manager. The boards manager URL is:

http://drazzy.com/package_drazzy.com_index.json

File->Preferences on a PC, or Arduino->Preferences on a Mac, enter the above URL in "Additional Boards Manager URLs Tools -> Boards -> Boards Manager... *If using 1.6.6, close boards manager and re-open it (see below) Select "ATTinyCore by Spence Konde" and click "Install".

Driver issue - The Maxim max30102 sensor used is mounted on a MH-ET LIVE breakout board. The Maxim datasheet for the max30102 implies but does not state explicitly that LED1 is Red and LED2 is Infrared (IR), however, if the amplitude of LED1 is set to zero, the red led (as depicted in the place finger) picture remains lit, while if LED2 is set to zero, the red led is extinguished. The obvious conclusion is that LED1 is IR and LED2 is Red (i.e. swapped) which also works when computing blood oxygen - see below. I mention this as the most common driver used in Arduino projects for the max30102 is the Sparkfun 3010x driver which clearly identifies LED1 with Red and LED2 with IR. This may be true for the max30105 device mounted on the Sparkfun board but does not seem to apply to the max30102 on the MH-ET-LIVE board.

Spo2 calculation "SpO2 stands for peripheral capillary oxygen saturation, an estimate of the amount of oxygen in the blood. More specifically, it is the percentage of oxygenated haemoglobin (haemoglobin containing oxygen) compared to the total amount of haemoglobin in the blood (oxygenated and non-oxygenated haemoglobin)."

Oxygenated haemoglobin and deoxygenated haemoglobin have different light absorption characteristics for red and IR wavelengths. This is the basis for sensors like the max30102. The calculation uses the ratio:

R = (AC_red/DC_red)/(AC_IR/DC_IR)

where AC_xxx is the fluctuating component of the xxx signal and DC_xxx is the fixed component. tinyPulsePPG uses R in two different formulas. The upper percentage is from the classic formula:

R = 104 - 1.7 * R

The lower uses a table from the Maxim Arduino driver which is an approximation of the formula:

-45.060 * R * R + 30.354 * R + 94.845

The AC is computed in tinyPulsePPG as the peak to peak amplitude of the signal after the DC element has been removed. the DC element is computed by an exponential moving average filter and the AC is also filtered. I have not experimented enough with the constants in these filters to determine the effect on the SpO2 calculation or indeed how reliable this method is of computing these quantities.

PPG display The read and IR signals from the sensor go through two stages of filtering. The first as described above is removal of the DC element. The second is a moving average filter which acts as a low pass filter to remove transients before the signal is input to the beat detector. I have chosen to display the signal after the first filtering phase so that it retains more interesting features.

For example, dicrotic notches can be seen in the pictures above - "a secondary upstroke in the descending part of a pulse tracing corresponding to the transient increase in aortic pressure upon closure of the aortic valve. - Merriam Webster Dictionary"

I have noticed that if this dicrotic notch is particularly strong - younger individuals - it can overcome the second stage filtering and cause erroneous output from the beat detector which essentially looks for peaks and valleys in the wave. On going work!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].