DEV Community

Cover image for LumiPulse: a cartoon of my face that breathes with you, built on Presage SmartSpectra (my pick: it’s clear and it names the SDK)
Tafadzwa Alexander Razaro
Tafadzwa Alexander Razaro

Posted on Edited on

LumiPulse: a cartoon of my face that breathes with you, built on Presage SmartSpectra (my pick: it’s clear and it names the SDK)

Presage SmartSpectra SDK Challenge Submission

This is a submission for the Presage SmartSpectra SDK Challenge

What I Built

LumiPulse is an iPhone app where a cartoon buddy breathes with you, reads the room, and tries to make you laugh.

The buddy is Lumi, a wobbly poster-style blob drawn live in SwiftUI, every frame computed from your signals. Point your front camera at yourself and Lumi comes alive. It breathes in when you should breathe in, closes its eyes when you close yours, copies your mood, and cracks a joke when you look like you're carrying something heavy.

Under the cartoon, LumiPulse uses the Presage SmartSpectra SDK to read your pulse, breathing, HRV, blinking, talking and facial expression live from the camera. You don't need a wearable or a chest strap, just the phone you already own. That matters where I live in Gweru, Zimbabwe, where a smartwatch is a luxury but almost everyone has a phone.

There are four modes, each with its own loud poster colour:

Mode What it's for What Lumi does
🟢 Still A calm minute: breathe in for 4 seconds, out for 6 Breathes in exact step with you, eyes open or closed (your choice), and your phone taps a soft lub-dub at your own heart rate
🟡 Mirror "How do I look?" Copies your mood (happy, cheerful, thoughtful, sad, angry, stressed) and, if you look heavy, offers to breathe with you
🟠 Ready A one-minute self check-in before a ride or a drive Compares you with your own usual numbers, with no pass/fail and no verdicts
🩷 Stage Speaking practice Listens while you talk, then shows where your pulse rose, with the moments you were speaking shaded in

The style is a deliberate break from clinical health apps: lime, cobalt, pink and sun-yellow, thick ink outlines, hard shadows, tilted sticker labels and buttons that physically press down. Heavy days deserve something that doesn't look like a hospital chart.

Demo

The video shows, on a real iPhone:

  1. Onboarding. Lumi introduces itself and explains what the camera is for. Consent comes before anything starts.
  2. Still. The "Got you!" moment when the signal locks, then Lumi breathing in and out with the on-screen cue while the haptic heartbeat follows my real pulse.
  3. Mirror. I smile, frown and go quiet, and Lumi's mood (and its jokes) change with me.
  4. Stage. I answer a prompt out loud, then the pulse timeline shows where my nerves showed up.

Code

GitHub logo sirx2713 / LumiPulse

iOS app where Alexander, a hand-animated Rive face, breathes with you and mirrors your mood using live pulse, breathing and expressions from the Presage SmartSpectra SDK. SwiftUI · Rive · Core Haptics. Built in Zimbabwe 🇿🇼

LumiPulse

Your camera, reading the light in your skin. An iOS app by LumiTek Exchange (Gweru, Zimbabwe), built on the Presage SmartSpectra SDK. It reads live pulse, breathing, HRV, blinking, talking and facial expressions from the front camera.

Mode What it does Live signals used
Still A calm minute with Lumi, a poster-style orb that breathes in for 4 s and out for 6 s in perfect step with the on-screen cue, phase ring and haptic taps, and ripples on every real heartbeat, your phone beats softly in your hand at your own pulse, and you finish with a shareable card of how your breathing slowed. Breathing trace, breathing rate, pulse, HRV
Ready A one-minute self check-in before a ride or drive, compared with your own usual levels. No pass/fail, no verdicts, nothing shared. Pulse, breathing rate, HRV (RMSSD), blink rate
Stage Speaking practice. Answer a prompt out loud,
…

The README covers setup in five commands: clone the repo, copy Secrets.example.xcconfig, paste in your Presage API key, run xcodegen generate, and open the project in Xcode. The app needs a physical iPhone, because the SDK can't measure in the Simulator. The API key lives in a git-ignored .xcconfig and is read from Info.plist at runtime, so it never touches the repo.

Stack: SwiftUI (Canvas + TimelineView) · SmartSpectra Swift SDK 3.4.0 · Core Haptics · Swift Charts · XcodeGen · Rive iOS runtime 6.29.0 (for the upcoming hand-animated face)

How It Responds to Human Signals

LumiPulse uses SmartSpectra's continuous mode with:

sdk.config.requestedMetrics = [breathing + cardio metrics] + [.blinking, .talking, .expressions]
Enter fullscreen mode Exit fullscreen mode

All of it flows through one @Observable VitalsEngine that keeps only fresh samples (newer than the last timestamp it saw) and publishes them to SwiftUI. Here's how each signal changes the experience in real time:

💓 Pulse

  • When the SDK first returns a steady pulse, Lumi fires its "lock on" reaction and says "Got you!", with a success haptic.
  • From then on the phone plays a Core Haptics lub-dub at your own heart rate, so you can feel your heartbeat in your hand.
  • In Mirror and Ready, a pulse well above your personal usual (averaged from your past sessions) nudges Lumi's mood towards "stressed", unless you're smiling.
  • In Stage, pulse is plotted on a Swift Charts timeline against the moments you were speaking.

