Sleep well,
Understand your sleep better.
Discover how your daily habits affect your rest.
Your Sleep Dashboard
Track how caffeine, melatonin, and heart rate affect your sleep cycles. Login to save your data.
Research & Statistics
Calculations based on scientific research, studies, and primarily statistics of average people.
Key Insight
Caffeine has a half-life of 4-6 hours (average ~5 hours). After 5 hours, about 50% of caffeine remains in your body. For optimal sleep, caffeine levels should drop below ~15-25mg – this typically means having your last coffee 10+ hours before bedtime.
Key Insight
Late eating elevates heart rate due to digestive processes. Your heart rate should be low when falling asleep. A gap of 3+ hours between your last meal and bedtime is optimal.
Key Insight
After intense exercise, your body needs a few hours to recover and calm down. Morning workouts allow complete recovery before sleep and maintain a healthy heart rate throughout the day. Exercising close to bedtime can compromise sleep quality.
Caffeine Pharmacokinetics
Based on Grzegorzewski et al. 2022 & Puri et al. 2020. One-compartment model with oral absorption.
// Absorption phase (t ≤ 45min):
C(t) = C₀ × (t / t_peak)
// Elimination phase (t > 45min):
C(t) = C₀ × e^(-(t - t_peak) × ln(2) / t½)
t_peak = 0.75h | t½ = 4.5h (male) / 5.0h (female)
Melatonin Circadian Rhythm
Based on Brown et al. 1997, Zeitzer et al. 2007 & Gunn et al. 2016. Gaussian approximation with fixed circadian peak.
// Gaussian circadian model:
M(t) = M_base + (M_peak - M_base) × e^(-Δt² / 2σ²)
// Caffeine suppression effect:
M_final = M(t) × (1 - min(0.6, caffeine × 0.005))
t_peak = 3:00 (female) / 3:30 (male) | σ = 3.0h
Heart Rate Model
Based on Speed et al. 2023, Khalid et al. 2025 & Chikwetu et al. 2024. Sinusoidal circadian baseline with meal/workout modulations.
// Circadian baseline:
HR_base(t) = HR_mean - A × cos(2π × Δt / 24)
// Final HR with modulations:
HR(t) = HR_base + ΔHR_meal + ΔHR_workout + ΔHR_caffeine
HR_mean = 63 (male) / 67 (female) | A = 7 BPM | ΔHR_caffeine = 3 × (C/100mg)
Optimal Bedtime Calculation
Based on Drake et al. 2013 (caffeine threshold) and DLMO research. Finds the earliest time after 8 PM where all conditions are met.
// All conditions must be true:
1. Caffeine < 25mg // Sleep-safe threshold
2. Melatonin ≥ 20% // DLMO onset
3. HR < HR_baseline + 5 // Near resting
// Result:
Optimal = min(t) where t ≥ 20:00 AND all conditions true



Misconceptions & Good to Know
Watch this: