Sentinel Edge Smart Home
Systems Engineer24 weeksIn ProgressTeam of 2

Sentinel Edge Smart Home

Edge-first smart home. Voice, gesture, and gas alerts — no cloud required.

PPythonMMQTTRaspberry PiRaspberry PiNNodeMCUEESP8266VVoskMMediaPipeNNode-REDTypeScriptTypeScript
View LiveSource Code
Download PDF

Project Intelligence

Duration

24 weeks

Technologies

9

Status

In Progress

Key Challenge

Normalizing heterogeneous AI outputs to canonical MQTT tokens with hold-frame debouncing and FSM-safe routing

Skills Demonstrated

IoTMQTTEdge AIEmbedded SystemsPython

TL;DR

Building an edge-first smart home where voice and gesture inputs normalize to MQTT tokens, route through a Guardian FSM dispatcher, and drive NodeMCU actuators (door, fan, gas sensor) with alert escalation and E2E test coverage.

Problem

Cloud-dependent smart home systems fail offline and add latency to safety-critical actuator commands

Solution

Edge-first pipeline with offline Vosk/MediaPipe and local MQTT dispatcher FSM

Result

Sub-second voice-to-actuator routing with automatic gas alert escalation

<1s

Voice-to-MQTT latency

6

Guardian FSM modes

Key Outcomes

<1s

Voice-to-actuator latency

30–50ms

Gesture inference per frame

20–30 FPS

Camera throughput on Pi 4

30s

Alert→Emergency countdown

6

FSM modes

13

MQTT topic categories

Curated Visuals

Operator dashboard with device states
1 / 15

Operator dashboard with device states

Results & Impact

Working edge smart home pipeline with voice, gesture, gas sensor, and actuator control.

Demonstrated offline-capable home automation without cloud dependency.

<1s

Command latency

3

Input modalities

Architecture

Architecture diagram

Edge-first architecture with Raspberry Pi running voice/gesture publishers and the dispatcher ActionRouter.

All inputs normalize to canonical tokens before hitting MQTT. The Guardian FSM manages mode transitions with Alert→Emergency escalation after 30s countdown.

NodeMCU firmware modules subscribe to actuator topics and publish state feedback.

Infrastructure & Deployment

Raspberry Pi 4 on local network with Mosquitto MQTT broker. NodeMCU devices on WiFi. Flask dashboard on Pi. Node-RED for demo automation flows.

Features

Core

Offline Voice Control

Vosk STT with expanded command vocabulary normalized to tokens.

Core

Gesture Recognition

MediaPipe Hands with hold-frame debouncing and cooldown.

Core

Guardian FSM

Six modes with Alert→Emergency escalation and cancel support.

Core

NodeMCU Actuators

Modular firmware for door relay, fan relay, and gas sensor.

Secondary

Operator Dashboard

Flask web UI for live device states and manual overrides.

Secondary

Telegram Bot

Remote control and notifications via Telegram.

Planned

PIR Motion Sensor

Motion detection integrated into FSM triggers.

Planned

Temperature Telemetry

DHT11/22 readings published to MQTT.

Challenges & Solutions

1

Voice-to-token normalization

The Problem

Natural speech has infinite phrasings for the same intent (turn on the fan vs fan on please).

How I Solved It

Expanded canonical vocabulary with fuzzy matching and phrase normalization before MQTT publish.

def normalize_command(text: str) -> str | None:
    text = text.lower().strip()
    for phrase, token in VOCABULARY.items():
        if phrase in text:
            return token
    return None
2

Gesture false positives

The Problem

Hand jitter and partial gestures triggered unintended commands.

How I Solved It

Require GESTURE_HOLD_FRAMES (8) stable frames plus GESTURE_COOLDOWN_S (2.0) after each send.

if stable_frames >= HOLD_FRAMES and time.time() - last_sent > COOLDOWN:
    publish_token(token)
    last_sent = time.time()
3

Alert escalation timing

The Problem

Gas alerts need automatic response but users must be able to cancel false alarms.

How I Solved It

FSM enters ALERT, triggers fan_on, starts 30s countdown to EMERGENCY; alert_cancel token resets state.

def on_gas_detected(self):
    self.transition('ALERT')
    self.publish('fan_on')
    self.start_countdown(30, target='EMERGENCY')
4

MCU state feedback loop

The Problem

Dispatcher didn't know if actuator commands actually executed.

How I Solved It

NodeMCU publishes state feedback topics after relay actuation; dispatcher subscribes for confirmation.

Lessons Learned

  1. 1

    Token normalization is essential

    Voice phrases and gesture classifications must map to the same token set so the dispatcher treats all inputs identically.

  2. 2

    Hold frames prevent accidental triggers

    Requiring 8 stable gesture frames and 2s cooldown eliminated false positives from hand jitter.

  3. 3

    FSM modes need explicit escalation

    Alert mode with countdown-to-Emergency gives users time to cancel while ensuring safety fallback.

  4. 4

    E2E tests on MQTT topics

    Testing at the topic level catches routing bugs that unit tests miss.

What I'd Do Differently

Train a small gesture classifier instead of rule-based landmarks, and add motion/temperature sensors to complete the Guardian FSM sensor triggers.