Skip to content

A smart mmWave radar monitor that helps you stay focused and take regular breaks. Built with an ESP32, HLK-LD2410B sensor, and a WS2812 LED ring.

License

Notifications You must be signed in to change notification settings

shashanksreddy/HLK-LD2410-Focus-Monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mmMind: The mmWave Focus Guardian

A smart mmWave radar monitor that helps you stay focused and take regular breaks. Built with an ESP32, HLK-LD2410B sensor, and a WS2812 LED ring.

🧐 The Problem

You're in a "flow state," completely focused on a complex coding problem, and a colleague or family member taps you on the shoulder. Your concentration is shattered.

Open-plan offices and home-office setups make us vulnerable to these well-meaning but disruptive interruptions. A simple "busy" sign is easy to miss. This project creates an active visual warning that alerts you before you get startled, giving you a moment to pause your work and turn around.

💡 The Solution

Unlike standard PIR sensors that just detect motion, mmMind uses Range Gating logic to provide intelligent context:

  1. Smart User Zone: It creates a dedicated "User Zone" (0-1.5m) where your presence is monitored for focus (turning Green), distinguishing you from the rest of the room.
  2. Detects Intruders: It scans a "Distraction Zone" (1.5m-3m) behind you.
  3. Active Warning: If someone breaches the perimeter, the LED ring flashes a visual alert, giving you time to turn around before being startled.
  4. Break Timer: Includes a "52/17" rule timer to remind you to take breaks after 52 minutes of deep work.

How It Works (Detailed Logic)

The system divides your room into invisible zones to understand context.

Zone 1: The Focus Bubble (0 - 1.5m)

This zone monitors you.

🟢 True Focus (Solid Green): You are present and relatively still. The light glows green, increasing in brightness the longer you maintain focus (Gamification).

🔴 Distraction (Blinking Red): You are present but fidgeting excessively, looking at your phone often, or moving wildly. The system alerts you to settle down.

Zone 2: The Perimeter (1.5 - 3.0m)

This zone monitors the room behind you.

🔵 Intruder Alert (Flashing Blue): The system ignores your movement but scans the area behind you. If someone enters this zone, the light flashes blue to warn you of an approach before they tap your shoulder.

🟣 Health Logic (Timer) Break Reminder: If you have been focused for >52 minutes, the light overrides all other colors and pulses Purple, reminding you to stand up and stretch.

🛠️ Hardware Required

  • Microcontroller: ESP32 Development Board (WROOM-32).
  • Sensor: Hi-Link HLK-LD2410B (Bluetooth version recommended for easy tuning).
  • Visual: WS2812B RGB LED Ring (Neopixel).
  • Power: 5V Power Supply (2A USB charger).
  • Misc: Breadboard, Jumper wires.

🔌 Wiring

HLK-LD2410 Pin ESP32 Pin
VCC 5V
GND GND
TX GPIO 16 (RX2)
RX GPIO 17 (TX2)
LED Ring Pin ESP32 Pin
VCC 5V
GND GND
Data In (DI) GPIO 23
XL9535 Relay Module Series Variants

Figure1.

graph TD
    %% Components
    ESP32[ESP32 Development Board]
    Radar[HLK-LD2410 Radar Sensor]
    LEDRing[WS2812B LED Ring]
    Power[5V Power Source / USB]

    %% Wiring Connections - Radar to ESP32
    Radar -- "VCC" --> Power
    Radar -- "GND" --> Power
    Radar -- "TX" --> ESP32_RX["GPIO 16 (RX2)"]
    Radar -- "RX" --> ESP32_TX["GPIO 17 (TX2)"]
    
    %% Wiring Connections - LED Ring to ESP32
    LEDRing -- "VCC (5V)" --> Power
    LEDRing -- "GND" --> Power
    LEDRing -- "DI (Data In)" --> ESP32_D23["GPIO 23"]

    %% Power distribution
    Power -- "5V" --> ESP32
    Power -- "GND" --> ESP32

    %% Styling
    style ESP32 fill:#232F3E,stroke:#fff,stroke-width:2px,color:#fff
    style Radar fill:#009900,stroke:#333,stroke-width:2px,color:#fff
    style LEDRing fill:#ffcc00,stroke:#333,stroke-width:2px,color:#000
    style Power fill:#cc0000,stroke:#333,stroke-width:2px,color:#fff
Loading

Note: The LED ring and sensor can draw significant power. Ensure your 5V source is stable.

⚙️ Sensor Configuration

Before running the code, you must configure the sensor zones using the HLKRadarTool mobile app:

  1. Gate 0 (0-0.75m) & Gate 1 (0.75-1.5m): Set sensitivity to 0 (Disabled). This creates the "Ignore/User Zone".
  2. Gate 2 (1.5-2.25m) & Gate 3 (2.25-3.0m): Set sensitivity to High (e.g., 80). This is your "Trigger Zone".

💻 Logic & Features

The code implements three priority levels:

  • Priority 1 (Proximity Alert): * 3m - 2m: Blue Alert.
    • 2m - 1.5m: Yellow Alert.
    • < 1.5m: Red Alert.
  • Priority 2 (Break Reminder): Triggers a Purple alert if you have been focused for 52 minutes.
  • Priority 3 (Focus Monitoring): Monitors energy levels in the distraction zone to detect subtle movements.

📚 Installation

  • Library: Install LD2410 by ncmreynolds & Adafruit NeoPixel.
  • Upload: Flash the provided main.cpp to your ESP32.
  • Placement: Mount the sensor on top of your monitor, facing you. Ensure "Zone 2" has a clear line of sight to the door or walkway behind you.

📄 License

This project is open-source and available under the MIT License.

About

A smart mmWave radar monitor that helps you stay focused and take regular breaks. Built with an ESP32, HLK-LD2410B sensor, and a WS2812 LED ring.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages