keepcalculator

06 Numbers and Powers

Radar Sensor ESP32 Weather Display Wake on Approach

Card No. 06·8497 · Updated · Standard formula, shown below

Yes, a radar sensor can turn an ESP32 into a weather display that wakes when you walk up. You connect a small radar module (like the HLK-LD2410 or RCWL-0516) to the ESP32’s GPIO pins, use the radar’s presence output as a wake-up trigger, and have the ESP32 wake from deep sleep to refresh the display only when someone is nearby. This saves power and extends the life of the display.

Why Use a Radar Sensor Instead of PIR or Ultrasonic?

Radar sensors detect motion and presence using microwave Doppler or FMCW (Frequency-Modulated Continuous Wave) technology. Unlike PIR (passive infrared) sensors, which rely on heat changes and fail to detect stationary people, radar can sense even slight movements like breathing. Ultrasonic sensors are also an option but require a clear line-of-sight and can be affected by temperature and air currents. Radar works through thin plastic or glass, is not affected by ambient light, and can be tuned to ignore small pets or distant movement, making it ideal for a weather display that should wake when you approach but not when a cat walks by.

How the Wake-on-Approach Setup Works

The ESP32 has a deep sleep mode that draws only a few microamps. To wake it, you can use the ESP32’s ULP (Ultra-Low-Power) coprocessor or connect the radar’s output to an RTC GPIO pin that supports external wake-up. The typical flow is:

  • The ESP32 is in deep sleep, with the display off.
  • The radar module stays powered (it draws ~30-40 mA for LD2410, ~3 mA for RCWL-0516).
  • When the radar detects a person, its output pin goes HIGH (or sends a serial command).
  • The ESP32 wakes from deep sleep, boots, fetches weather data over Wi-Fi, and updates the display.
  • After a set timeout (e.g., 30 seconds of no presence), the ESP32 returns to deep sleep.

For the HLK-LD2410, you can use its UART output to configure detection distance and sensitivity, and its GPIO output for a simple presence signal. For the RCWL-0516, the OUT pin goes HIGH for about 2 seconds when motion is detected, but it does not provide continuous presence detection.

Choosing the Right Radar Module

There are several radar modules that work with ESP32, each with trade-offs:

  • HLK-LD2410: FMCW radar, supports presence detection (not just motion), adjustable range up to 6 meters, UART interface for configuration. More expensive but most reliable for this use case.
  • RCWL-0516: Cheap Doppler radar, detects motion only, output stays HIGH for ~2 seconds. Simple to use, but cannot detect a stationary person.
  • Seeed MR60FDA1: mmWave radar with presence detection and fall detection, but more complex to integrate and higher power draw.

For a weather display that wakes when you walk up, the HLK-LD2410 is the best choice because it can detect a person standing still, which is exactly what you want when you stop to read the display.

Power Consumption and Battery Life Considerations

If you plan to run the display on batteries, the radar sensor’s idle current becomes critical. The RCWL-0516 draws about 3 mA, which is acceptable. The HLK-LD2410 draws around 30-40 mA, which is too high for a coin cell but fine for a LiPo battery or USB power. In deep sleep, the ESP32 itself draws about 10 µA, but the radar keeps drawing its idle current. So the total sleep current is roughly the radar’s idle current. With a 2000 mAh battery and a 3 mA radar, you could get about 28 days of standby time (2000 mAh / 3 mA ≈ 666 hours). If you use the LD2410, expect about 2-3 days. To extend battery life, you could power the radar only when needed using a MOSFET, but that adds complexity.

Common Problems and How to Fix Them

Here are typical issues you might encounter:

  • ESP32 does not wake up: Make sure the radar’s output pin is connected to an RTC GPIO (e.g., GPIO 14, 25, 26, 34, 35, 36, 39). Use esp_sleep_enable_ext0_wakeup() for a simple HIGH/LOW trigger, or esp_sleep_enable_ext1_wakeup() for multiple pins.
  • False wakes from pets or noise: Adjust the LD2410’s sensitivity and distance thresholds via UART commands. For RCWL-0516, you can increase the detection range by adding a resistor, but it is harder to filter.
  • Display stays on too long: Implement a timeout in your code that checks the radar’s presence pin every second and goes back to sleep after, say, 30 seconds of no presence.
  • Wi-Fi connection fails on wake: The ESP32 may need a few seconds to reconnect. Use a fast connection and cache the last known weather data so the display shows something even if Wi-Fi is unavailable.

Example Code Structure

Here is a minimal outline of the Arduino code (not complete, but shows the logic):

#include <WiFi.h>
#include <esp_sleep.h>

#define RADAR_PIN 14

void setup() {
  pinMode(RADAR_PIN, INPUT);
  // Fetch weather data, update display
  // Then go back to sleep
  esp_sleep_enable_ext0_wakeup(RADAR_PIN, 1);  // wake on HIGH
  esp_deep_sleep_start();
}

In practice, you would also set a timer to wake periodically to update the weather even if no one is near, and you would debounce the radar signal to avoid flickering.

Frequently Asked Questions

Can I use a PIR sensor instead of radar?

Yes, PIR sensors are cheaper and simpler, but they only detect motion, not presence. If you stand still in front of the display, the PIR will not detect you after a few seconds, and the display might go back to sleep. Radar solves this problem.

Does the radar sensor work through a plastic case?

Yes, radar waves can penetrate thin plastic, wood, and glass. The HLK-LD2410 is often used behind plastic enclosures. Just avoid metal enclosures, which block the signal.

How far away can the radar detect me?

The HLK-LD2410 can be configured to detect presence up to 6 meters, while the RCWL-0516 detects motion up to about 5-7 meters. The actual range depends on the antenna orientation and the sensitivity settings.

Will the radar interfere with Wi-Fi or other electronics?

The HLK-LD2410 operates at 24 GHz, which is far from the 2.4 GHz Wi-Fi band, so interference is unlikely. The RCWL-0516 operates at 3.18 GHz, which is also separate from Wi-Fi. In practice, no significant interference is reported.

Can I use the ESP32’s built-in hall sensor to detect approach?

No, the hall sensor detects magnetic fields, not motion. It would not work for this purpose.

What if I want the display to show weather even when nobody is around?

You can set a periodic wake-up timer (e.g., every 10 minutes) to update the display, but keep the display off. The radar wake-up is just for turning on the backlight or showing the display when someone is present.

Alternatives to Radar for Wake-on-Approach

If you do not want to use radar, you have a few other options:

  • PIR sensor: Cheapest, but only detects motion, not presence.
  • Time-of-flight (ToF) sensor (e.g., VL53L0X): Measures distance precisely, can detect a person within a few meters, but requires line-of-sight and has a narrow field of view.
  • Camera with person detection: Power-hungry and complex, not recommended for a simple wake-up trigger.
  • Capacitive touch sensor: Only works if the person touches the device, not for approaching.

Radar is the best balance of reliability, power, and cost for this specific use case.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →