SA-node rhythm vs artificial pacing · VVI / AAI / DDD · demand & asynchronous modes
An artificial pacemaker delivers a small electrical stimulus that captures heart tissue and forces a beat whenever the heart's own pacemaker (the sino-atrial node) is too slow or conduction has failed. Each chamber tracked by the device has an escape interval — the longest the pacemaker will wait for an intrinsic beat before pacing. The escape interval is simply 60000 / pacing rate milliseconds.
Demand pacing (sensing ON): the device watches for the heart's own activity. If an intrinsic beat is sensed before the escape interval elapses, the pacemaker is inhibited and resets its timer. Asynchronous pacing (sensing OFF) ignores the heart and paces at a fixed rate regardless — useful conceptually but risky because a paced spike can land on a vulnerable part of the cardiac cycle.
Modes: VVI paces and senses the ventricle; AAI paces and senses the atrium; DDD is dual-chamber — it senses the atrium, waits an AV delay, then paces the ventricle if intrinsic AV conduction fails, preserving the natural atrial-then-ventricular sequence. Try the Complete heart block preset: the atria beat on their own but no impulse reaches the ventricles, so the pacemaker rescues every ventricular beat.
This simulation models an artificial cardiac pacemaker racing the heart's own SA-node rhythm. A discrete event loop tracks atrial and ventricular beats, an escape interval (60000 ÷ pacing rate) for each paced chamber, and an AV delay for dual-chamber pacing, then renders both an animated heart and a live scrolling ECG built from synthetic P-QRS-T waveforms with yellow pacing spikes marking every device-delivered beat.
An animated heart with atria and ventricles that flash on every beat, plus a scrolling ECG trace assembled from Gaussian P, Q, R, S and T wave components. Paced beats are marked with yellow spikes; the Readout panel tallies effective heart rate, the percentage of beats paced versus sensed, and the current mode's behaviour (fixed-rate vs demand).
Choose VVI (ventricle), AAI (atrium) or DDD (dual-chamber with AV delay) pacing modes, toggle Demand sensing on or off to compare inhibited versus asynchronous pacing, and drag the Intrinsic SA rate, Pacing rate and AV delay sliders. Try the Complete heart block preset to see the pacemaker rescue every ventricular beat, or Bradycardia to watch demand pacing step in only when the SA node runs too slow.
The escape interval is exactly 60000 divided by the programmed pacing rate in milliseconds — a pacemaker set to 60 bpm waits exactly one second for an intrinsic beat before firing. In demand mode, sensing an intrinsic beat resets that timer and inhibits pacing, which is why real devices avoid delivering a spike on top of a native beat.
The escape interval is the longest time the pacemaker will wait for an intrinsic beat in a given chamber before it delivers its own paced beat. It is computed as 60000 divided by the programmed pacing rate in milliseconds, so a pacing rate of 70 bpm gives an escape interval of about 857 ms. Every time the pacemaker paces or senses a beat, this timer restarts.
Demand pacing (sensing on) watches for the heart's own electrical activity; if an intrinsic beat is sensed before the escape interval elapses, the pacemaker is inhibited and simply resets its timer instead of firing. Asynchronous pacing (sensing off) ignores intrinsic activity entirely and paces at a fixed rate regardless of what the heart is doing, which is riskier because a spike can land on a vulnerable part of the native cardiac cycle.
VVI paces and senses only the ventricle, firing a ventricular beat whenever no intrinsic ventricular activity is sensed within the escape interval. AAI does the same for the atrium. DDD is dual-chamber: it senses the atrium, then waits a programmable AV delay, and paces the ventricle only if no conducted beat arrives in that window, preserving the natural atrium-then-ventricle sequence.
This preset sets an intrinsic SA rate with DDD mode and switches on a block flag that prevents atrial impulses from conducting to the ventricles. The atria keep beating on their own rhythm, but since no beat ever reaches the ventricles, the AV-delay timer always expires unopposed and the pacemaker paces every single ventricular beat, which is exactly how a real dual-chamber device rescues complete heart block.
The scrolling ECG is synthesised by summing Gaussian bumps for each logged event: a small P wave for atrial activity and a Q-R-S-T sequence for ventricular activity, each offset in time and amplitude to look like a real trace. A yellow vertical spike is drawn just before any beat flagged as paced, showing exactly when the device fired versus when a beat was the heart's own intrinsic activity.