ESP32 MR24HPC1 Human Static Presence Radar Sensor
Overview
The MR24HPC1 is a high-sensitivity 24GHz radar sensor capable of detecting human presence and motion. It communicates via UART and is ideal for smart home and security applications.
Choose Your Platform
About MR24HPC1 Human Static Presence Radar Sensor
The MR24HPC1 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 5 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: MR24HPC1 Datasheet.
Technical Specifications
Pinout Configuration
The VCC
pin is used to supply power to the sensor, and it typically requires 3.3V or 5V (refer to the datasheet for specific voltage requirements). The GND
pin is the ground connection and must be connected to the ground of your ESP32.
The MR24HPC1 is a 24GHz mmWave radar sensor module developed by Seeed Studio for human presence detection. It supports UART communication and operates at 5V logic. The following pins are exposed on the module:
5V
– Power supply input. Connect to a regulated 5V DC source. This pin powers the radar chipset and MCU. Supplying stable voltage is essential to maintain consistent performance.GND
– Ground reference. Connect this pin to the system ground shared with the ESP32 or host MCU. Proper grounding helps ensure signal integrity and avoids voltage offset errors.TX
– UART transmit line. Outputs sensor data (e.g., motion speed, presence strength) to the microcontroller. Connect this to the RX pin on the ESP32 (e.g., GPIO16).RX
– UART receive line. Receives configuration commands or requests from the ESP32. Connect this to TX on the ESP32 (e.g., GPIO17).
Note: The MR24HPC1 operates with 5V logic levels. While most ESP32 boards tolerate 5V inputs on UART RX, verify your board's specifications or use a level shifter to protect 3.3V-only inputs.
Wiring with ESP32
To interface the MR24HPC1 radar module with an ESP32 via UART, use the following wiring scheme. This enables real-time communication of motion and presence data:
5V
(red wire) → 5V on ESP32 or a separate regulated power source capable of supplying the sensor's current requirements (typically ~80mA).GND
(black wire) → GND on ESP32. Always connect grounds between sensor and microcontroller to prevent data corruption or unpredictable behavior.TX
(green wire) → GPIO16 (RX on ESP32). Allows the ESP32 to receive data packets from the sensor.RX
(blue wire) → GPIO17 (TX on ESP32). Enables the ESP32 to send optional setup commands to the radar module.
Configuration Tip: Set the UART baud rate to 115200
with 8 data bits, no parity, and 1 stop bit. Confirm your ESP32 firmware uses UART2 or an available hardware serial port. For initial testing, connect the sensor’s TX to a USB-to-Serial adapter and verify output using a serial terminal.
Troubleshooting Guide
Common Issues
🚫 No Data Received
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.
❌ Presence Not Detected
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.
⚠️ Intermittent Detection
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.
🔌 UART Initialization Fails
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
🔍 Serial Monitor
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.
⚡ Voltage Checks
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
Code Examples
ESPHome Example
uart:
id: uart_bus
tx_pin: GPIO17
rx_pin: GPIO16
baud_rate: 115200
parity: NONE
stop_bits: 1
seeed_mr24hpc1:
id: my_mr24hpc1
binary_sensor:
- platform: seeed_mr24hpc1
has_target:
name: "Presence Detected"
sensor:
- platform: seeed_mr24hpc1
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 MR24HPC1 sensor using the seeed_mr24hpc1
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.
PlatformIO Example
platformio.ini
[env:mr24hpc1]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
lib_deps = optionallion411/Seed_24GHZ_HumanStaticLite@^1.0.0
PlatformIO Example Code
#include <Arduino.h>
#include <humanstaticLite.h>
HumanStaticLite radar(&Serial1);
void setup() {
Serial.begin(115200);
Serial1.begin(115200);
radar.checkSetMode_func(open_buff, 10, false);
}
void loop() {
radar.recvRadarBytes();
radar.showData();
delay(150);
}
This PlatformIO configuration sets up an ESP32 development board to interface with the MR24HPC1 radar sensor using the Seed_24GHZ_HumanStaticLite library. The platformio.ini
specifies the necessary platform, board, framework, monitor speed, and library dependencies. The Arduino sketch initializes the Serial and Serial1 interfaces at 115200 baud, which is required for communication with the MR24HPC1 sensor. The HumanStaticLite
object is instantiated with Serial1
to handle UART communication. In the setup()
function, the sensor is configured by sending an 'open' command to enable underlying messages. The loop()
function continuously reads data from the sensor and displays it via the serial monitor. A delay of 150 milliseconds is included to prevent data congestion. For more detailed information and additional functionalities, refer to the library documentation: Seed_24GHZ_HumanStaticLite.
Conclusion
The ESP32 MR24HPC1 Human Static 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.
For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.
Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.