Inspiration

Every year, heartbreaking incidents occur when children are accidentally left in hot cars. We wanted to design a proactive, intelligent system that prevents such tragedies before they happen — giving parents peace of mind through real-time awareness and automated emergency response.

What it does

SafeTrack is an AI-powered child safety monitoring system that detects and responds to potential hot car dangers in real time. Using Bluetooth Low Energy (BLE) sensors, GPS tracking, and temperature monitoring, SafeTrack analyzes data to assess risk levels. If danger is detected, it initiates a multi-tier alert sequence — from local notifications and caregiver alerts to emergency service escalation. The system can even automatically post to X (Twitter) to notify local authorities or nearby helpers in extreme cases.

How we built it

We designed the system with a blend of hardware and cloud intelligence in mind: BLE sensors embedded in the car seat monitor buckle status, motion PIR based BLE sensors, and outside weather temperature. Google Cloud AI & Cloud Run host the multi-agent risk evaluation model, classifying safety states from SAFE → WATCH → ALERT → CRITICAL. GPS can enable real-time location tracking and offline resilience. Social media posting will enable automatic posting for verified emergency alerts. Dashboard UI built with React and Material UI for caregivers to monitor in real time.

🤖 How It Works:

  • ✅ Detects when a child is present in a vehicle
  • 🌡️ Monitors temperature conditions
  • 🚨 Sends escalating alerts to caregivers
  • 📱 Posts public safety alerts if unacknowledged

The Agent Chain

The system is built on a serverless agent framework where each agent has a specific role:

Sensor Data → SensingAgent → RiskPolicyAgent → CommsAgent → EscalationAgent → ComplianceAgent → Frontend

1. SensingAgent (Deterministic)

Role: Data normalization and feature extraction

Inputs:

  • Raw sensor telemetry:
    • buckle_state: "BUCKLED" or "UNBUCKLED"
    • motion_state: "STILL" or "MOVING"
    • outside_temp_f: Temperature in Fahrenheit
    • t_unacknowledged: Time since last acknowledgment

Outputs:

  • Normalized features:
    • present: Boolean (child detected)
    • childIsMoving: Boolean (motion detected)
    • T_out: Temperature value
    • t_still: Time child has been stationary

Example:

{
  "present": true,
  "childIsMoving": false,
  "T_out": 87,
  "t_still": 25,
  "t_unacknowledged": 15
}

2. RiskPolicyAgent (Deterministic)

Role: The "brain" of the operation - evaluates safety risk

Logic:

if not present:
    state = "SAFE"
elif T_out < 85:
    state = "SAFE"
elif acked:
    state = "WATCH"
else:
    state = "ALERT"

Outputs:

  • state: "SAFE", "WATCH", or "ALERT"
  • reason: Human-readable explanation
    • Example: "Child is MOVING in a stationary hot car. T_out=87°F."

3. CommsAgent (AI Agent) 🤖

Role: Generate human-friendly notifications using Gemini AI

Technology: Google AI Studio (Gemini API)

Process:

  1. Receives the ALERT state and reason from RiskPolicyAgent
  2. Calls Gemini with a structured prompt
  3. Generates three JSON fields:

Output Format:

{
  "title": "⚠️ Check Vehicle Now",
  "body": "Child may be unattended. Temperature: 87°F.",
  "socialPost": "🚨 PUBLIC SAFETY ALERT 🚨 Child locked in hot car at (29.7604, -95.3698). Temp: 87°F. Last seen at https://maps.google.com/..."
}

Key Features:

  • ✅ Context-aware messaging
  • ✅ Urgent but calm tone
  • ✅ Anonymous public safety posts (no PII)
  • ✅ GPS-enabled for emergency responders

4. EscalationAgent (Deterministic)

Role: Implements tiered escalation protocol

Escalation Tiers:

Tier Channel Target Timeout Trigger
1 Push Notification Primary Caregiver 120s Immediate
2 SMS Secondary Caregiver 120s If Tier 1 fails
3 Social Media @SafeTrackAlerts 0s 30s unacknowledged

Tier 3 Logic:

if (t_unacknowledged >= 30) {
  plan.steps.push({
    tier: 3,
    channel: "social_media_mock",
    target: "@SafeTrackAlerts",
    content: { post: socialPost }
  });
}

Why Social Media? When traditional methods fail, a public alert can mobilize nearby individuals or authorities to check on the vehicle.


