Cardiovascular Pacemaker Simulation
This interactive simulation demonstrates the basic principles of cardiac electrophysiology and how a
dual-chamber artificial pacemaker interventions in conditions of bradycardia and AV block.
Overview
The human heart relies on an internal electrical system to coordinate its contractions. The natural
pacemaker, the Sinoatrial (SA) node, generates an electrical impulse that travels through
the Atria, causing them to contract and pump blood into the Ventricles. The signal then pauses at the
Atrioventricular (AV) node before rapidly traveling down the Purkinje fibers, causing the
Ventricles to contract and pump blood to the body.
When this system fails—either by generating signals too slowly (Bradycardia) or failing to transmit signals
from the top to the bottom of the heart (Heart Block)—an artificial pacemaker can be surgically implanted.
It monitors the heart's natural rhythm and delivers precise electrical impulses to maintain a healthy heart
rate.
How to Use the Simulation
Use the controls panel at the bottom of the canvas to adjust the simulation parameters:
- Rhythm:
- Normal: The SA node fires at ~75 BPM. The signal conducts normally to the
ventricles.
- Bradycardia: The SA node is diseased and fires abnormally slow (~37 BPM).
- Heart Block: The SA node fires normally, but the AV node fails to conduct the
signal. The ventricles rely on a very slow "escape rhythm" (~30 BPM) to survive.
- Pacemaker (ON/OFF): Activates a simulated Dual-Chamber (DDD) pacemaker. Watch
for the Blue Sparks indicating the device is delivering an electrical
pacing pulse to the Atrium (RA) or Ventricle (RV).
- Sonification: Turn on audio to hear the mechanics. A low "Lub-Dub" represents natural
muscular contractions. A high-pitched "beep" represents an electrical pacing impulse from the pacemaker
device.
Technical & Physiological Details
The Simulated Logic Engine
The JavaScript engine runs a continuous time loop evaluating the physiological state of the heart millisecond
by millisecond. It uses a simplified state-machine to represent Native and Paced events.
- Native Timers: The engine tracks time since the last Atrial (A) and Ventricular (V)
events. In normal rhythm, native SA interval is 800ms. The AV delay is 150ms.
- Pacemaker Logic (DDD Mode): The simulated pacemaker is programmed with a Base Rate of
60 BPM (1000ms interval) and an AV Delay of 200ms.
- Sensing & Pacing:
If the native SA node fails to fire within 1000ms, the pacemaker paces the Atrium.
Once an Atrial event occurs (native or paced), the device waits 200ms. If the native Ventricle does
not fire within that window (as seen in Heart Block), the device paces the Ventricle.
Visual Representation
The canvas draws a stylized heart. The yellow glowing dots represent the action potential traveling along the
conduction pathways. When a chamber contracts, it visually scales down. The pacemaker leads (cyan wires)
flash brightly when delivering a pacing spike.
Future Directions
This single-page application serves as a foundational educational tool. Future iterations for medical
education could include:
- Dynamic Programming: Allowing the user to adjust the Pacemaker's Base Rate, AV Delay,
and mode (e.g., VVI vs. DDD) to see the physiological consequences.
- ECG Correlation: Adding a real-time running Electrocardiogram (ECG) trace at the bottom
of the canvas to show P-waves, QRS complexes, and pacemaker spikes corresponding to the mechanical
animation.
- Arrhythmia Induction: Simulating conditions like Atrial Fibrillation and demonstrating
how modern pacemakers switch modes to prevent tracking rapid atrial rates.