Inspiration

370,000 out-of-hospital cardiac arrests happen in the US every year. Only 40% receive bystander CPR — not because people don't care, but because they've never practiced. The most common reason for inaction is fear of doing it wrong. Existing CPR training costs $200, takes four hours, uses a $50,000 mannequin, and happens once a year. The skill decays in under a month. We built PulseHero to break that barrier.

What it does

PulseHero is a closed-loop CPR training simulator. A force-sensing foam pad measures compression depth and rate at 200 Hz over USB serial. A web app drives a simulated patient with live vitals. Three Gemini agents handle physiology simulation, technique evaluation (scored against AHA targets: 2" depth, 100–120 BPM, full chest recoil), and scenario progression. ElevenLabs speaks corrective coaching within two seconds of a bad compression. At the end of every session, a full after-action report is written to a local JSON file for review.

The loop is: hand → pad → app → voice → hand.

The pad fits in a backpack, costs ~$97 in parts, and works on any flat surface — kitchen counter, break room, daycare classroom, college dorm. It teaches rate, force calibration, and emergency decision-making. It does not replace an in-person Red Cross class for hand placement or rescue breaths — it's the flight simulator that keeps your muscle memory alive between certifications.

How we built it

Hardware: A foam compression pad built around a force-sensing resistor (FSR) and an Arduino, reporting raw sensor values over USB serial at 200 Hz. A JC Toys 16" baby doll serves as a tactile demo prop on top of the pad.

Firmware: Arduino sketch reads the FSR, applies dual-threshold hysteresis (start compression at FSR > 400, end at FSR < 200) to suppress signal flap, and streams depth/rate over serial.

Web App: Next.js frontend with a single smoothed compression stream consumed by all agents. One vitals strip, one coaching line, one decision card visible at any moment — designed for a judge with three minutes, not a power user.

AI Agents (Gemini):

  • PatientAgent — updates a patient state JSON every 2 seconds based on compression quality
  • CoachAgent — evaluates each compression cycle and selects a correction phrase
  • ScenarioAgent — drives the scenario state machine through 10 labeled states

Voice (ElevenLabs): Pre-cached audio for the 5 most common coaching phrases keeps the demo within the free tier. A full streaming fallback fires for dynamic corrections.

Persistence: Session records written to local JSON at scenario end for after-action review.

Challenges we ran into

  • Sensor noise and flap: Raw FSR values flap at threshold boundaries. We solved this with dual-threshold hysteresis and a rolling smoothing window in firmware.
  • Sub-2-second coaching: Coordinating three live Gemini agents and a TTS stream fast enough to fire before the next compression cycle required careful agent bus design and audio pre-caching.
  • Cold start reliability: The demo environment (fresh browser tab, cold Gemini API, locked audio context) behaves differently than warm. We built an explicit pre-warm ritual: audio context unlock, serial port open, agent ping — all before the judge presses Start.
  • Cognitive load: Keeping one metric, one coaching line, and one decision card visible at all times while five data streams ran underneath was a real UI discipline challenge.

What we learned

That the hardware moat is real — a $97 pad that closes the feedback loop is a different product category than a $50,000 mannequin. And that sub-2-second voice coaching requires treating latency as a first-class invariant, not an afterthought.

What's next

Bilingual EN/ES coaching, persistence to cloud for longitudinal skill tracking, and partnerships with daycares and EMS recertification programs to get pads into the places where the skill decays fastest.

Built With

Share this project:

Updates