5. ComplianceAgent (Deterministic)

Role: Final checkpoint for privacy and compliance

Responsibilities:

  • ✅ Ensures no PII leaks in logs
  • ✅ Validates GDPR/CCPA compliance
  • ✅ Sanitizes GPS data for public posts
  • ✅ Approves final escalation plan

Output:

{
  "approved": true,
  "plan": { /* sanitized plan */ },
  "context": { /* anonymized context */ }
}

🎮 Demo Simulation Flow

The live demo (useMockTelemetry.ts) runs a specific simulation to showcase all features:

Timeline:

00:00 | State: SAFE
      | Temp: 80°F
      | Child: BUCKLED, STILL
      | Status: "All systems normal"
      └─> t_still timer counts up (0s → 5s → 10s...)

00:25 | State: ALERT 🚨
      | Temp: 85°F (threshold crossed)
      | Child: MOVING (simulation triggers motion)
      | Action: First alert sent
      └─> t_unacknowledged starts (0s → 5s → 10s...)

00:30 | State: ALERT
      | Alert #2 sent
      └─> t_unacknowledged: 5s

00:35 | State: ALERT
      | Alert #3 sent
      └─> t_unacknowledged: 10s

... (alerts continue every 5 seconds)

00:55 | State: ALERT
      | Alert #6 sent
      └─> t_unacknowledged: 30s

01:00 | State: ALERT → TIER 3 TRIGGERED 🚨
      | Social media post created
      | Twitter icon appears in timeline
      | Auto-acknowledged
      └─> Simulation stops

🎨 Key Features

Real-Time Monitoring

  • ⏱️ Updates every 5 seconds
  • 🌡️ Temperature simulation (80°F → 95°F)
  • 🏃 Motion detection (STILL → MOVING)

Intelligent Alerts

  • 🤖 AI-generated messages (Gemini)
  • 📱 Context-aware notifications
  • 🔄 Continuous alerting until acknowledged

Escalation Protocol

  • 📲 Tier 1: Push notifications
  • 💬 Tier 2: SMS backup
  • 🐦 Tier 3: Public social media alert

User Interface

  • 📊 Live sensor dashboard
  • 🗺️ GPS map visualization
  • 📋 Alert timeline
  • ✅ One-click acknowledgment

🏗️ Architecture

Technology Stack

Frontend:

  • React + TypeScript
  • Vite build system
  • TailwindCSS for styling
  • Shadcn/ui components

Backend:

  • Node.js + Express
  • Google Cloud Run (serverless)
  • Google AI Studio (Gemini API)

Infrastructure:

  • Cloud Run for hosting
  • Docker containerization
  • Environment-based configuration

How To Test

Try It Live: Visit: https://safetrackv2-665484552551.us-central1.run.app/ -- click Access Dashboard and enter username and password

Watch the simulation:

Timer starts at 0s Temperature rises from 80°F → 95°F At 85°F, alerts begin New alert every 5 seconds Observe escalation:

Alerts appear in timeline After 30 seconds, Social media post displayed Auto-acknowledgment Test acknowledgment:

Click "Acknowledge" button Alerts stop State changes to WATCH System continues monitoring

Challenges we ran into

Thought challenges for the actual implementation - Finding PIR BLE sensors for accurate motion detection. Balancing real-time AI inference with low-power operation. Ensuring alert delivery in poor network conditions or parent being too far from the BLE sensor (attached a matrix of alternatives to BLE sensors for real world use cases). How to integrate privacy compliance with multi-device data access and social media post while navigation the ultimate goal of saving children's lives. How to navigate API rate limits and verification for X emergency posting.

Accomplishments that we're proud of

A fully functional online prototype capable of detecting and escalating emergencies automatically, Cloud-AI risk evaluation achieving sub-second response times, agent and app deployments to Cloud Run infrastructure and successfully integrating social emergency outreach via X API in critical cases.

What we learned

The power of combining edge IoT sensors with cloud AI for life-saving use cases. How to design multi-tier fail-safe systems that function even under connectivity loss. The importance of ethical and privacy-first design when handling sensitive family data.

What's next for SafeTrack

Expanding to smartwatch and voice assistant integrations. Partnering with automotive and child safety seat manufacturers. Enhancing the AI model with weather prediction and behavior learning. Building a public safety network for verified X alerts and local community response.

Built With

Share this project:

Updates