🌬️ Breathing

  • Still runs a single BreathPacer clock (in 4 s, out 6 s) that drives everything at once: the "Breathe in / Breathe out" text, the phase ring, the haptic taps, and Lumi's size. The face never drifts from the instructions.
  • The live breathing trace and rate are recorded so your results card can show how your breathing slowed over the minute.

🙂 Expressions, 👄 talking and 👁️ blinking

  • A MoodReader maps the SDK's expression, plus talking and pulse, onto Lumi's moods:
    • happy for a few seconds, or chatting → cheerful
    • neutral and quiet → thoughtful
    • sad → sad
    • angry, disgust or contempt → angry
    • fear, or a racing pulse → stressed
  • Moods only switch after a 2-second hold, so Lumi doesn't flicker.
  • Each change triggers a matching line ("Long day? I've got a minute for you.") and, when the mood is heavy, a Breathe with Lumi button.
  • Talking makes sound waves pulse beside Lumi in Stage, so you can see it listening.
  • Blink rate feeds the Ready check-in.

Drawing Lumi from the signals. Lumi is a SwiftUI Canvas inside a TimelineView, redrawn every frame:

  • Size and a gentle stretch come straight from BreathPacer.level, so Lumi's in-breath and out-breath can never drift from the on-screen cue.
  • Eyes open blink naturally; eyes closed stay closed as calm "︶" curves for the whole session.
  • Each mood changes the body colour, brows, slanted eyelids, mouth, cheeks, even a sweat drop when "stressed".
  • While Lumi talks, its mouth moves through the 9 Rhubarb lip-sync shapes (X, A–H), and sound waves pulse when it's listening to you in Stage.
  • Reactions play once and settle: a hop and sparkles on "Got you!", a spin on finishing, sunglasses or a snooze when you leave it idle.
  • Tap Lumi and it squishes. Tap three times and it complains: "Ow! I'm a face, not a button."

A hand-animated Rive version of the face (driven by Rive data binding) is already wired in behind a flag for a future update.

Prize Categories

Most Creative or Delightful Use

What inspired it: most stress and wellness apps look like a medical chart: grey cards, red warnings, numbers that make you feel worse. I wanted the opposite, a reason to smile on a bad day. Making the guide a character turns a breathing exercise into something closer to a friend pulling silly faces at you until you crack.

What makes it original:

  • The signal is the animation. Lumi isn't decoration next to a chart. Your breathing, pulse and expression drive its body, eyes, mouth and mood directly.
  • Your heartbeat in your hand. Haptics at your own measured heart rate make an invisible signal physical.
  • Humour as the interface. Every state has a line written to lighten the moment, from onboarding ("Tap me. Go on, I dare you.") to finishing a calm minute.
  • No comparison with anyone else. Ready and Mirror only compare you with your own usual, never with a "normal" range, so there's nothing to fail.

Consent and Data Handling

  • Consent first.
    • On first launch, Lumi explains in plain words what the camera does before any session can start; nothing runs until you accept.
    • iOS then asks for camera permission the first time you start a session.
  • No covert capture.
    • The camera runs only while a session is on screen.
    • A visible "camera on" indicator shows in the live preview.
    • The camera stops the moment you leave that screen. There's no background capture.
  • Video never leaves the phone. Frames are processed by the SmartSpectra SDK. LumiPulse never records, saves, uploads or shares video or photos.
  • What's stored.
    • Only short session summaries: mode, date, duration, average/start/end pulse and breathing rate, HRV (RMSSD), blinks per minute, share of time speaking, the most common expression, and the practice prompt.
    • They're kept in one JSON file on the phone with iOS Data Protection (.completeFileProtection). No raw waveforms are stored.
  • No sharing.
    • There's no account, no backend, no analytics and no AI service. Nothing goes to me, an employer or anyone else.
    • The share card is drawn on the phone and only leaves it if you tap Share.
  • Retention and deletion. Summaries stay until you delete them. You can swipe to delete a single session in History, use Settings › Delete all sessions, or delete the app.
  • Network. The SDK connects to Presage's servers to authenticate the API key and track usage credits at session start. Measured values aren't part of that.
  • SDK telemetry.
    • Off by default (enableTelemetry = false). You can opt in from the consent screen or Settings.
    • If you do, the SDK sends an anonymous per-session diagnostic summary (SDK version, device model, frame-rate and error counts). It never includes video, measured values or identifiers.
  • Not medical.
    • LumiPulse is a wellness and self-awareness toy.
    • It makes no diagnosis or treatment claims, and Ready gives no pass/fail or fitness-to-drive verdict.
    • Lumi's moods are a playful guess from your expression, and the app says so.

Agent Session

I built LumiPulse in a long session with Claude, from the first SDK wiring and XcodeGen setup, through the Kinetic poster redesign and a Rive face experiment, to Lumi, the native SwiftUI character.


Built by Tafadzwa Alexander Razaro · LumiTek Exchange, Gweru, Zimbabwe 🇿🇼

Top comments (0)