πŸ’ Cherry Canary

Predict don’t React

🌟 Inspiration & The Problem

16 million Americans have COPD. 26 million have asthma. 85% of COPD patients misuse their inhalers because they have no real feedback on when or why they need them. And 1 in 5 COPD patients is back in the hospital within 30 days of discharge β€” because nothing warned them it was coming.

Here's the statistic that drove every decision we made:

Brain cells begin dying in as few as 4–5 minutes of insufficient oxygen. By 3 minutes, the hippocampus and cerebral cortex β€” memory and cognition β€” start to die. By 10 minutes, permanent damage is virtually inevitable. (NIH MedlinePlus; Cleveland Clinic)

Every consumer device on the market today β€” Apple Watch, Fitbit, standard pulse oximeters β€” is reactive. They alert you only after blood oxygen has already dropped below a dangerous threshold. But SpOβ‚‚ is a lagging indicator. The body fights to maintain oxygen levels for minutes before it drops. That fight has a physiological fingerprint β€” visible in the relationship between heart rate and breathing rate β€” and no device has ever been built to read it.

We built Cherry Canary because that window β€” the gap between the body starting to compensate and the oxygen actually dropping β€” is where lives can be saved. Standard oximeters alarm at 90–92% SpOβ‚‚. The compensatory mechanisms we detect can begin 10–30 minutes before that point. That is the time a patient needs to use their inhaler, call for help, or simply wake up before damage becomes irreversible.

Cherry Canary is not another pulse oximeter. It is the canary in the coal mine β€” worn on your chest, listening before anyone else can hear.


🐦 What Cherry Canary Does

A wearable chest sensor (ESP32 + MAX30102 + MPU-6050) streams real-time heart rate and respiratory data to a web dashboard powered by Google Gemini. Instead of waiting for SpOβ‚‚ to fall, Cherry Canary watches for the compensatory patterns that precede the fall.

  • 🎯 Predictive Divergence Engine β€” continuously analyzes the relationship between heart rate and breathing rate against the user's personal baseline, detecting divergence patterns that signal the body is fighting to maintain oxygen levels it hasn't lost yet
  • πŸ“Š Personalized Baseline Calibration β€” users set their own resting heart rate and breathing rate on onboarding; COPD patients have naturally lower baselines than healthy adults, so population thresholds are meaningless for them
  • 🧠 Gemini Real-Time Alerts β€” instead of a generic "WARNING," Gemini reads the live sensor data through our Decision Matrix and tells users exactly what pattern is detected, what it likely means, and what to do right now
  • πŸ“ˆ Gemini Long-Term Analysis β€” over time, Gemini surfaces connections between lifestyle patterns and respiratory episodes, helping users and physicians understand why attacks happen
  • 🫁 3D Breathing Visualization β€” a live Three.js render of the user's breath depth and rhythm for mindfulness coaching and breathing training
  • πŸ“€ Clinical Data Export β€” full session history and Gemini analysis downloadable as a report for the user's pulmonologist
  • πŸ†˜ Dead Man's Switch β€” when both vitals drop simultaneously (possible hypoxic brain suppression vs. normal sleep), Cherry Canary sends a consciousness confirmation prompt; no response within 30 seconds automatically alerts the user's emergency contact

πŸ”¬ The Science: Our Decision Matrix

Cherry Canary maps four vital sign patterns to four distinct physiological states:

  • HR ↑ + BR ↑ β€” Active distress; body fighting openly β†’ WARNING / EMERGENCY
  • HR ↓ + BR ↑ β€” The Golden Window. Breathing faster activates the vagus nerve, slowing the heart. SpOβ‚‚ hasn't dropped yet β€” the body is still compensating. This is the exact moment we were built to catch. β†’ CAUTION / WARNING
  • HR ↑ + BR ↓ β€” Last Resort Compensation. Respiratory muscles are exhausted; breathing drops not because things are improving but because the muscles can't sustain the effort. The heart compensates alone β€” a pre-crash signal especially dangerous in COPD β†’ URGENT WARNING
  • HR ↓ + BR ↓ β€” Ambiguous: peaceful sleep OR hypoxic brain suppression. Cherry Canary resolves this with onset speed, prior session alert history, and time of day. Sudden onset after prior distress = Dead Man's Switch triggered β†’ INFO to EMERGENCY

