TECHNICAL CASE STUDY / SLEEPSANITY LLC

The mobile layer
of a connected
sleep system.

A Flutter application that coordinates audio, timed routines and wearable device controls across Android and iOS.

Flutter & DartBLE / GATTFirebaseAndroid & iOS
SleepSanity wearable device being used
SleepSanity connected sleep device
ROLEMobile Application Developer
PERIODJune 2023 to present
SCOPEMobile application and device integration

01 / ENGINEERING PROBLEM

APPLICATION + DEVICE + AUDIO

Keeping several systems
in sync.

A sleep routine spans three domains: what the person hears, what the device does, and what the application shows.

Those domains advance on different clocks. Audio has playback and lifecycle state; Bluetooth has connection and notification state; a routine has phases and saved settings. The practical challenge is to make them behave as one coherent interaction, including when a device disconnects or a user changes a setting during a transition.

This is an engineering account of the mobile implementation. It does not make claims about clinical efficacy or measured sleep outcomes.

02 / SYSTEM MODEL

One product.
Three coordinated layers.

01 / USER EXPERIENCE

Flutter application

Accounts, saved routines, powernaps, playback controls and responsive state across Android and iOS.

02 / ORCHESTRATION

Timers, streams and state

Provider and Dart streams coordinate routine phases, UI updates, audio and device commands.

03 / DEVICE INTERFACE

Bluetooth protocol

GATT discovery, characteristic writes and notifications carry commands and device state.

FIREBASE / AUTHENTICATION + STORED ROUTINESAUDIO / BACKGROUND PLAYBACK + LIFECYCLE

03 / MY CONTRIBUTION

JUNE 2023 TO PRESENT

Application ownership
from interface to integration.

I developed the mobile application functionality: authentication and user settings, connected device flows, saved routines, evening and morning sequences, powernaps, audio controls and app side firmware update flows. I collaborated with hardware engineers on command behaviour and device integration. Firmware and hardware programming were outside my role.

01

Bluetooth communication

Implemented scanning and device filtering, GATT service and characteristic discovery, write mode selection, notification subscriptions and reconnection behaviour. Connection state feeds the application so controls reflect device availability.

02

Routine orchestration

Built timed phases that adjust audio, light intensity, lens tint and volume together. Interpolation produces gradual transitions while pause and manual overrides preserve user control.

03

State and persistence

Used Provider, ChangeNotifier and Dart streams to connect UI and device state. Firebase Authentication and user scoped Firestore data support accounts and stored routines.

04

Device commands and updates

Encoded settings into device specific byte commands, mapped values to supported ranges and avoided redundant writes during transitions. Implemented the application side of firmware update workflows.

04 / INTERACTIVE EXPLANATION

A routine as a
coordinated sequence.

Select a phase to see the relationship between playback, application timing and device controls.

ROUTINE PHASEWind downAudio + light + tint
EXPLORE THE SEQUENCE

Audio and device settings transition together as the routine begins.

CONCEPTUAL DIAGRAM / NOT A LIVE DEVICE CONNECTION

05 / ENGINEERING EVIDENCE

DIAGNOSTIC TOOLING

Make device behaviour
observable.

The team needed to distinguish device sampling from Bluetooth delivery. I built a separate Flutter accelerometer diagnostic application to inspect raw BLE packets, count notifications over timed windows and configure sampling and range settings.

That distinction matters: a sensor sample rate is not the same measurement as the notification rate received by a phone. The diagnostic app provides transport visibility, though this case study does not present benchmark data or claim a measured performance improvement.

Read about the diagnostic tool →

TECHNICAL PERSPECTIVE

A reliable interface depends
on the systems beneath it.

The substantive work was not a single screen or feature. It was the coordination of device commands, background audio, timed phases, persistent settings and application state into a usable mobile product.

CASE STUDY / SLEEPSANITY LLC / AAZIQ ALI SHAH
CONTACT / AAZIQ ALI SHAH OPEN TO MOBILE ROLES

Build something
that works.

Flutter, connected devices and the interfaces between them. If that fits what your team is building, I would be glad to hear from you.