No results found.

BLE Heart Rate Monitor Library

Portfolio project: a Bluetooth Low Energy heart rate receiver monorepo with a TypeScript core library, CLI tool, and WebSocket server for real-time integrations.

Bluetooth Low Energy heart rate receiver built as a monorepo containing a reusable TypeScript core library, a CLI monitoring tool, and a WebSocket server for real-time data streaming. The project enables seamless integration of heart rate data from Garmin watches, Polar straps, and other BLE devices into custom applications, dashboards, and IoT systems.

ℹ️
BLE Heart Rate, Made Accessible

A practical exploration of Bluetooth LE, real-time data streaming, and reusable TypeScript architecture.

Project Challenge

Consuming real-time heart rate data over Bluetooth Low Energy presents several challenges for application developers:

  • Handling low-level BLE protocols and device discovery
  • Supporting multiple heart rate devices with varying implementations
  • Reusing logic across different environments (CLI, web, IoT)
  • Streaming data reliably to web applications in real time

Most existing solutions were tightly coupled to a single use case or platform, making them difficult to adapt or extend.

Architecture & Solution

This project was designed as a modular monorepo, allowing each component to share a common core while targeting different integration scenarios.

Monorepo Structure

🧠
Core BLE Library (TypeScript)
⌨️
CLI Monitoring Tool
🌐
WebSocket Streaming Server
📈
Example Vue.JS Application

Component Breakdown

Core Library

  • Implements BLE device discovery and connection
  • Supports the standard Bluetooth Heart Rate Profile
  • Exposes a clean, typed API for reuse across projects

CLI Tool

  • Terminal-based heart rate monitoring
  • Scriptable output for automation and data logging
  • Useful for debugging, testing, and lightweight integrations

WebSocket Server

  • Streams heart rate data to clients in real time
  • JSON-based message format for easy consumption
  • Supports multiple concurrent clients

Example Vue.js Application

  • Connection management for multiple devices
  • Simultaneous device connections
  • Example graphing of received device data

Device Compatibility

All standards compliant BLE devices should be compatible with the project including Smart watches and Heart Straps. Although I only have tested a few devices due to access limitations.

⌚️
Garmin Fenix 7
⏱️
Garmin Instinct 2
❤️
Polar H1

Outcome & Impact

Reusable
Core Logic
Shared library
Real-time
Data Streaming
WebSocket-based
Fun
Project
First time using BLE

The project demonstrated how low-level hardware data can be made accessible to web and application developers through thoughtful abstraction and real-time interfaces.

It also served as a foundation for experimenting with IoT-style data pipelines, enabling rapid prototyping of fitness dashboards, monitoring tools, and connected applications.

Technical Highlights

  • Node.js with native BLE bindings
  • TypeScript-first design for type safety and self-documenting APIs
  • WebSocket bridge for real-time browser integration
  • Clear separation of concerns between transport, logic, and presentation
  • Support for multiple devices and concurrent consumers

This case study highlights a practical approach to Bluetooth LE integration, real-time data streaming, and maintainable monorepo architecture — all with a strong focus on reuse and extensibility.