- Python
- Python virtual environment (refer to the Emotibit Plugins repo for specific instructions on how to setup)
- CMake
- EmotiBit ArduinoFilters
- The EmotiBit ArduinoFilter directory should be on the same level as this repository.
- Option 1: Library Manager
- Open Arduino IDE,
- open the Library Manager
- Download EmotiBit_ArduinoFilters
v1.0.1(if not already installed)
- Option 2:
git clone(example showing cloning in Arduino Libraries directory, but user can clone in any other location, as long as ArduinoFilters is also cloned at the same directory level)cdinto Arduino libraries folder- Windows:
C:\Users\{username}\Documents\Arduino\libraries - Mac:
/Users/{username}/Documents/Arduino/libraries - Linux:
/home/{username}/Arduino/libraries
- Windows:
- Run
git clone https://github.com/EmotiBit/EmotiBit_ArduinoFilters
- Open a terminal window
cdinto thepybinddirectory- Before being able to run cmake, you will need to update the path to
pybind11(if required) in the CMakeLists.txt file.pybind11is installed in the python virtual environment, as the link in the previous section explains.- We tested this with virtual environment created using python 3.12, and therefore the path to pybind in the current CMakeLists.txt file is
py-env/lib/python3.12/site-packages/pybind11/share/cmake/pybind11/.
- We tested this with virtual environment created using python 3.12, and therefore the path to pybind in the current CMakeLists.txt file is
- Run
cmake -B buildto generate the build files (the build files will be under a directory namedbuild) - Run
cmake --build build --config Releaseto generate the.pydfile- On Windows using MSVC, the
.pydfile will be underpybind/build/Release - Otherwise, the
.pydfile will be underpybind/build
- On Windows using MSVC, the
- Activate the Python virtual environment (instructions found in Emotibit Plugins repo)
- Open
run.pyand uncomment lines 6-7 (if on linux/macOS), or uncomment lines 10-11 (if on Windows) run.pyruns on emotibit data. We have checked in test data in thie repositoty. By default, the script looks for adatadirectory on the same level. Therefore, to test the script, you can extract thetests/sit-stand-sit_v0.0.0/ip900ap/sit-stand-sit_v0.0.0_ip900ap.zipfile and place the EMotiBit.csv file in thedatafolder. You can then use the EmotiBit data parser to parse the files, since the script looks for files ending in_PRand_PI.
- Unzip the
.zipfile intests/simulated-unobstructed-airway_v0.0.0/ip900ap - Run the EmotiBit Data Parser on
tests/simulated-unobstructed-airway_v0.0.0/ip900ap/EmotiBit.csv - Verify that
EmotiBit_PI.csv,EmotiBit_PR.csv, andEmotiBit_UN.csvexist undertests/simulated-unobstructed-airway_v0.0.0/ip900ap - Switch to the terminal window in the
pybinddirectory - Run
python run.py ../tests/simulated-unobstructed-airway_v0.0.0/ip900apmatplotlibwill need to be installed for the script to run successfully
- A plot of the raw PPG data overlayed with the calculated SpO2 should appear
Note: The timestamp used by
run.pyis theEmotiBitTimestampcolumn in the Emotibit.csvfiles