HuaweiAI – Your smartwatch, when you can’t react anymore.

Inspiration

Every year, over 140,000 people die from seizure-related events, often not because help is unavailable, but because help arrives too late.

If a person:

  • Collapses alone
  • Becomes unconscious
  • Is unable to speak
  • Is unable to call for help

traditional emergency systems fail.

We asked:

What if a smartwatch could react before anyone else?
What if it could detect danger and call for help automatically — even if the user can’t?

That idea became HuaweiAI
a personal emergency assistant that detects medical crises and acts on behalf of the user.


What it does

HuaweiAI turns a smartwatch into an autonomous safety assistant that reacts when the user can’t.

( note: we've explored multiple features/ use cases but due to time constraints we focused on the seizure use case for our pitch, but the overall architecture we've built includes other use cases too (f.ex. automated health report generation ) ) The system:

  • Continuously monitors accelerometer and gyroscope motion patterns to detect falls or seizure-like events in real time.
  • Continuously streams heart-rate data from the watch to the cloud in real time via MongoDB Atlas.
  • When a suspected incident occurs, the watch:

    • Starts a 10-second vibrating countdown
    • Gives the user a chance to cancel false alarms
  • If not canceled:

    • Records a 10-second audio clip
    • Sends the audio to ElevenLabs Speech-to-Text for transcription
    • Passes the transcript to a Llama-3.8-Instruct model on DigitalOcean Gradient for medical triage summarization
  • Once processed, HuaweiAI automatically:

    • Sends an emergency alert email, including:
    • Raw transcript
    • 5 most recent heart rate data
    • AI-generated triage summary
    • Event details (time, type, etc.)
  • All system data is stored in the cloud:

    • MongoDB Atlas for real-time heart-rate logs and unstructured event data
    • Postgres for structured audit history

Real-time Health Reports

image image

  • Fetches heart-rate data in real time from MongoDB Atlas.
  • Generates a professional medical PDF report using reportlab.pdfgen, including:
    • Latest readings
    • Heart-rate history
    • Threshold violations / anomalies
  • Automatically attaches and sends the PDF report via email to caregivers or emergency contacts.

Deployment

The backend is fully containerized and deployed as a Docker service running on Vultr, ensuring reliability and global availability.

In short:

A fall happens → AI analyzes the situation → Emergency contacts receive contextual data and medical reports in seconds.


How we built it

We built HuaweiAI with a modular architecture spanning frontend, backend, AI layer, and database, using HarmonyOS, ArkTS, Python Flask, and cloud services.

Frontend (HarmonyOS + ArkTS)

  • Implemented sensor listeners for accelerometer and gyroscope data.
  • Built fall-detection logic and seizure-heuristic detection.
  • Added AVRecorder to capture audio after an incident.
  • Added continuous heart-rate streaming to the cloud.
  • Integrated direct HTTPS communication to the backend Flask API.
  • Provided haptic feedback with a 10-second emergency countdown.

How fall detection works (in simple terms) Our fall detector continuously reads accelerometer data from the smartwatch and looks for a three-stage pattern:

Free fall – A sudden drop in total acceleration (like when a person is falling). Impact – A rapid spike in acceleration when the body hits the ground. Stillness – Very little movement immediately after impact, suggesting the person is not moving.

Only when these three steps happen in this order, and within a short time window, do we confirm a fall. This helps avoid false alarms from everyday motion, while still reacting quickly to real emergencies.

Backend (Python Flask, Docker, Vultr)

  • Deployed a containerized Flask server to handle emergency alerts and STT transcripts.
  • Integrated SMTP email sending with .env-based configuration.
  • Added Gradient AI integration using an OpenAI-compatible /chat/completions endpoint.
  • Implemented PDF report generation using reportlab.pdfgen.
  • Added APIs for:
    • Transcript handling
    • Email delivery
    • Heart-rate fetching
    • PDF generation
    • Database logging
    • System health checks

AI Layer (DigitalOcean Gradient)

  • Used Llama-3.8-Instruct to summarize emergency voice transcripts.
  • Built gradient_text_tool.py to format prompts and manage inference sessions.
  • Generated structured triage summaries, appended to reports.

Database

  • MongoDB Atlas
    • Real-time heart-rate streaming
    • Unstructured logs and event intelligence
  • Postgres
    • Structured audit trails
    • Device-level event metadata

Challenges we ran into

Building HuaweiAI meant solving problems across hardware, cloud, and AI:

  • HarmonyOS & ArkTS limitations – Microphone permissions and manual file access required low-level handling.
  • Sensor debugging on wearable hardware – Accelerometer & gyroscope event subscriptions were difficult to stabilize.
  • Docker dependency crashes – Missing modules in the build context caused initial container failures.
  • Real-time audio transfers – Required custom binary handling without external storage services.
  • AI inference limits – Needed to ensure Llama-3.8 summarization remained fast and reliable server-side.
  • SMTP & environment handling – Email sending sometimes failed due to missing environment variables.
  • PDF generation in automated pipelines – Integrating ReportLab with event workflows required careful I/O orchestration.

Accomplishments that we’re proud of

We are proud of building a fully integrated, real-world emergency detection and reporting system:

  • End-to-end pipeline
    • Physical fall → sensor detection → audio → STT → AI triage → emergency email.
  • New medical reporting capability
    • Real-time heart-rate logs → PDF report → automatic email delivery.
  • Reliable backend deployment
    • Fully containerized and running seamlessly on Vultr.
  • Efficient smartwatch implementation
    • Lightweight ArkTS code running in real time on HarmonyOS hardware.
  • AI-enhanced emergency context
    • Llama-3.8-Instruct generates fast and meaningful emergency summaries.
  • Clean architecture
    • Modular components for sensing, AI, notification, reporting, and storage.

What we learned

Building HuaweiAI taught us a lot at every level:

  • HarmonyOS & ArkTS – Working effectively with wearable sensors and system APIs.
  • Dockerized AI services – Handling binary uploads and performing inference reliably in production.
  • Emergency system design – Combining STT, AI reasoning, reporting, and communication into a tight pipeline.
  • Environment consistency matters – Production environment replication is critical for reliable deployment.
  • Sensor-based event classification – Techniques for reducing false positives in real-world conditions.
  • Medical reporting automation – Generating standardized health PDFs from live data streams.

What’s next for HuaweiAI

We have ambitious plans to expand HuaweiAI into a more powerful and predictive medical safety platform:

  • Continuous anomaly detection
    • Heart-rate thresholds, trend deviation, and multi-sensor fusion.
  • Precise emergency dispatch
    • Integrating GPS or low-energy beacon positioning.
  • Caregiver dashboard
    • Real-time telemetry, alert history, reports, and device status.
  • Multilingual support
    • Speech-to-text and AI summaries in multiple languages.
  • External hardware connectivity
    • Integrate Bluetooth fall-detection peripherals.
  • Cross-platform rollout
    • Android, iOS, and more HarmonyOS wearable models.
  • Predictive analytics
    • Early warning models leveraging motion + heart-rate + chronic history.

A watch that quietly protects you — even when you can’t protect yourself.

Built With

Share this project:

Updates