MR24HPB1 Human Presence Radar Sensor

View on Amazon
Overview
Code Examples
About MR24HPB1 Human Presence Radar Sensor
The MR24HPB1 is a 24GHz mmWave radar sensor designed for human presence detection. Utilizing FMCW (Frequency Modulated Continuous Wave) technology, it can detect both moving and stationary human targets within a range of up to 6 meters. The sensor provides real-time data on motion speed, distance, and presence intensity, making it suitable for applications such as smart lighting, security systems, and occupancy monitoring. For more information, refer to the official datasheet: MR24HPB1 Datasheet.
MR24HPB1 Specifications
Complete technical specification details for MR24HPB1 Human Presence Radar Sensor
📊 Technical Parameters
MR24HPB1 Pinout
The MR24HPB1 is a 24GHz FMCW radar sensor with 4 pins: 5V power, GND, and UART TX/RX for communication.
Visual Pinout Diagram

Pin Types
Quick Tips
FMCW radar technology,[object Object]
Object],Detects both moving and stationary humans
Object]
Pin Descriptions
| Pin Name | Type | Description | Notes |
|---|---|---|---|
1 5V | Power | Power input (5V DC). Powers the radar chipset and processing circuits. | Requires stable 5V supply capable of handling current spikes. |
2 GND | Power | Ground connection. Common reference for power and UART signals. | Connect to ESP32 GND for shared reference. |
3 TX | UART | UART transmit pin. Sends presence data, motion intensity, and distance to ESP32. | Connect to ESP32 RX pin (e.g., GPIO 16). Often 3.3V tolerant. |
4 RX | UART | UART receive pin. Receives configuration commands from ESP32. | Connect to ESP32 TX pin (e.g., GPIO 17). |
Wiring MR24HPB1 to ESP32
To connect the MR24HPB1 to an ESP32 via UART, connect 5V to power, GND to ground, TX to ESP32 GPIO 16 (RX2), and RX to ESP32 GPIO 17 (TX2).
Visual Wiring Diagram

Connection Status
Protocol
Pin Connections
| MR24HPB1 Pin | Connection | ESP32 Pin | Description |
|---|---|---|---|
1 5V (red) Required | 5V or External Supply | Power supply (5V). Use regulated supply for consistent operation. | |
2 GND (black) Required | GND | Ground connection. Critical for UART and power stability. | |
3 TX (green) Required | GPIO 16 (RX2) | Radar transmits data to ESP32. | |
4 RX (blue) Required | GPIO 17 (TX2) | ESP32 sends configuration commands to radar. |
Object]
UART2 on ESP32 (GPIO 16/17) to avoid conflicts with USB serial
UART logic levels - use level shifter if sensor requires 5V logic
sensor securely - vibrations affect detection
obstructions in detection field of view
Object]
to LD series radar sensors - check LD2410/LD2450 examples
MR24HPB1 Troubleshooting
Common issues and solutions to help you get your sensor working
Common Issues
Issue: The ESP32 receives no data from the sensor.
Ensure correct wiring: verify that TX and RX lines are properly connected, and confirm that the UART baud rate is set to 115200 bps. Also, ensure that the sensor is powered with a stable 5V supply.
Issue: The sensor does not detect presence even when someone is in range.
Check the sensor's field of view and ensure there are no obstructions. Verify that the sensor's configuration parameters are set correctly for the desired detection range and sensitivity.
Issue: Sensor intermittently detects presence or fails to maintain detection.
Ensure that the sensor is securely mounted and not subject to vibrations. Check for sources of interference in the environment that may affect radar performance.
Issue: UART component in ESPHome reports failure to initialize.
Verify that the UART pins specified in the configuration match the physical connections. Ensure that no other devices are using the same UART bus, and that the baud rate is correctly set to 115200 bps.
Debugging Tips
Use the Serial Monitor to check for error messages and verify the sensor's output. Add debug prints in your code to track the sensor's state.
Use a multimeter to verify voltage levels and check for continuity in your connections. Ensure the power supply is stable and within the sensor's requirements.
Additional Resources
MR24HPB1 Programming Examples
Ready-to-use code examples for different platforms and frameworks
#include <Arduino.h>
#include "mr24fdb1.h"
MR24FDB1 radar;
void setup() {
Serial.begin(115200); // Debug output
Serial1.begin(115200); // UART for MR24HPB1
radar.begin(&Serial1);
}
void loop() {
if (radar.read()) {
Serial.print("Presence: ");
Serial.println(radar.presence() ? "YES" : "NO");
Serial.print("Motion: ");
Serial.println(radar.motion());
Serial.print("Distance: ");
Serial.println(radar.distance());
}
delay(250);
}This Arduino example uses the MR24FDB1 library to communicate with the MR24HPB1 radar sensor over UART. The sensor is initialized on Serial1 (GPIO16/17 on ESP32), with a baud rate of 115200. The loop() function reads presence status, motion intensity, and distance, and prints the values to the serial monitor. The library simplifies communication and parsing of radar output. You can find the library and more information at github.com/limengdu/Seeed-Studio-MR24FDB1-Sensor.
uart:
id: uart_bus
tx_pin: GPIO17
rx_pin: GPIO16
baud_rate: 115200
parity: NONE
stop_bits: 1
seeed_mr24hpb1:
id: my_mr24hpb1
binary_sensor:
- platform: seeed_mr24hpb1
has_target:
name: "Presence Detected"
sensor:
- platform: seeed_mr24hpb1
custom_presence_of_detection:
name: "Static Distance"
movement_signs:
name: "Body Movement Parameter"
custom_motion_distance:
name: "Motion Distance"
custom_spatial_static_value:
name: "Existence Energy"
custom_spatial_motion_value:
name: "Motion Energy"
custom_motion_speed:
name: "Motion Speed"
custom_mode_num:
name: "Mode Number"This ESPHome configuration sets up the MR24HPB1 sensor using the seeed_mr24hpb1 platform. The UART interface is configured with a baud rate of 115200, no parity, and 1 stop bit. The binary_sensor detects presence, while the sensor entries provide detailed information on static distance, body movement, motion distance, existence energy, motion energy, motion speed, and mode number. Ensure that the UART pins are correctly connected and that the sensor is powered with a stable 5V supply.
Wrapping Up MR24HPB1
The ESP32 MR24HPB1 Human Presence Radar Sensor is a powerful Human Presence sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.
Best Practices
For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.
Safety First
Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.
Ready to Start Building?
Now that you have all the information you need, it's time to integrate the MR24HPB1 into your ESP32 project and bring your ideas to life!




