HomeHabit Formation & Behavior Change AppsSmoking Cessation App Craving Intensity Tracker

🔁 Smoking Cessation App Craving Intensity Tracker

A tracker for monitoring the intensity of cravings during a smoking cessation app.

Habit Formation & Behavior Change Apps2DModerate60 FPS
smoking-cessation-craving-tracker ↗ Open standalone

Baseline Craving Profiling — Building the Personalized Zero-Line

Before a single cigarette is skipped, a smoking-cessation app spends 5–7 days building a behavioral baseline. Using Ecological Momentary Assessment (EMA) — the practice of sampling a person's state repeatedly, in their natural environment, in the moment rather than in retrospective recall — the app learns each smoker's unique trigger map: when they smoke, why, and how intense their urges feel before any withdrawal is in play.

  • 3–5%: Unaided quit success (at 6–12 months, no support)
  • 5–7: Baseline EMA prompts (days of pre-quit sampling)
  • 14–15: Avg. cigarettes / day (in daily smokers (US NHIS))
  • 10: QSU-brief items (Questionnaire of Smoking Urges)

Ecological Momentary Assessment — sampling life as it is lived

EMA methodology (Stone & Shiffman, 1994) was developed specifically to solve a problem that plagued addiction research for decades: retrospective self-report is unreliable. Asked "how many cigarettes did you smoke under stress last week," smokers systematically misremember frequency, intensity, and context. EMA instead prompts in the moment — via smartphone push notification — capturing state as close to real time as possible, minimizing recall bias.

A baseline EMA protocol for smoking cessation apps typically combines: • Random prompts: 4–6 times/day at pseudo-random intervals within waking hours, avoiding predictable habituation • Event-contingent prompts: triggered when the user logs a cigarette, capturing context (location, activity, mood, social setting) at the moment of smoking • End-of-day summary: a single retrospective item asking for a daily average, used to cross-validate momentary reports

Each prompt asks a short battery: current craving intensity (0–10 visual analog scale), mood valence, location type, and presence of common triggers (caffeine, alcohol, stress, another smoker nearby). Response burden is kept under 20 seconds per prompt — compliance drops sharply past that threshold.

The Questionnaire of Smoking Urges and craving as a measurable construct

Craving is not a single undifferentiated feeling — psychometric work by Tiffany & Drobes (1991) decomposed it into two correlated but distinct factors, captured in the 10-item QSU-brief:

• Factor 1 — intention and desire to smoke, anticipation of positive outcomes ("smoking now would make me feel great") • Factor 2 — negative reinforcement, urgency, and anticipated relief from withdrawal ("I need a cigarette right now")

Baseline QSU scores, combined with the Fagerström Test for Nicotine Dependence (FTND), give the app a starting severity estimate. A baseline craving of 2–3 out of 10 sampled throughout an ordinary smoking day is typical — the smoker is rarely acutely deprived because they simply smoke whenever urge rises, so the "resting" curve looks deceptively flat.

This baseline matters enormously for what comes next: the acute withdrawal spike on quit-day is measured as a delta against this individual's own resting craving level, not against a population average — personalizing every downstream risk threshold.

Trigger mapping and daily rhythm reconstruction

Event-contingent logging during the baseline week lets the app reconstruct a smoker's full 24-hour cigarette-timing rhythm: the post-waking cigarette (often within 30 minutes — a strong dependence marker on the FTND), post-meal cigarettes, coffee-paired cigarettes, and stress- or alcohol-triggered smoking in the evening.

This trigger map becomes the scaffolding for later stages: relapse-risk detection (Stage 4) reuses these exact time-of-day and context features, and just-in-time coping delivery (Stage 5) is scheduled preferentially around a user's known highest-risk windows — e.g., a user who reports 70% of cigarettes smoked with coffee will receive a coping nudge automatically staged around their typical coffee time on quit-day, before the craving spike even begins.

Quit-Day Onset & Acute Withdrawal — The First 72 Hours

Nicotine clears the bloodstream fast — a plasma half-life of roughly two hours — but the withdrawal syndrome it leaves behind is not a two-hour event. Craving intensity and physiological arousal build over the first three days post-quit, driven by nicotinic acetylcholine receptor up-regulation reverting to baseline and by the sudden loss of a highly reinforced behavioral ritual, not just a chemical.

  • ≈2 h: Nicotine plasma half-life (yet craving persists for days)
  • Day 1–3: Withdrawal symptom peak (post-quit, acute phase)
  • 2–4 wks: Symptom taper window (gradual decline to baseline)
  • 20–40%: HRV suppression (acute) (vs. pre-quit resting HRV)

