Skip to main content

Getting started with 60GHz mmWave Breathing and Heartbeat Detection Sensor Kit with XIAO ESP32C6 (MR60BHA2)


Introducing our advanced mmWave Sensor Modules for XIAO, designed to provide cutting-edge monitoring solutions for both fall detection and heartbeat monitoring. Powered by the robust XIAO ESP32 microcontroller with built-in Wi-Fi and Bluetooth connectivity, these modules offer precise and reliable detection capabilities. Whether you need to monitor falls in real-time or track heartbeats with sensitive accuracy, our modules are equipped with state-of-the-art technology, including customizable RGB LEDs and ambient light sensing. With easy expansion options through Grove GPIO ports, these versatile modules are perfect for a wide range of applications, from smart home integration to healthcare monitoring.

Features

  • Wi-Fi & Bluetooth Enabled: Both modules are powered by XIAO ESP32 with pre-flashed ESPHome firmware, ensuring quick setup and customization.
  • Heartbeat Detection Module:
    • Sensitive Heartbeat Monitoring: Detects heartbeats from up to 1.5 meters.
    • Static Presence Detection: Monitors stationary individuals up to 6 meters away.
  • Environmental Sensing:
    • BH1750 Light Sensor: Measures ambient light from 1 to 65,535 lux.
    • WS2812 RGB LED: Customizable LED for visual feedback and DIY projects.
  • Expandable Connectivity: Includes Grove GPIO ports for adding additional sensors and modules.

Specification

General Parameters
mmWave FirmwareBreathing and Heartbeat Detection
Detection RangeHuman Static Presence Detection: up to 6 Meters
Breathing and Heartbeat Detection: 1.5 Meters
MCUSeeed Studio XIAO ESP32C6
LEDWS2812 RGB LED
ButtonRest
Light SensorBH1750 Range: 1 to 65,535 lux with adjustable measurements up to 100,000 lux
Connectivity1 GPIO Port (D0, D10)
Pin Header Spacing2.54mm
Power Supply5V/1A Input
Power consumption0.5w: Standby Mode
0.8w: Activation Mode
1.4w: work with Grove Relay status

Application

  • Security Systems
  • Haelthcare Monitoring
  • Smart Home Automation
  • Elderly Care

Hardware Overview


Getting Started

Installation method and sensing range

Method 1.Side-mounted, it is recommended that the radar installation height be consistent with the chest height of the person being measured, and the module position and chest position ≤ 1.5m

Method 2. Inclined installation. For sleep breathing and heart rate detection needs, an inclined installation method can be adopted. The radar is required to be installed at a height of 1m directly above the head of the bed, tilted downward at 45 ° towards the middle of the bed, and the distance between the radar and the chest cavity is controlled to be within 1.5m. The radar normal direction is aligned with the main detection position to ensure that the radar can detect respiratory and heartbeat data.

note

Please use this module in an open space, and stay out of the following scenarios within the detecting range to prevent interference with the module:

  • Multiple radars installed too close together
  • Wind moves curtains and sways plants
  • Water flow and water film
  • Large areas of metal and mirror reflections
  • Detection through glass and thin wooden boards
  • Installation location prone to vibrations
  • Use of low-quality power supplies

Software Preparation (Arduino)

Attention

By default, the MR60BHA2 comes pre-assembled with the XIAO ESP32C6, but it's compatible with various other microcontrollers for communication and integration.

If this is your first time using Arduino with the XIAO series, follow the appropriate setup guide for your board:

Once your board is set up, proceed with the following steps:

  1. Download the Seeed mmWave Library:

  2. Install the Library in Arduino IDE:

    • Open the Arduino IDE.
    • Navigate to Sketch > Include Library > Add .ZIP Library....
    • Select the downloaded .zip file to install the library.
  3. Connect Your XIAO Board:

    • Plug your XIAO board into your computer via USB.
    • In the Arduino IDE, go to Tools > Board and select your XIAO board model.
    • Choose the correct port under Tools > Port.
  4. Load an Example Sketch:

    • Go to File > Examples > Seeed Arduino mmWave.
    • Select the relevant example for Heartbeat Detection.
    • Review the code and make any necessary adjustments.
  5. Upload the Sketch:

    • Click Upload to flash the code to your XIAO board.
    • Open the Serial Monitor in the Arduino IDE to view real-time sensor data.

Usage

This section provides example code snippets to help you quickly start using the Seeed Arduino mmWave Library with various functionalities, including breath monitoring, RGB LED control, and light sensing.

Breath Module

This example demonstrates how to use the MR60BHA2 sensor for monitoring breathing and heartbeat.

#include <Arduino.h>
#include "Seeed_Arduino_mmWave.h"

// Set up serial communication depending on the board type
#ifdef ESP32
# include <HardwareSerial.h>
HardwareSerial mmWaveSerial(0);
#else
# define mmWaveSerial Serial1
#endif

