🏠 Better Thermostat
Combine presence with intelligent heating control.
LD2410 is a mmWave radar sensor that can detect human presence - even when you’re sitting completely still. Perfect for bathroom, office or other rooms where PIR sensors fail.
| Feature | PIR Sensor | mmWave (LD2410) |
|---|---|---|
| Movement | ✅ Yes | ✅ Yes |
| Stationary person | ❌ No | ✅ Yes (detects breathing) |
| Through glass/plastic | ❌ No | ✅ Yes |
| Distance measurement | ❌ No | ✅ Yes |
| False positives | Many | Few (with tuning) |
| Price | ~$3 | ~$7 |
| Component | Model | Price |
|---|---|---|
| mmWave sensor | HiLink LD2410C (recommended) | $5-8 |
| Microcontroller | ESP32 or ESP8266 (D1 Mini) | $4-7 |
| Wires | Dupont jumper wires | $2 |
| USB cable | Micro USB for power | $3 |
| Enclosure | 3D printed or bought | $0-7 |
| Total | ~$15-30 |
| Model | Pins | Bluetooth | Recommendation |
|---|---|---|---|
| LD2410 | 1.25mm (needs adapter) | No | ⚠️ Hard to solder |
| LD2410B | 1.25mm (needs adapter) | Yes | ⚠️ Hard to solder |
| LD2410C | 2.54mm standard | Yes | ✅ Recommended |
D1 Mini LD2410C─────── ───────3.3V ─────── VCCGND ─────── GNDD7 (RX) ─────── TXD8 (TX) ─────── RXsubstitutions: device_name: "ld2410-bathroom" friendly_name: "Bathroom Presence"
esphome: name: ${device_name} friendly_name: ${friendly_name}
esp32: board: esp32dev
wifi: ssid: !secret wifi_ssid password: !secret wifi_password
logger: baud_rate: 0 # Important! Disable serial logging
api: encryption: key: !secret api_encryption_key
ota: platform: esphome password: !secret ota_password
# UART for LD2410uart: id: ld2410_uart tx_pin: GPIO17 rx_pin: GPIO16 baud_rate: 256000 parity: NONE stop_bits: 1
# LD2410 sensorld2410: id: ld2410_sensor uart_id: ld2410_uartbinary_sensor: - platform: ld2410 has_target: name: "${friendly_name} Presence" device_class: occupancy
has_moving_target: name: "${friendly_name} Movement" device_class: motion
has_still_target: name: "${friendly_name} Stationary" device_class: occupancysensor: - platform: ld2410 moving_distance: name: "${friendly_name} Moving Distance" unit_of_measurement: "cm"
still_distance: name: "${friendly_name} Still Distance" unit_of_measurement: "cm"
detection_distance: name: "${friendly_name} Detection Distance" unit_of_measurement: "cm"
moving_energy: name: "${friendly_name} Moving Energy"
still_energy: name: "${friendly_name} Still Energy"Here’s the complete configuration ready to copy-paste:
substitutions: device_name: "bathroom-presence" friendly_name: "Bathroom"
esphome: name: ${device_name} friendly_name: ${friendly_name}
esp32: board: esp32dev
wifi: ssid: !secret wifi_ssid password: !secret wifi_password
ap: ssid: "${device_name}-AP" password: "12345678"
captive_portal:
logger: baud_rate: 0
api: encryption: key: !secret api_encryption_key
ota: platform: esphome password: !secret ota_password
uart: id: ld2410_uart tx_pin: GPIO17 rx_pin: GPIO16 baud_rate: 256000 parity: NONE stop_bits: 1
ld2410: id: ld2410_sensor uart_id: ld2410_uart timeout: 5s max_move_distance: 3m max_still_distance: 2.25m
binary_sensor: - platform: ld2410 has_target: name: "${friendly_name} Presence" device_class: occupancy has_moving_target: name: "${friendly_name} Movement" device_class: motion has_still_target: name: "${friendly_name} Stationary" device_class: occupancy
sensor: - platform: ld2410 detection_distance: name: "${friendly_name} Distance" moving_energy: name: "${friendly_name} Moving Energy" internal: true still_energy: name: "${friendly_name} Still Energy" internal: true
- platform: wifi_signal name: "${friendly_name} WiFi Signal" update_interval: 60s
switch: - platform: ld2410 engineering_mode: name: "${friendly_name} Engineering Mode" internal: true
button: - platform: restart name: "${friendly_name} Restart"Rule of thumb:
automation: - alias: "Bathroom light ON on presence" trigger: - platform: state entity_id: binary_sensor.bathroom_presence to: "on" action: - service: light.turn_on target: entity_id: light.bathroom
- alias: "Bathroom light OFF when empty" trigger: - platform: state entity_id: binary_sensor.bathroom_presence to: "off" for: seconds: 30 action: - service: light.turn_off target: entity_id: light.bathroom| Placement | Recommendation |
|---|---|
| Height | 1.5-2m above floor |
| Angle | Point downward 15-30° |
| Avoid | Directly at windows/doors |
| Range | Max 6m effective range |
🏠 Better Thermostat
Combine presence with intelligent heating control.
⚡ Automations
Create more automations based on presence.