Nicotine pharmacokinetics vs. the subjective withdrawal timeline

The mismatch between how fast nicotine leaves the body and how long withdrawal lasts is the central pharmacological fact a quit-app has to model. Nicotine plasma half-life is approximately 2 hours; by 24 hours post-quit, circulating nicotine is essentially undetectable. Yet chronic nicotine exposure up-regulates nicotinic acetylcholine receptors (nAChRs), particularly the α4β2 subtype, in the mesolimbic dopamine pathway. When nicotine stops binding these receptors, the up-regulated population under-functions relative to its new (drug-free) baseline — producing the characteristic withdrawal syndrome: irritability, anxiety, restlessness, difficulty concentrating, increased appetite, and intense craving.

This receptor-level recovery process takes days to weeks, not hours — explaining why craving intensity and mood disturbance peak around 24–72 hours post-quit and then gradually taper over roughly 2–4 weeks, even though the drug itself is long gone from the bloodstream.

Physiological signal tracking — HRV and GSR as objective withdrawal proxies

Self-report alone under-samples withdrawal — people forget to log, under-report social smoking urges, or habituate to prompts. Passive physiological sensing, increasingly available via consumer wearables, gives the app an objective, continuous cross-check:

• Heart-rate variability (HRV): the beat-to-beat variation in heart rate, primarily reflecting parasympathetic (vagal) tone. Nicotine withdrawal is associated with reduced HRV — a 20–40% drop in time-domain measures such as RMSSD is commonly observed in the first 72 hours, reflecting heightened sympathetic arousal and stress reactivity. • Galvanic skin response (GSR / electrodermal activity): sweat-gland activity driven purely by sympathetic nervous system output. GSR spikes correlate with self-reported craving intensity in controlled cue-reactivity studies, rising sharply during acute urge episodes and returning toward baseline as the urge subsides (typically over 3–5 minutes for an individual craving episode).

Fused together, a sudden HRV dip co-occurring with a GSR spike is a strong physiological signature of an unreported craving episode — even when the user never opens the app to log it.

Why the first three days matter disproportionately

Clinical withdrawal research consistently identifies days 1–3 post-quit as the acute crisis window: craving intensity, irritability, and anxiety all peak in this interval, and it is also when relapse probability is at its highest per unit time. This is precisely why quit-day onset triggers a step-change in app behavior — sensor sampling frequency increases, EMA prompt density rises, and any coping-strategy delivery system (Stage 5) is placed on high alert well before the user consciously recognizes they are struggling.

EMA Prompting & Real-Time Craving Capture — Building the Personal Curve

Once the quit attempt is underway, the app shifts from passive profiling to active, high-frequency measurement. Scheduled and randomized EMA prompts ask the simple question — "Rate your craving right now, 0 to 10" — dozens of times over the following weeks, and each answer becomes one more point on a continuously updated, individually-shaped craving curve.

  • 5–8: EMA prompts / day (random + event-contingent)
  • 70–90%: Published EMA compliance (response rate, mobile studies)
  • 0–10: Craving scale used (visual analog / Likert)
  • <2 min: Median response latency (push-notification to answer)

Prompt scheduling — random vs. event-contingent sampling

Two complementary scheduling strategies are used together:

• Signal-contingent (random) sampling: prompts fire at pseudo-random times within fixed daytime windows (e.g., one random prompt per 2–3 hour block). This avoids the sampling bias of only ever measuring craving when the user chooses to open the app, and it captures "quiet" low-craving periods that are just as informative as spikes. • Event-contingent sampling: triggered by a user action (logging an urge, logging a near-lapse, requesting help) or by a passive sensor trigger (a detected HRV/GSR anomaly consistent with a craving episode). This captures the highest-intensity moments that random sampling might simply miss between prompts.

Published mobile-health EMA studies in smoking cessation report compliance rates in the 70–90% range when prompt burden is kept low (under 10 prompts/day, each answerable in seconds) and when the app gives users visible feedback — such as a live-updating craving graph — in return for responding, closing the loop between effort and value.

From discrete samples to a continuous personalized craving curve

Individual EMA data points are sparse and noisy — a handful of samples per day cannot directly represent a continuous underlying process. The app fits a smoothed trajectory (commonly a local regression / spline, or a simple exponential-decay-plus-oscillation model) through the sampled points, incorporating:

• A slow-decaying acute component capturing the days-1-to-3 withdrawal peak and its multi-week taper • A fast circadian/ultradian oscillation capturing intra-day rhythm (many smokers report elevated urge in the morning, after meals, and in the evening) • Discrete spike events tied to logged or sensor-detected trigger exposure (stress, alcohol, social cues)

The resulting curve is genuinely personalized: two users quitting on the same day can show very different shapes — one dominated by a single sharp day-2 spike, another showing persistent moderate craving with several smaller peaks — and the shape itself becomes a predictive feature for the next stage.

Sensor fusion — combining self-report with passive signal streams

Self-reported craving and passive physiological signals (HRV, GSR) are only moderately correlated — each captures something the other misses. Self-report reflects conscious, appraised urge; physiological arousal reflects an often-earlier, sub-threshold stress response that may or may not culminate in an EMA-reportable craving.

Sensor fusion combines both streams into a single risk-weighted craving estimate, generally with a supervised model trained on the individual's own labeled EMA responses as ground truth (a simple, interpretable early model; deep sequence models such as LSTMs are used in later, more mature research systems). This fused signal is what feeds the risk-window detector in Stage 4 — because relying on self-report alone always leaves a detection gap during exactly the moments a distressed user is least likely to open the app and log anything.

Relapse-Risk Window Detection — Finding the Danger Zones Before They Strike

Relapse is not evenly distributed across a quit attempt — it clusters sharply around a small number of predictable windows. A risk-detection algorithm scans the fused craving/physiology signal for steep upward slope, elevated absolute intensity, and known high-risk calendar and contextual markers, flagging danger before the user lapses rather than after.

  • ~⅔: Relapses within first 8 days (of all quit-attempt relapses)
  • ~75%: Relapses within 6 months (of eventual lapses occur here)
  • Day 3, 8: Classic risk peaks (acute + secondary withdrawal wave)
  • 6–10 PM: Evening/social risk window (highest contextual-trigger density)

The epidemiology of relapse timing

Decades of quit-attempt cohort studies converge on a consistent pattern: relapse risk is front-loaded. The majority of lapses in an unaided or lightly-supported quit attempt occur within the first eight days, and a large majority of all eventual relapses — commonly cited around three-quarters — occur within the first six months, with risk declining steeply, though never reaching zero, thereafter.

Within that first week, two sub-peaks are frequently observed: an acute peak around day 2–3 (coinciding with the physiological withdrawal maximum described in Stage 2) and a secondary peak around day 8, often attributed to a combination of accumulated psychological fatigue, waning novelty of the "fresh start," and the withdrawal syndrome's incomplete but partial resolution creating a false sense of safety right when situational triggers (a stressful workday, a social event with drinking) reassert themselves.

Slope-based and contextual risk scoring

Rather than triggering only on absolute craving level (which varies hugely between individuals), a more sensitive detector tracks the trajectory: the rate of change of the fused craving/physiology signal over a short rolling window (e.g., the last 30–60 minutes). A craving level of 6/10 that has been flat for hours is a different risk profile than a craving level of 6/10 that has risen from 2/10 in the last twenty minutes — the second is the signature of an active, unfolding urge episode, and it is this slope that best predicts imminent lapse risk.

Contextual features layered on top of the slope signal include: • Time-of-day match to the user's own logged historical trigger windows (from Stage 1 baseline mapping) • Calendar proximity to day 3 or day 8 (or other user-specific historical relapse-prone days from prior quit attempts, if known) • Detected proximity to known trigger contexts: bars/restaurants (via location), weekend evenings, or a logged stressful event • Recent coping-strategy non-response (a coping nudge was sent but craving continued climbing) — indicating the current strategy is insufficient and risk should be escalated, not merely re-flagged

A simple weighted combination of these features (in early systems, logistic regression; in more advanced deployments, gradient-boosted trees or sequence models) outputs a continuous relapse-risk probability, thresholded into Low/Medium/High/Critical bands shown in this simulation.

Why front-loaded detection changes intervention design

Because risk is so heavily concentrated in the first eight to fourteen days, resource allocation for real-world quit-support programs is deliberately front-loaded to match: more frequent EMA prompts, denser physiological sampling, and a lower threshold for triggering a coping intervention during this window, tapering back to a lighter-touch maintenance mode once the user is past the day-8 secondary peak and the acute withdrawal curve has substantially flattened. Detecting a risk window a few minutes before it peaks — rather than logging it retrospectively after a lapse — is the entire practical justification for building this real-time pipeline instead of relying on end-of-week self-report surveys alone.

