After building a radar with esp32-c3 and ld2410b, we feel the power of esphome and the fun of creating the sensor by ourselves.
Through a series of selection, we chose wemos s2 mini to build a s2-based radar. Wemos created the famous d1 mini series. After our tests, the overall effect is quite good. The wifi signal will be much better than d1-mini.
As with the challenges encountered on esp32-c3, the main problem comes from the fact that esphome will have some restrictions on the support of these new esp32 series chips, mainly if they do not use serial chips. If you want to keep the serial port log and use the serial port to communicate with the radar module ld2410b(c) series, some additional tricks will be required.
Fortunately, the latest kernel of arduino solves this problem, but there is still a little problem with the uart library from esphome.
Similarly, we were lucky enough to read the daylight sensor of ld2410c, which is not very sensitive to night light, which is a bit of a pity.
It took a lot of effort to design a shell for it. csz used a wonderful way to combine the shell together. With the help of a friend (XiangYang) who owns a professional 3D printer, we got this very lightweight The case, it’s thick and doesn’t use too many screws.
Of course, for those who want to get started and get it quickly, we are also ready to share it with friends all over the world.
Hello,
I was trying to test your ESPHome code but I’ve several errors as probably you included customized library (screek-mod-components) that are missing…
How can I fix this?
I am very sorry, I have not used d1 mini, I used nodemcu a long time ago, it is esp8266 chip, but because the signal becomes very weak after crossing the wall, I did not use it later.
Because the core of this code uses mainly an official ld2410c library, contributed by esphome enthusiasts, and we made minor adjustments on it. So I guess, yes, you can work just as well with it. Or you can use our modified library, if you need to read that light.
The official library also has a bug, it’s probably designed mainly for modules without Bluetooth, and there’s a probability that every time you restart the esp it will rewrite the default parameter configuration. This is something we have optimized in our modified library as well.
Hi
I’m a newbie to ESPHome and MCU…
How should I go about to get the LD2410C to work with my ESP32 WROOM 32D…?
I’d love to get over this initial “wtf”-code-construct part, so all help oss greatly appreciated!
You can start with our code as a reference, then specify the part of the development board you use, and modify some pins, and start this step by step.
It’s a fun but tedious process.
You can’t use light in the sensor. Does it work for you?
sensor.ld2410: [source /config/esphome/human-presenter-west.yaml:88]
platform: ld2410
moving_distance:
name: Moving Distance
id: moving_distance
still_distance:
name: Still Distance
id: still_distance
moving_energy:
name: Move Energy
still_energy:
name: Still Energy
detection_distance:
name: Detection Distance
[light] is an invalid option for [sensor.ld2410]. Please check the indentation.
light:
name: Sun Light
Hi All, I didn’t have great success myself, so kindof mashed a lot of bits together from this and other posts, to make something work. No credit to me, all credit goes to other posters that I read from (apoloigies that I can’t specify everyone here)
My take on this is a combo device, with the mmwave sensor, as well as a PIR sensor, and a combined temperature/humidity sensor bundled in for good measure You can easily hash out the bits you do not need of course
This is based on the ESPhome and Home assistant versions as of 30/04/2023
Hope this helps anyone else out there who was struggling too!
infos:
ESPhome installed onto generic D1mini clone.
PIR sensor is AM312, power take off at 3.3v from D1 mini, and output pin goes to D6
mmwave sensor is LD2410C, power take off at 5v from D1 mini, output goes to D5, TX to RX between module and D1 mini.
temp/humid sensor is AHT10, power take off at 3.3v from D1 mini, SCL goes to D1, SDA goes to D2
WS2812B LED power take off at 5v from D1 mini, input comes from D7
---
esphome:
name: pd01
friendly_name: Presence Detector
platform: ESP8266
board: d1_mini
# Enable logging
logger:
level: WARN
baud_rate: 0
# Enable Home Assistant API
api:
encryption:
key: "some_secret_key_thing"
ota:
password: "some_secret_password_thing"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 10.10.10.2
gateway: 10.10.10.1
subnet: 255.255.255.0
uart:
#id: uart1
tx_pin: TX
rx_pin: RX
baud_rate: 256000
parity: NONE
stop_bits: 1
i2c:
sda: D2
scl: D1
scan: true
id: bus_a
ld2410:
timeout: 150s
max_move_distance : 6m
max_still_distance: 0.75m
g0_move_threshold: 10
g0_still_threshold: 20
g1_move_threshold: 10
g1_still_threshold: 20
g2_move_threshold: 20
g2_still_threshold: 21
g3_move_threshold: 30
g3_still_threshold: 31
g4_move_threshold: 40
g4_still_threshold: 41
g5_move_threshold: 50
g5_still_threshold: 51
g6_move_threshold: 60
g6_still_threshold: 61
g7_move_threshold: 70
g7_still_threshold: 71
g8_move_threshold: 80
g8_still_threshold: 81
status_led:
pin:
number: GPIO2 #ESP8266 OnBroad LED
inverted: false
binary_sensor:
- platform: gpio
pin: D6
name: "PIR Motion"
device_class: motion
- platform: ld2410
has_target:
name: Presence
has_moving_target:
name: Moving Target
has_still_target:
name: Still Target
- platform: gpio
pin: D5
name: "Sejour occupancy"
id: sejour_occupancy
device_class: occupancy
on_press:
then:
- light.turn_on:
id: led_presence_sejour
brightness: 25%
red: 100%
green: 0%
blue: 0%
on_release:
then:
- light.turn_on:
id: led_presence_sejour
brightness: 25%
red: 0%
green: 100%
blue: 0%
sensor:
- platform: ld2410
moving_distance:
name : Moving Distance
still_distance:
name: Still Distance
moving_energy:
name: Move Energy
still_energy:
name: Still Energy
detection_distance:
name: Detection Distance
- platform: aht10
i2c_id: bus_a
address: 0x38
temperature:
name: "PD01 Temperature"
humidity:
name: "PD01 Humidity"
update_interval: 60s
light:
- platform: neopixelbus
type: GRB
variant: WS2812x
pin: D7
num_leds: 1
name: "Led Presence Sejour"
id: led_presence_sejour
effects:
- strobe:
- addressable_rainbow:
- addressable_scan:
- addressable_twinkle:
- addressable_random_twinkle:
- addressable_fireworks:
- addressable_flicker:
I have my sensors on a different LAN subnet, which is why I have a static IP address assigned. This is not needed if you are running ESPhome on the same subnet as your devices
You can use our modified version of the library, or you can use the official ld2410 library the original author submitted a pull that includes this functionality.
The current esphome integrated ld2410 library does not have a light component, which can be removed directly from this sensor.
Also support for this feature requires ensuring that the ld2410c firmware is at version 2.0 or higher.