SDK + Cloud Production-audited iOS modules · AI-grade extraction

Every phone is a sensor bundle.
We turn it into signal.

Gridspin Sensors is a productized iOS SDK + cloud pipeline that pulls camera, mic, IMU, GPS, BLE and NFC into one typed, AI-grade data stream. Drop it into clinical capture, retail floor walks, field-service workflows, or IoT cross-validation — and ship structured features your model can actually act on.

iOS Swift SDK IMU · PPG · Voice · Vision HTTPS feature pipeline
9:41
Capture session
s-2026-06-20
REC
IMU · accel 30 Hz
Rear PPG · HR 72 bpm
Voice · transcript SFSpeech
Front · PSPI 0.34
4 lanes
IMU + camera + mic + GPS
audit-passed
Production-grade Swift SDK from a clinical deployment
30 Hz
IMU sample rate · CoreMotion
AI-ready
Typed structured output to your model

The thesis

Your customer's phone is already in the field.
It's already a sensor bundle.

Camera, mic, IMU, GPS, BLE, NFC — every modern handset carries seven instrument-grade transducers. The hard part isn't reading them. It's turning raw frames and samples into typed, time-aligned features your AI can act on. That's what Gridspin Sensors ships: the SDK, the pipeline, and the audit trail.

The four sensor lanes

One SDK. Four production-audited capture modes.

Each lane is a Swift module you can adopt independently — or wire all four into a single capture session.

Lane 01

IMU & GPS

CoreMotion accelerometer, gyroscope, Euler angles and quaternion at 30 Hz, plus CoreLocation with horizontalAccuracy gating — not the liveLatitude != 0 anti-pattern. Lat = 0 is valid; absence of fix is what you actually care about.

accel ax·ay·az
gyro rx·ry·rz
euler roll·pitch·yaw
quat w·x·y·z
gps lat·lon·hAcc·hasLikelyGPSFix
Lane 02

Rear-camera PPG

Photoplethysmography from the rear camera with the flash as the illuminant — finger over the lens, torch enabled after startRunning() (preserves AVFoundation ordering). Heart-rate and HRV-grade beat trace, no extra hardware.

illuminant torch · post-start
extraction mean(R) per frame
features HR · IBI · HRV
Lane 03

Front-camera pain proxy

Forehead PPG plus facial action units (VNDetectFaceLandmarksRequest) folded into a PSPI pain score. Computed synchronously on the session queue via PainIndicators — no main-queue races, no stale snapshots.

landmarks Vision · per frame
AU compute synchronous · session q
output PSPI · forehead-PPG
Lane 04

Voice annotation

SFSpeechRecognitionTask continuous dictation with the right finalization semantics — finalize only on stopVoiceRecording(), not on every segment-final mid-stream. Long-form notes survive the whole press-and-hold.

stream liveTranscript · callbacks
finalize stopVoiceRecording()
output String · timestamps

Production audit · proof points

We ship Swift modules that have been through a clinical-grade audit — not demo code.

Every lane in the SDK came out of a real iOS application, with a written audit that found real bugs and shipped the fixes. Four representative finds — the kind that bite anyone who tries to do this from scratch:

What you don't have to build
Connection-state machines · queue discipline for vision pipelines · speech finalization semantics · GPS fix heuristics that don't lie to you when latitude crosses zero. Boring on a slide; load-bearing in production.
FIX 01 PPNOCIDevice
Wi-Fi / TCP .failed handling + single-shot completion

Original downloadFile only handled .ready; on no-route or refused, the completion never fired → hung UI, ambiguous state. We added .failed handling, routed every completion through one finish closure, and replaced parts.last! with safe Int parsing of OK:FILE_SIZE.

FIX 02 FacialAnalysis
Pain-score PSPI on the session queue, not on a race

Landmark extraction dispatched AU values to the main queue, then computePainScore() ran on the video-processing queue reading @Published fields before the async update landed. We introduced a synchronous PainIndicators struct, computed PSPI on-queue, then published UI + painHistory in one main-queue block.

FIX 03 VoiceAnnotationManager
Speech: finalize only on stopVoiceRecording()

SFSpeechRecognitionTask emits isFinal == true for segment finals mid-stream; the original code finalized on each one, clearing state while the user was still holding the button. We update liveTranscript from callbacks and finalize only at stop — long dictations survive.

FIX 04 PhoneSensors
GPS fix via horizontalAccuracy, not lat != 0

Code that inferred a GPS fix from liveLatitude != 0 drops on the equator and lies in the lab. Apple documents negative horizontalAccuracy as invalid. We expose hasLikelyGPSFix (accuracy ≥ 0 and < 500 m) and consolidate GPS append + UI on the main queue.

Cross-vertical

One sensor SDK. Many verticals.

Phones are everywhere your customers are. The same four lanes power three very different products in the Gridspin family.

Clinical · Therapeutics

Augment the wearable with the phone

Rear-camera PPG cross-checks an ESP32 wearable EMG/PPG band. Voice annotation streams patient intake straight into PROAgent. Pain proxy on the front camera is a third opinion when both signals disagree.

  • PPG fusion (phone + wearable) for HR confidence
  • Hands-free voice intake to PROAgent
  • PSPI as adjunct to self-report VAS
therapeutics.gridspin.xyz
Retail · IoT smart pad

Phone walks the floor, pad watches the shelf

Operator walks the salon or medspa floor; the phone's rear camera proposes SKU + quantity via vision; the IoT smart-shelf FSR pad confirms what actually left the surface. Two independent signals, one cross-validated inventory event.

  • Vision proposes · FSR pad confirms
  • IMU detects walk vs. dwell
  • Voice tag: "two of the retinol"
iot.gridspin.xyz
Field service

Voice-annotated work orders, automatic stage detection

Voice-annotated photos for every fix; IMU segments the visit into stages (drive · approach · work · pack out); GPS with proper accuracy gating proves the tech was on-site. The capture is structured before it ever leaves the phone.

  • Voice notes attached to each photo
  • IMU stage classifier (walk / kneel / drive)
  • GPS proof-of-presence (hAcc-gated)
recall.gridspin.xyz

SDK + Cloud pipeline

Three steps from raw transducer
to structured feature.

Capture on-device. Compress for the wire. Extract on the server. Your AI consumes the typed output.

1
Capture · Swift SDK

Four lanes, one capture session

Drop the SDK into your iOS target. Subscribe to whichever lanes you need; each emits typed Swift values at its native rate. CoreMotion, AVFoundation, Speech, and CoreLocation, wired correctly the first time.

sensors.start(.imu, .rearPPG, .voice, .gps)
sensors.onSample = { sample in ... }
2
Compress · on-device

JPEG frames · packed binary samples

Photos pass through jpegData(compressionQuality:) with a quality target you set. Continuous samples are batched into a packed binary log on disk and shipped as application/octet-stream — no envelope overhead per record.

jpeg · q=0.78 · ~180 KB
imu · 96 B / sample · octet-stream
3
Cloud · features

HTTPS ingest · feature extraction

Per-device token auth, HTTPS multipart for media, octet-stream for binary samples. The cloud runs feature extraction (HR/IBI from PPG, action units from frames, transcript chunks from voice) and exposes typed features under one session id.

POST /capture/* · X-Device-Token
GET /features/<sid>
# Push a batch of IMU samples from a capture session
curl -X POST https://api.gridspin.xyz/capture/imu \
  -H "X-Device-Token: $DEVICE_TOKEN" \
  -H "X-Session-Id: s-2026-06-20-a1f9" \
  -H "Content-Type: application/octet-stream" \
  --data-binary @/tmp/imu_batch.bin

# → 200 OK  {"records": 487, "session_id": "s-2026-06-20-a1f9", "features_ready": true}

# Then pull typed features for your model
curl https://api.gridspin.xyz/features/s-2026-06-20-a1f9 \
  -H "Authorization: Bearer $API_KEY"
# → { "imu": {...}, "ppg": {"hr_bpm": 72.4, "hrv_rmssd": 38.1}, "voice": {...}, "pain": {...} }

API surface

Five endpoints. Typed in, typed out.

The SDK calls these for you, but the surface is small enough you can hit it from any client — Python, Node, a custom firmware.

POST
/capture/imu
Packed IMU + GPS batch (accel, gyro, euler, quat, hAcc). octet-stream
X-Device-Token
POST
/capture/ppg
Rear- or forehead-camera PPG samples. Server extracts HR / IBI / HRV. octet-stream
X-Device-Token
POST
/capture/voice
Final transcript + optional WAV chunk for re-recognition. multipart
X-Device-Token
POST
/capture/photo
JPEG frame (PhotoPicker output) + EXIF + sensor tags. multipart
X-Device-Token
GET
/features/<sid>
Typed feature bundle for an entire session — your AI's input. JSON
Bearer API key
GET /features/<sid> · response shape
{
  "session_id": "s-2026-06-20-a1f9",
  "imu": {
    "rate_hz": 30,
    "stages": ["approach", "work", "pack_out"],
    "steps": 412
  },
  "ppg": {
    "hr_bpm": 72.4,
    "hrv_rmssd_ms": 38.1,
    "confidence": 0.92
  },
  "pain": {
    "pspi_mean": 0.34,
    "pspi_peak": 0.81,
    "forehead_ppg_hr": 71.2
  },
  "voice": {
    "transcript": "two of the retinol, replace the empty",
    "locale": "en-US"
  },
  "gps": { "lat": 37.7749, "lon": -122.4194, "h_acc_m": 6.4, "likely_fix": true }
}

Ready when you are

Drop the SDK in.
Get typed signal out.

Clinical, retail, field, or a custom integration on top of your own product — we'll spec the lanes, drop in the Swift modules, and stand up the ingest. First captures within a week.

hello@gridspin.xyz · sensors.gridspin.xyz