βš™οΈ How We Built It

Hardware

Component Role
ESP32 Microcontroller with built-in WiFi; POSTs JSON to backend every 2 seconds
MAX30102 SpOβ‚‚ + heart rate via photoplethysmography
MPU-6050 6-axis IMU measuring chest wall displacement for breathing rate and depth

Both sensors share an I2C bus (GPIO 21/22). Raw IMU data is cleaned with a low-pass filter in Python to isolate the 0.2–0.5 Hz respiratory frequency band and eliminate motion artifacts.

Backend

Python + Flask receives sensor POSTs, maintains a rolling time-series buffer, runs the Predictive Divergence Engine against the stored baseline, and passes flagged patterns to Gemini for alert generation.

Frontend

Next.js + Tailwind CSS + Framer Motion + Three.js. Designed first in Figma, prototyped in Stitch, then built from scratch. Live dashboard polls every 2 seconds.


🎨 Accomplishments We're Proud Of

Coming into this hackathon, none of us had built a production-quality UI before. We are genuinely proud of what we created visually. We designed Cherry Canary's interface from the ground up in Figma β€” thinking carefully about hierarchy, color, and how to communicate urgency without panic β€” then brought it to life with animations and interactions you'd expect from a professional product studio. Smooth scroll sequences, staggered reveals, 3D breathing visualizations with Three.js, and fluid micro-interactions built with Framer Motion. For a team of first-time UI designers, seeing something that feels this polished and intentional come together in 36 hours meant a lot to us.

Beyond the UI:

  • The Predictive Divergence Engine β€” a fundamental departure from every consumer wearable on the market
  • Full end-to-end hardware pipeline β€” raw ESP32 sensor readings to Gemini-powered clinical alerts in a live dashboard, built in 36 hours

🚧 Challenges We Ran Into

IMU signal noise raw chest accelerometer data picks up posture shifts, footsteps, and even heartbeat artifact. Tuning the low-pass filter to isolate breathing cleanly without introducing lag took significant iteration.

Sensor timing synchronization between the MAX30102 and MPU-6050 both were different optimal sampling rates.

The both-down pattern forced us to abandon threshold logic entirely and build context-aware state reasoning, which was the most intellectually demanding part of the system.


πŸ”­ What's Next

  • Hardware miniaturization β€” custom PCB small enough to wear invisibly under clothing
  • Voice alerts β€” text-to-speech for nighttime use and accessibility
  • Automatic emergency calling β€” direct 911 integration when the dead man's switch fires and no response is received
  • Physician portal β€” remote trend review and threshold adjustment for pulmonologists
  • Clinical validation study β€” partnering with a pulmonology program to validate the Predictive Divergence Engine against hospital-grade monitoring

πŸ“– Research

Krishnan et al. (2015) β€” Understanding Why Patients With COPD Get Readmitted. PMC4420180. A nationally representative Medicare study documenting that 85% of COPD patients misuse their inhalers and that 20.2% are readmitted within 30 days of discharge. This paper crystallized the core gap Cherry Canary addresses: patients have no real-time feedback on their own respiratory state, so they use their medication reactively and incorrectly β€” and end up back in the hospital.

JMIR Formative Research (2026) β€” Performance of Wearable Pulse Oximetry During Controlled Hypoxia Induction. The most directly relevant validation of our core thesis: Apple Watch Series 7 and clinical-grade consumer oximeters consistently overestimate SpOβ‚‚ during hypoxemia, with accuracy declining sharply below 88%. This peer-reviewed study confirms that SpOβ‚‚-based reactive alarmism is not just philosophically limited β€” it is technically unreliable at the exact moment it matters most. Cherry Canary's upstream predictive approach isn't just better design; it's a necessary correction.


πŸ› οΈ Built With

ESP32 MAX30102 MPU-6050 Python Flask Next.js Node.js Tailwind CSS Framer Motion Three.js Google Gemini API Figma Stitch Low-Pass Signal Filtering I2C REST API

GoDaddy Domain Name: tweetyourvitals.health

Built With

Share this project:

Updates