Himanshu Gupta

Hi, I'm Himanshu Gupta.

Curious about how things work, why people struggle, and what we can build to help. Exploring learning, AI, and human performance.

Want to know more?

Engineering

Beyond the SDK

(Working hardware. Inaccessible data.)

Reverse Engineering a Commercial Wearable to Access Proprietary Physiological Data

Engineering Case Study • Bluetooth Low Energy • Wearables
Built while developing Learnzy.

Executive Summary

I needed physiological data from a wearable for Learnzy. I first built sensor and PCB prototypes, then realized that manufacturing a reliable wearable was a much larger undertaking than accessing its data.

I switched to OEM smart rings. When the manufacturer's SDK exposed too little, I reverse engineered the BLE protocol and built an Android client.

The prototype discovered and connected to the ring, decoded proprietary packets, streamed HRV, extracted RR intervals, and read sleep stages.

Context

I needed:

  • Heart Rate
  • Heart Rate Variability (HRV)
  • RR Intervals
  • Sleep Stages
  • Battery Status
  • Continuous Streaming

I initially assumed that accessing this data meant building the wearable.

Phase One: Building the Hardware

I began learning embedded electronics from scratch.

Topics included:

  • PCB Design
  • Circuit Design
  • Sensor Integration
  • Embedded Components
  • CAD Software
  • PCB Fabrication
Notebook sketch of early wearable circuit thinking
Early circuit notes before moving into CAD.

The first prototype used:

  • ESP32 Xiao
  • MAX30102
  • ADXL345
  • Temperature Sensors
  • GSR Sensors
Sensor modules placed on a breadboard
Sensor modules tested on a breadboard before committing to a board design.

I designed prototype PCBs, ordered fabricated boards, and assembled early hardware prototypes.

Early wearable schematic in EAGLE
First schematic pass for the health monitor board.
PCB layout for the wearable prototype
PCB routing and physical dimension planning.
flowchart TD
  A[Research] --> B[Breadboard Prototype]
  B --> C[PCB Design]
  C --> D[PCB Fabrication]
  D --> E[Hardware Prototype]
Fabricated prototype PCB held in hand
Fabricated prototype board.
Assembled health monitor prototype PCB
Assembled prototype used to validate the hardware path.

The Realization

After several weeks, the work beyond a functioning PCB became clear:

  • Miniaturization
  • Industrial Design
  • Battery Optimization
  • Waterproofing
  • Manufacturing
  • Reliability Testing
  • Mechanical Engineering

I needed reliable measurements, not a hardware manufacturing business.

The Pivot

I changed the question from "How do I build a wearable?" to "Can existing hardware provide the data I need?"

Evaluating Existing Hardware

I researched existing wearables.

Option Pros Cons
Whoop High quality · reliable Expensive · closed ecosystem · no raw physiological access
Commercial smart rings Compact · available Proprietary SDK · limited access
OEM manufacturers Direct hardware access · sample devices available Documentation gaps · protocol ambiguity

After searching multiple OEM catalogs and hardware marketplaces, I contacted several manufacturers directly.

Eventually I imported multiple sample smart rings for experimentation.

The New Bottleneck

The manufacturer supplied an Android SDK, but it exposed only part of the device's functionality. The measurements I needed remained behind proprietary Bluetooth communication.

The bottleneck had moved from hardware to protocol access.

Existing Solution

The obvious approach was to use the SDK exactly as intended.

flowchart TD
  A[Ring] --> B[Official SDK]
  B --> C[Limited Data]

The official interface did not expose enough data for the project.

Alternative Approaches Considered

Option Decision Reason
Accept SDK limitations Rejected Insufficient access
Find another wearable Rejected Most consumer devices expose similar limitations
Hire a reverse engineering specialist Attempted Despite multiple attempts, the protocol remained unresolved
Learn reverse engineering Selected Protocol access became the critical dependency

Whiteboard Thinking

The remaining choices were to stop, hire help, or learn the protocol myself.

flowchart LR
  A[Abandon Project] --- B[Hire Specialist]
  B --- C[Learn Reverse Engineering]
  C --> D[Selected]

The First Attempt

I began by decompiling the application. Thousands of classes and obfuscated code made it hard to find the Bluetooth implementation. Weeks passed with little progress because I was trying to understand the whole app.

First Principles

I narrowed the task: I needed the protocol, not a complete understanding of the application.

I searched for specific answers:

  • Where is BLE initialized?
  • Which classes establish the connection?
  • Which services discover characteristics?
  • Which packets request sleep data or stream HRV?
  • Where are RR intervals parsed?

Those questions reduced the search space.

Reasoning Process

Old approach:

flowchart TD
  A[APK] --> B[Read Everything]
  B --> C[Understand Everything]
  C --> D[Impossible]

New approach:

flowchart TD
  A[Desired Data] --> B[BLE Module]
  B --> C[Connection Classes]
  C --> D[Packet Parser]
  D --> E[Characteristic Mapping]
  E --> F[Protocol]

This change in thinking ultimately became one of the inspirations behind Reason.

Final Architecture

flowchart TD
  A[OEM Smart Ring] --> B[Bluetooth Low Energy]
  B --> C[Proprietary Packet Stream]
  C --> D[Reverse Engineered Protocol]
  D --> E[Android BLE Client]
  E --> F[Packet Parser]
  F --> G[Decoded Physiological Data]
  G --> H[Research Dataset]

Prototype Application

The Android prototype was built to validate packet extraction, not a finished consumer interface.

Device Discovery

  • BLE scanning
  • Device identification
  • RSSI monitoring
Prototype app requesting Bluetooth permission
Bluetooth permission flow in the Android prototype.
Prototype app scanning for nearby BLE devices with addresses hidden
BLE scan results with device addresses hidden.

Device Connection

  • Pairing
  • Connection management
  • Battery status
  • Session control

Continuous HRV Streaming

  • Live HRV packets
  • Continuous monitoring
  • Session logging
Prototype app displaying HRV events from a ring session
Continuous HRV events captured by the Android prototype.

Sleep Data Extraction

  • Sleep stages
  • Duration
  • Deep Sleep
  • REM
  • Light Sleep
Prototype app showing extracted sleep summary and sleep stages
Sleep summary and staged sleep data extracted through the prototype.

Decoded Device Data

Successfully extracted:

  • Heart Rate
  • HRV
  • RR Intervals
  • Sleep Stages
  • Battery Status
  • Continuous Sensor Events

Engineering Decisions

Decision Reason
Stop building custom hardware Hardware manufacturing was not the leverage point
Purchase OEM hardware Commodity hardware already existed
Reject SDK limitations Required data remained inaccessible
Learn reverse engineering The protocol became the critical dependency
Build a dedicated Android prototype Fastest environment for validating extracted packets

Trade-offs

Advantages

  • Access to the required device measurements outside the official SDK.
  • Independence from SDK limitations.
  • Rapid experimentation.
  • No need to manufacture a custom wearable.
  • Reusable protocol knowledge.

Limitations

  • Reverse engineering required significant time.
  • Protocol changes could break compatibility.
  • Device dependent.
  • OEM firmware updates remain a risk.

What I Learned

The hardware detour and the stalled decompilation had the same cause: I was solving more of the system than the task required.

Progress came from identifying the layer I needed to understand and asking questions that reduced uncertainty there. That shift also helped inspire Reason.

Future Direction

Potential future work includes:

  • Automatic firmware compatibility detection
  • Packet documentation
  • Multi-device support
  • Protocol abstraction layer
  • Cross-platform BLE implementation
  • Real-time physiological dashboards

Project Outcome

The prototype accessed physiological data without the manufacturer's SDK. The project moved from building hardware to understanding the protocol of hardware that already existed.

Project Details

Field Detail
Project Type Engineering Case Study
Category Reverse Engineering · Bluetooth Low Energy · Wearables
Built For Learnzy
Author Himanshu Gupta
Status Prototype Complete
Part of LearnzyLabs

Related Work