Pace++ is a simulated pacemaker built to visually and functionally represent the various functions of modern pacemakers today. The following project is based of Boston Scientific's pacemaker specifications.
Through model-based code generation and a python gui, we created the following features:
- 7 unique pacemaker modes (AOO, VOO, AAI, VVI, AOOR, VOOR, AAIR, VVIR)
- Real-time electrocardiogram display
- Local encrypted data storages
Python | Matlab Simulink | Customtkinter | NXP FRDM K64F Board | J-Link
Display of Heartrate in Dark Mode
General Overview of the Simulink Stateflow
Overview of the Parameter Processing
Overview of the Pacemaker Modes
Central to modelling our pacemaker's functionality was the use of MATLAB Simulink, which allowed us to generate code iteratively and quickly flash our code into our board.
Through user-set parameters, our Simulink code allow for pacing of both the atrium and ventricle alongside rate adaptive pacing with a in-built accelerometer.
All important user-set data and electrocardiogram data was framed. The resulting packet was sent through a micro-usb to the device controller monitor.
Through python's tkinter, we created a secure interface that allows for the modification of the pacemaker. Our GUI allows for:
- Real-time display of the simulated heartbeat
- Patient data to be saved and modified
- Encryption of patient data
- Serial communication to the K64F board
To test and validate our pacemaker mode function, we employed Heartview, a McMaster created cardiac simulation tool that was pre-flashed onto our board.
- Python 3.18 or later
- MATLAB Simulink 2023 or later
pip install customtkinter matplotlib serial cyrptography
- Embedded Coder, Fixed-Point Designer, MATLAB Coder, Simulink Check, Simulink Coder, Simulink Coverage, Simulink Design Verifier, Simulink Desktop Real-Time, Simulink Test, and Stateflow
- Simulink Coder Support Package for NXP FRDM-K64F Board
- Kinetis SDK 1.2.0 mainline release
- V6.20a of the J-Link Software
In MATLAB, write the following in to the terminal:
open([codertarget.freedomk64f.internal.getSpPkgRootDir,
'/src/mw_sdk_interface.c']);
Upon opening the device change the following line:
{ GPIO_MAKE_PIN(GPIOA_IDX, 0), MW_NOT_USED},// PTA0, D8
into the following:
{ GPIO_MAKE_PIN(GPIOC_IDX, 12), MW_NOT_USED},// PTC12, D8
Christopher Nazarian Himanshu Singh Matthew Galuszka Shaan Suthar Varun Kothandaraman Shivan Guar