SEEED_MR60BHA2 mmWave;

void setup() {
Serial.begin(115200);
mmWave.begin(&mmWaveSerial);
}

void loop() {
if (mmWave.update(100)) {
float total_phase, breath_phase, heart_phase;
if (mmWave.getHeartBreathPhases(total_phase, breath_phase, heart_phase)) {
Serial.printf("total_phase: %.2f\t", total_phase);
Serial.printf("breath_phase: %.2f\t", breath_phase);
Serial.printf("heart_phase: %.2f\n", heart_phase);
}

float breath_rate;
if (mmWave.getBreathRate(breath_rate)) {
Serial.printf("breath_rate: %.2f\n", breath_rate);
}

float heart_rate;
if (mmWave.getHeartRate(heart_rate)) {
Serial.printf("heart_rate: %.2f\n", heart_rate);
}

float distance;
if (mmWave.getDistance(distance)) {
Serial.printf("distance: %.2f\n", distance);
}
}
}

The output will be as follows on Arduino Serial Monitor:

If the returned data is not 0, indicate the existence of a living thing inside the detection's range.

This example demonstrates how to control an RGB LED using the NeoPixel library.

  • Step 1. Download the Adafruit_NeoPixel library

Navigate to Sketch > Include Liarbry > Manage Libraries..., and search Adafruit_NeoPixel, install the lastest version.

  • Step 2. Copy following code to a new sketch:
#include <Adafruit_NeoPixel.h>
#include <Arduino.h>

const int pixelPin = D1;

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(1, pixelPin, NEO_GRB + NEO_KHZ800);

void setup() {
Serial.begin(115200);
pixels.begin();
pixels.clear();
pixels.show();
}

void loop() {
for (int i = 0; i < 10; i++) {
pixels.setPixelColor(0, pixels.Color(255, 0, 0));
pixels.show();
delay(100);
pixels.setPixelColor(0, pixels.Color(0, 0, 0));
pixels.show();
delay(100);
}

for (int i = 255; i >= 0; i--) {
pixels.setPixelColor(0, pixels.Color(i, 0, 0));
pixels.show();
delay(10);
}
}
  • Step 3. Select the correct board and port number to upload the program.

Once the program is successfully uploaded, you will see RGB LED on the right side of the mmWave Sensor Modules is blinking.

Light Sensor (BH1750)

This example shows how to read light intensity values using the BH1750 sensor.

  • Step 1. Download the hp_BH1750 library

Navigate to Sketch > Include Liarbry > Manage Libraries..., and search hp_BH1750, install the lastest version.

  • Step 2. Copy following code to a new sketch:
#include <Arduino.h>
#include <hp_BH1750.h>

hp_BH1750 BH1750;

void setup() {
Serial.begin(9600);

bool avail = BH1750.begin(BH1750_TO_GROUND);

if (!avail) {
Serial.println("No BH1750 sensor found!");
while (true) {}
}

Serial.printf("conversion time: %dms\n", BH1750.getMtregTime());
BH1750.start();
}

void loop() {
if (BH1750.hasValue()) {
float lux = BH1750.getLux();
Serial.println(lux);

BH1750.start();
}
}
  • Step 3. Select the correct board and port number to upload the program.

The output will be as follows on Arduino Serial Monitor:

Breath Module API

This example uses the SEEED_MR60BHA2 class to interface with the MR60BHA2 sensor for heart and breath monitoring. Here’s what each key function does:

  • mmWave.begin(&mmWaveSerial):

    • Initializes the sensor for communication using the specified serial interface. It sets up the connection between the XIAO board and the MR60BHA2 sensor.
  • mmWave.update(100):

    • Updates the sensor data. The parameter 100 is a timeout value in milliseconds, specifying how long to wait for the sensor to provide new data. If new data is available within this timeframe, the function returns true.
  • mmWave.getHeartBreathPhases(float &total_phase, float &breath_phase, float &heart_phase):

    • Retrieves the phase information related to heart and breath activities.
    • total_phase represents the overall phase shift, while breath_phase and heart_phase are specific to breathing and heartbeat activities, respectively.
  • mmWave.getBreathRate(float &rate):

    • Fetches the current breath rate detected by the sensor. The rate is returned in the reference variable rate.
  • mmWave.getHeartRate(float &rate):

    • Retrieves the current heart rate detected by the sensor. The rate is returned in the reference variable rate.
  • mmWave.getDistance(float &distance):

    • Gets the distance from the sensor to the detected object (e.g., human body). This function is useful for understanding the range of the detected signal.

Open for Customization

Want to tailor-make the kit to fit your unique applications?

For more information about 3D point cloud data generation and interference zone configuration when customizing mmWave modules. Seeed provides one-stop R&D customization and manufacturing services for fast development from concept to production. Contact us at [email protected] to learn more.

Resources

Tech Support & Product Discussion

Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.

Loading Comments...