Just-in-Time Coping Strategy Delivery & Outcome Tracking

The entire sensing and risk-detection pipeline exists to answer one operational question at exactly the right moment: what should the app do right now? Just-in-Time Adaptive Interventions (JITAIs) deliver a brief, tailored coping strategy the instant craving or predicted risk crosses threshold, then measure whether it worked — closing a feedback loop that makes every future intervention better timed than the last.

  • 3–5%: Unaided 6–12mo quit rate (no app / no pharmacotherapy)
  • 15–20%+: App + pharmacotherapy (combined support, sustained quit)
  • ~2×: SmokefreeTXT (NCI) uplift (text-based JITAI vs. control)
  • 2–4 pts: Craving drop post-coping (typical 0–10 reduction, 10 min)

Just-in-Time Adaptive Interventions — the right support at the right moment

A JITAI is defined by delivering the right type/amount of support, at the right time, adapted to the individual's current state — as opposed to a fixed schedule of generic reminders. In the craving-tracking pipeline, the trigger condition is the risk score computed in Stage 4 crossing a personalized threshold (commonly craving ≥7/10 sustained, or a steep upward slope combined with a known high-risk context).

When triggered, the app selects from a menu of brief coping strategies matched to context and past effectiveness for that user: • Paced breathing exercise (60–90 seconds, guided animation) — targets the sympathetic arousal component directly, often producing a measurable HRV rebound within minutes • Urge-surfing / mindfulness micro-prompt — reframes craving as a wave that will crest and pass within roughly 3–5 minutes regardless of action taken, drawing on the well-established finding that individual craving episodes are time-limited • Distraction task (a short game, a "delay and distract" checklist) — competes for the same limited attentional resources that sustain urge-related rumination • Social support ping — a one-tap message to a designated support contact or peer quitline, useful specifically for contextually-triggered (social/environmental) craving episodes rather than purely physiological ones

Strategy selection itself is adaptive: strategies that produced the largest measured craving reduction for this specific user in past episodes are weighted more heavily in future selection — a simple contextual-bandit approach to personalization.

Outcome tracking — closing the loop

Every coping delivery is followed by a short outcome check: a follow-up EMA prompt roughly 10 minutes later asking for a fresh craving rating, paired with continued passive HRV/GSR monitoring to see whether physiological arousal recedes. The delta between pre- and post-intervention craving (typically a reduction of 2–4 points on the 0–10 scale for an effective match) is logged against the specific strategy, time of day, and risk context in which it was delivered.

This outcome log is the training signal for everything upstream: it refines which strategy gets selected for which context, it recalibrates the risk thresholds in Stage 4 (a threshold that triggers too many low-value interventions gets raised; one that misses real lapses gets lowered), and over the course of a multi-week quit attempt the entire pipeline becomes progressively better tuned to the individual rather than relying on population-average defaults.

Published efficacy — why this pipeline is worth building

The case for this entire architecture rests on a stark efficacy gap. Unaided quit attempts succeed at roughly 3–5% at 6–12 months — the overwhelming majority of unsupported quitters relapse. Combined support — structured app-based tracking and JITAI delivery paired with pharmacotherapy (nicotine replacement therapy, varenicline, or bupropion) — has been associated with sustained quit rates in the range of 15–20% or higher in trial populations, several-fold above the unaided baseline.

Text-message-based programs such as the National Cancer Institute's SmokefreeTXT deliver a simpler, lower-bandwidth version of the same just-in-time principle — scheduled and on-demand supportive messages timed around the quit date and known risk days — and have been associated with roughly double the quit rate of unsupported comparison groups in published evaluations. Consumer craving-tracking apps built around the fuller EMA + physiological-sensing + JITAI pipeline described across these five stages aim to extend that same principle with tighter, more personalized timing.

The single most consistent finding across quit-attempt research is that timing dominates content: a generic coping message delivered at a random moment helps far less than an unremarkable, even repetitive one delivered in the 60–90 seconds after craving crosses threshold. Because roughly two-thirds of relapses cluster in the first eight days and craving episodes themselves typically peak and subside within 3–5 minutes, a system's entire value proposition rests on closing the gap between "urge detected" and "support delivered" to as close to zero as the sensing pipeline allows.
⚙ Under the hood

A tracker for monitoring the intensity of cravings during a smoking cessation app.

CanvasBiomedicine

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)