AS
Back to side quests

Somn

A privacy-first, open-source sleep tracker for Android

2026AndroidKotlinJetpack ComposeRoom

Somn uses your phone's accelerometer to track sleep stages overnight — no wearable required. It scores your sleep with age-calibrated algorithms, supports biological profile adjustments, and keeps everything on-device.

Why I built it

Most sleep trackers require a $300 wearable or a recurring subscription. The free ones are often data brokers in disguise, harvesting your intimate health data. I wanted a privacy-first alternative that worked just by placing the phone on the mattress.

Architecture & Tech Stack

Built with Kotlin and Jetpack Compose, following Clean Architecture and unidirectional data flow. The app is divided into layers:

  • Data: Room database, DAOs, entities
  • Domain: Pure Kotlin use cases and models
  • UI: Compose, Material 3, dynamic theming
  • Tracking Service: A foreground service that reads raw accelerometer data, calculating movement magnitude and variability.

Smart Scoring Algorithm

The sleep scoring isn't just a generic percentage. It uses an age-calibrated algorithm that adjusts deep sleep targets from 27.5% for teens down to 10% for seniors. It also supports biological profiles, meaning the algorithm is lenient during specific menstrual cycle phases or for neurodivergent profiles (like ADHD), where consistency is naturally disrupted.

Zero Telemetry

The application literally does not have the INTERNET permission in its manifest. Every calculation, from epoch classification to sleep debt analysis, happens entirely on-device. Your sleep data is yours.