Back

Benchtop VVI Cardiac Pacemaker

Laboratory project for Medical Instrumentation and Devices course.

Project Overview

  • Goal: build a benchtop VVI cardiac pacemaker circuit capable of sensing cardiac electrograms and pacing a live frog heart
  • Analog front-end (AFE) senses and conditions the frog electrogram and detects QRS complexes in real time
  • Arduino VVI algorithm tracks BPM and delivers a stimulus if no native beat is detected within the lower rate interval
  • Verified pacemaker on a live Rana pipiens heart

Final Product

Pacemaker in pacing mode (no input connected), target heart rate 60 bpm.

Design Features
  • Differential electrogram sensing via instrumentation amplifier on bipolar frog-ventricle electrodes.
  • Full analog condition chain (filtering + gain) to deliver clean electrogram waveform and detect QRS complexes.
  • Potentiometer for adjustable QRS detection threshold.
  • Arduino VVI algorithm: tracks R-R interval, inhibits pacing on native beats, delivers calibrated stimulus pulses.
  • SSD1306 OLED displays live HR, target HR, and pacing status; red LED illuminates on every pacing event.

System-Level Block Diagram

Pacemaker Block Diagram

Click on the expandable tiles below for detailed technical information on each component of the system.

Hardware Front-End

Click to expand

Transfer Functions

The AD623 instrumentation amplifier (unity gain, Rg open) senses the differential electrogram, followed by cascaded RC filter stages and a 1001× non-inverting amplifier:

$$H_{LPF}(j\omega) = \frac{1}{0.003j\omega + 1} \qquad (f_c = 53.1\,\text{Hz})$$
$$H_{HPF}(j\omega) = \frac{0.47j\omega}{0.47j\omega + 1} \qquad (f_c = 0.34\,\text{Hz})$$

With the 1001× non-inverting gain stage (Rf = 1 MΩ, R1 = 1 kΩ), the full AFE transfer function is:

$$H_{AFE}(j\omega) = \frac{470.47j\omega}{(0.003j\omega + 1)(0.47j\omega + 1)}$$

The MCP6002 comparator thresholds the amplified signal against VTHRESH: output goes HIGH (+5 V) during each QRS complex and LOW (0 V) otherwise, providing a clean digital event marker to the Arduino.

Bode magnitude plot: measured AFE response
Bode magnitude plot used for empirical validation of the AFE response. Passband 0.31–58.52 Hz, gain ~60 dB.

Oscilloscope capture showing the conditioned EGM waveform (yellow) and QRS-detection comparator output (blue).

VVI Algorithm

Click to expand

VVI algorithm block diagram
  • Lower Rate Interval (LRI) derived from the user-defined target heart rate
  • Pace: if time since last beat > LRI, output HIGH for 166 ms (= 2× chronaxie)
  • Inhibit: native beat detected within LRI — suppress pulse, reset timer
Arduino pacing pulse output with LRI and pulse width annotated
  • EGM and comparator sampled at \(f_s = 200\,\text{Hz}\) (5 ms resolution)
  • Time between consecutive rising edges of comparator define R-R interval
  • Instantaneous HR computed from each R-R interval in real time
Stimulation Circuitry

Click to expand

MOSFET stimulation circuit schematic: capacitive discharge via 2N7000
Capacitive discharge stimulus pulse waveform across tissue load
  • Topology: 2N7000 n-channel enhancement MOSFET in a low-side switch configuration. Capacitor charges to Vdd = 9 V during the interpulse interval via Rc = 82 kΩ.
  • Capacitive Discharge: When the Arduino drives the gate HIGH, the MOSFET conducts, discharging C through the series R = 3.5 kΩ and load RL (assumed 1 kΩ).
Strength-Duration Design

Stimulus parameters were derived from the Lapicque strength-duration model. The operating point was chosen at 2× chronaxie and 2× rheobase to ensure reliable myocardial capture with margin above threshold.

$$I_{stim,\,peak} = \frac{V_{dd}}{R_s + R_L} = \frac{9\,\text{V}}{3.5\,\text{k}\Omega + 1\,\text{k}\Omega} = 2\,\text{mA}$$

Two RC time constants govern circuit behaviour. The discharge time constant $\tau_d = (R_s + R_L)C = \mathbf{45\,\text{ms}}$ sets how quickly the capacitor empties through the tissue during a stimulus — the 166 ms pulse spans ${\approx}\,3.7\tau_d$, delivering nearly all stored charge. The recharge time constant $\tau_r = R_cC = \mathbf{820\,\text{ms}}$ determines how fully the capacitor recovers between pulses; a longer interpulse interval allows more complete recharge and a stronger subsequent stimulus.

Strength-duration curve for myocardial capture threshold
Strength-duration curve obtained during tissue characterization.
Measured rheobase: 0.5 mA  ·  Measured chronaxie: 83 ms
Bioelectrical Sensing
Real-Time Signal Processing
Embedded Arduino Firmware
I²C Peripheral Integration
Technical Communication
Analog Signal Debugging