Hi everybody
Please can you share your code for the LD2420 ( not LD2410) human presense sensor.
I got my LD2410 working but unable to get my LD2420 working .
Thanks
2 Likes
Have you got yours working yet?
I am currently working on mine (LD2420).
I finally got it to communicate, found that the pins the manual said needs to be used were wrong so Iām using GND, VCC, OT1 and RX. (manual said to use OT2 rather than OT1)
Anyway as for the Yaml,
uart:
id: ld2420_uart
tx_pin: GPIO4
rx_pin: GPIO5
baud_rate: 115200
parity: NONE
stop_bits: 1
# The LD2420 has 16 sense gates 0-15 and each gate detects 0.7 meters 15th gate = 9m
ld2420:
text_sensor:
- platform: ld2420
fw_version:
name: LD2420 Firmware
sensor:
- platform: ld2420
moving_distance:
name : Moving Distance
binary_sensor:
- platform: ld2420
has_target:
name: Presence
switch:
- platform: restart
name: Restart ESPHome Node
select:
- platform: ld2420
operating_mode:
name: Operating Mode
number:
- platform: ld2420
presence_timeout:
name: Detection Presence Timeout # How long before the sensor is set to cleared after last detection
min_gate_distance:
name: Detection Gate Minimum
max_gate_distance:
name: Detection Gate Maximum
gate_move_sensitivity:
name: Calibration Move Sensitivity Factor
gate_still_sensitivity:
name: Calibration Still Sensitivity Factor
gate_0: # 0-0.7m
move_threshold:
name: Gate 0 Move Threshold
still_threshold:
name: Gate 0 Still Threshold
gate_1: #0.7-1.4m
move_threshold:
name: Gate 1 Move Threshold
still_threshold:
name: Gate 1 Still Threshold
gate_2: #1.4-2.1m
move_threshold:
name: Gate 2 Move Threshold
still_threshold:
name: Gate 2 Still Threshold
gate_3: #2.1-2.8m
move_threshold:
name: Gate 3 Move Threshold
still_threshold:
name: Gate 3 Still Threshold
gate_4: #2.8-3.5m
move_threshold:
name: Gate 4 Move Threshold
still_threshold:
name: Gate 4 Still Threshold
gate_5: #3.5-4.2m
move_threshold:
name: Gate 5 Move Threshold
still_threshold:
name: Gate 5 Still Threshold
gate_6: #4.2-4.9m
move_threshold:
name: Gate 6 Move Threshold
still_threshold:
name: Gate 6 Still Threshold
gate_7: #4.9-5.6m
move_threshold:
name: Gate 7 Move Threshold
still_threshold:
name: Gate 7 Still Threshold
gate_8: #5.6-6.3m
move_threshold:
name: Gate 8 Move Threshold
still_threshold:
name: Gate 8 Still Threshold
gate_9: #6.3-7.0m
move_threshold:
name: Gate 9 Move Threshold
still_threshold:
name: Gate 9 Still Threshold
gate_10: #7.0-7.7m
move_threshold:
name: Gate 10 Move Threshold
still_threshold:
name: Gate 10 Still Threshold
gate_11: #7.7-8.4m
move_threshold:
name: Gate 11 Move Threshold
still_threshold:
name: Gate 11 Still Threshold
gate_12: #8.4-9.1m
move_threshold:
name: Gate 12 Move Threshold
still_threshold:
name: Gate 12 Still Threshold
gate_13: #9.1-9.8m
move_threshold:
name: Gate 13 Move Threshold
still_threshold:
name: Gate 13 Still Threshold
gate_14: #9.8-10.5m
move_threshold:
name: Gate 14 Move Threshold
still_threshold:
name: Gate 14 Still Threshold
gate_15: #10.5-11.2m
move_threshold:
name: Gate 15 Move Threshold
still_threshold:
name: Gate 15 Still Threshold
button:
- platform: ld2420
apply_config:
name: Apply Config # applies configuration (used to set calibrated values)
factory_reset:
name: Factory Reset # As the name says
restart_module:
name: Restart Module # as the name says
revert_config:
name: Abort Edits
Yes got it working. Using pins 16 and 17 instead of tx and rx.
uart:
id: ld2420_uart
tx_pin: GPIO17
rx_pin: GPIO16
baud_rate: 115200
parity: NONE
stop_bits: 1