1. Purpose
Define a fast, reliable proof-of-concept (POC) system for multi-room presence, appliance usage, and activity monitoring using distributed Raspberry Pi Zero nodes, BLE sensors, and USB audio, with centralized aggregation and reporting using the OAII and Open SGI base models.
The system prioritizes:
- Local processing
- Interpretable signals
- Privacy-first design
- Modular scaling
- No cloud dependency
2. System Architecture Overview
[Room Nodes (Pi Zero W)] → Wi-Fi/Ethernet → [Central Hub] | | +-- BLE / USB Audio / GPIO +-- MQTT / DB / Reports
Each location-based functional node is served by a dedicated Pi Zero node. All nodes publish structured events to a central hub.
3. Node Roles
3.1 Entry Presence Node (BLE Tags)
Purpose: Detect arrivals, departures, and home/away status.
Hardware
- Raspberry Pi Zero W
- BLE smart tags
- Power supply
Functions
- Configurable rate BLE scanning
- RSSI sampling
- Tag identification
- Home/away state machine
Outputs
- tag_seen
- tag_lost
- home_entered
- home_exited
3.2 Refrigerator Activity Node (BLE Vibration + Optional Reed)
Purpose: Detect refrigerator/freezer usage and left-open conditions.
Hardware
- Raspberry Pi Zero W
- BLE vibration sensor
- Optional magnetic reed switch
- Power supply
Functions
- Detect vibration/motion events
- Monitor door open/close (if reed installed)
- Enforce open-duration threshold
Outputs
- fridge_activity
- fridge_open
- fridge_closed
- fridge_left_open
3.3 Bathroom Audio Node (USB Microphone)
Purpose: Detect bathroom usage events.
Hardware
- Raspberry Pi Zero W
- USB microphone
- Power supply
Functions
- Continuous audio capture
- Feature extraction (RMS, FFT bands)
- Event classification
- Local-only processing
Outputs
- toilet_flush_detected
- water_running
- shower_active
- bathroom_noise_anomaly
3.4 Bedroom Activity Node (USB Microphone)
Purpose: Detect nighttime activity and restlessness indicators.
Hardware
- Raspberry Pi Zero W
- USB microphone
- Power supply
- (Optional) BLE vibration tag under bed
Functions
- Nighttime audio monitoring
- Activity burst detection
- Quiet-hour anomaly detection
Outputs
- sleep_activity_burst
- prolonged_awake_activity
- nighttime_noise_anomaly
3.5 Central Hub Node
Purpose: Aggregate, correlate, store, and report events.
Hardware
- Raspberry Pi 4/5 or equivalent
- Ethernet/Wi-Fi
- Storage
Functions
- MQTT broker
- Event ingestion
- Database storage
- Correlation engine
- Reporting/dashboard
- System health monitoring
Outputs
- Daily/weekly reports
- Alerts
- System status
4. Networking
4.1 Transport
Primary: Wi-Fi (802.11n)
Optional: Ethernet via USB adapter
4.2 Messaging Protocol
- MQTT over TCP
- Local broker on Central Hub
4.3 Topic Structure
home/entry/tag/<id>home/kitchen/fridge/eventhome/bathroom/audio/eventhome/bedroom/audio/eventhome/system/health
5. Event Format
All nodes publish JSON messages using a common schema.
5.1 Base Event Schema
{ "event_id": "uuid", "source_node": "bathroom-01", "sensor_type": "audio", "event_type": "water_running", "timestamp_utc": "2026-02-05T10:23:15Z", "confidence": 0.92, "duration_sec": 18, "value": -54.2}
5.2 Required Fields
- event_id: UUID
- source_node: unique node ID
- sensor_type: ble | audio | gpio
- event_type: domain-specific label
- timestamp_utc: ISO-8601 UTC
- confidence: 0.0–1.0
6. Time Synchronization
- All nodes run NTP
- UTC timestamps only
- Drift tolerance: < 1 second
7. Audio Processing Pipeline
USB Mic → ALSA → Feature Extractor → Classifier → Event Generator
Features
- RMS amplitude
- Spectral bands
- Temporal envelope
Constraints
- No raw audio stored
- Sliding buffer < 10 seconds
- In-memory only
8. BLE Processing Pipeline
BLE Scan → Packet Filter → RSSI Sampler → Event Logic → Publisher
Parameters
- Scan interval: 2–5 s
- Tag advertising: ≥1 s
- RSSI smoothing window: 5–10 samples
9. State Machines
9.1 Home/Away
States:
- UNKNOWN
- HOME
- AWAY
Transitions:
- HOME after N detections in T seconds
- AWAY after no detections for T minutes
Defaults:
- N = 5
- T_enter = 30 s
- T_exit = 10 min
9.2 Refrigerator Left-Open
States:
- CLOSED
- OPEN
- ALERT
Transitions:
- OPEN → ALERT after threshold
- ALERT → CLOSED on close
Defaults:
- Open threshold: 120 s
10. Configuration
10.1 Local Files
Each node loads configuration from:
/etc/siggy/node.conf
10.2 Parameters
- Node ID
- MQTT host/port
- Thresholds
- Sensitivity levels
- Quiet hours
11. Privacy & Data Retention
- No raw audio storage
- No cloud transmission
- Local-only processing
- Default retention: 30 days
- Configurable purge
12. Reliability & Health Monitoring
Each node publishes:
home/system/health/<node_id>
Including:
- Uptime
- CPU usage
- Disk usage
- Last event time
- Error counts
13. Deployment Standards
13.1 Base Image
- Raspberry Pi OS Lite
- Preinstalled:
- Python 3
- MQTT client
- BlueZ
- ALSA
- systemd services
13.2 Services
Each node runs:
- sensor-agent.service
- health-agent.service
- ntp.service
14. Bill of Materials (Per Node)
Room Node
- Pi Zero W
- 16–32GB SD card
- USB microphone (audio nodes)
- BLE sensors/tags
- Power supply
Estimated cost: $25–35
Hub Node
- Pi 4/5
- Storage
- Network adapter
Estimated cost: $60–90
15. POC Success Criteria
The system is considered successful if:
- Home/away detected within ±2 minutes
- Fridge left-open alerts trigger reliably
- Bathroom usage events detected ≥85%
- Bedroom activity anomalies detectable
- System uptime ≥14 days
- Event loss <1%
16. Future Extensions
- Bed vibration sensing
- Door reed sensors
- ML-based classifiers
- Cross-room inference
- Mobile dashboard
- Automatic updates
17. OAII / Open SGI Alignment and Conformance
17.1 Conformance Mapping
| POC Element | OAII / Open SGI Class | Description |
|---|---|---|
| Room Node (Pi) | Device | Physical/virtual execution substrate |
| BLE Scanner / USB Mic | Sensor | Data acquisition interface |
| Raw Samples (RSSI, audio frames) | Observation | Uninterpreted measurements |
| Derived Features | Signal | Processed feature vectors |
| Detected Occurrence | Event | EventType/EventInstance |
| Aggregated State | Knowledge | Persistent interpreted state |
| Thresholds / Quiet Hours | Policy | Governance and control rules |
| Correlation Engine | Agent | Decision and coordination logic |
| Dashboard / Reports | Interface | Human interaction layer |
| Logs | Log | Auditable event records |
| MQTT Messages | Envelope | Transport-neutral wrapper |
17.2 OAII Envelope Format
All inter-node messages SHALL be wrapped in an OAII-compliant envelope.
{ "envelope": { "envelope_id": "uuid", "schema_version": "oaii-0.1", "source_device": "bathroom-01", "destination": "hub", "timestamp_utc": "2026-02-05T10:23:15Z", "world_ref": "W_bathroom", "episode_ref": "ep-20260205-102300" }, "payload": { "event": { "event_id": "uuid", "event_type": "water_running", "confidence": 0.92, "duration_sec": 18, "value": -54.2, "context_state": { "time_of_day": "morning", "home_state": "HOME", "quiet_hours": false, "recent_events": ["door_open"] } } }}
17.3 World Model (Open SGI)
Each event and knowledge item SHALL be interpreted relative to a declared World.
Defined Worlds (POC)
| World ID | Scope |
|---|---|
| W_home | Global household semantics |
| W_entry | Entrance / transition zone |
| W_kitchen | Kitchen / refrigerator context |
| W_bathroom | Bathroom activity context |
| W_bedroom | Sleep and rest context |
| W_privacy | Privacy and governance context |
World references are carried in each envelope as world_ref.
17.4 Context State Model
Each Event SHALL reference a ContextState object.
Minimum context fields:
- time_of_day
- home_state
- quiet_hours
- estimated_room_occupancy
- recent_events
ContextState is managed by the Central Hub as Knowledge.
17.5 Episode Model
An Episode represents a bounded interval of interpretation.
Episode Types
| Episode Type | Duration / Trigger |
|---|---|
| AudioEpisode | Sliding 5–10 s window |
| PresenceEpisode | 30 s BLE window |
| FridgeOpenEpisode | Open → Close |
| NightActivityEpisode | Quiet-hours window |
Events are emitted at episode boundaries or on threshold crossings.
17.6 Policy Registry
All thresholds and governance rules SHALL be declared as named Policies.
Core Policies
| Policy ID | Scope | Purpose |
|---|---|---|
| Policy.NoRawAudioRetention | Global | Prevent audio storage |
| Policy.BathroomMinimization | W_bathroom | Reduce data granularity |
| Policy.FridgeLeftOpen | W_kitchen | Open-duration alert |
| Policy.HomeAwayHysteresis | W_entry | Stabilize presence state |
| Policy.QuietHours | W_bedroom | Nighttime filtering |
Policies are enforced at node and hub levels.
17.7 Knowledge Representation
Central Hub maintains Knowledge objects including:
- HomeState
- RoomOccupancyState
- ApplianceUsageState
- SleepActivityProfile
- DailyActivitySummary
Each Knowledge object is versioned and world-scoped.
17.8 Harmony and System Health Metrics
The system SHALL maintain HarmonyMetrics for viability and governance.
Minimum metrics:
| Metric | Description |
|---|---|
| FalseAlertRate | % incorrect alerts |
| MissedDetectionRate | Estimated misses |
| PrivacyExposureScore | Audio-derived event ratio |
| UptimeRatio | Availability |
| EventLossRate | Dropped events |
Metrics are published weekly and stored as Knowledge.
17.9 OAII / Open SGI Conformance Levels
| Level | Description |
|---|---|
| L1 | Device/Sensor/Event/Envelope compliant |
| L2 | World/Context/Episode enabled |
| L3 | Policy + Knowledge governance |
| L4 | HarmonyMetrics + adaptive Agents |
Target for POC: L2
Target for Pilot: L3
18. Versioning
- v0.1: Initial POC specification
- v0.2: OAII/Open SGI alignment
- v1.0: Stable pilot release

Leave a comment