You thought about it, do IT !

ESPHome MultiSensor – Firmware, final components choice, and wiring

ESPHome MultiSensor – Firmware, final components choice, and wiring

End of the project, with all the details needed to do your own device

Final electronic components used :

  • LD2410C –> Get it Here
  • BH1750 –> Get it Here
  • AHT20 –> Get it Here
  • Wemos D1 mini –> Get it Here
  • 2 x Fog RGB Led Module 10mm –> Get it Here
  • Dupont wires 10cm FF –> Get it Here
  • USB-C wire –> Get it Here
  • USB-C power supply –> Here

Cable schematics :

Minimal code (You can use HLKRadarTool for settings) :

i2c:
  sda: D2
  scl: D1
  scan: False

uart:
  id: ld2410_uart
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

 
ld2410:
  uart_id: ld2410_uart
  throttle: 1500ms
  id: ld2410_comp

sensor:
  - platform: ld2410
    moving_distance:
      name: "LD2410 Moving distance (cm)"
    still_distance:
      name: "LD2410 Still Distance (cm)"
    moving_energy:
      name: "LD2410 Move Energy (%)"
    still_energy:
      name: "LD2410 Still Energy (%)"
    detection_distance:
      name: "LD2410 Distance Detection (cm)"
    
  - platform: bh1750
    name: "BH1750 Illuminance"
    address: 0x23
    update_interval: 30s

  - platform: aht10
    id: aht10_sensor
    variant: AHT20
    update_interval: 60s
    temperature:
      name: "AHT10 Temperature"
      id: aht10_temp
    humidity:
      name: "AHT10 Humidity"
      id: aht10_humi
 
binary_sensor:
 
  - platform: ld2410
    has_target:
      name: LD2410 Presence
    has_moving_target:
      name: LD2410 Moving Target
    has_still_target:
      name: LD2410 Still Target
 
output:
  - platform: esp8266_pwm
    id: RGB_Led_Red
    pin: D5
  - platform: esp8266_pwm
    id: RGB_Led_Green
    pin: D6
  - platform: esp8266_pwm
    id: RGB_Led_Blue
    pin: D7
  - platform: esp8266_pwm
    id: RGB_Led_Red_2
    pin: D4
  - platform: esp8266_pwm
    id: RGB_Led_Green_2
    pin: D0
  - platform: esp8266_pwm
    id: RGB_Led_Blue_2
    pin: D3
    
light:
  - platform: rgb
    name: "LED RGB"
    red: RGB_Led_Red
    green: RGB_Led_Green
    blue: RGB_Led_Blue
  - platform: rgb
    name: "LED RGB 2"
    red: RGB_Led_Red_2
    green: RGB_Led_Green_2
    blue: RGB_Led_Blue_2

Other code with LD2410 settings :

i2c:
  sda: D2
  scl: D1
  scan: False

uart:
  id: ld2410_uart
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

 
ld2410:
  uart_id: ld2410_uart
  throttle: 1500ms
  id: ld2410_comp

select:
  - platform: ld2410
    distance_resolution:
      name: distance resolution
    baud_rate:
      name: baud rate
    light_function:
      name: light function
    out_pin_level:
      name: out pin level
 
button:
  - platform: ld2410
    factory_reset:
      name: "factory reset"
    restart:
      name: "restart"
    query_params:
      name: query params
 
number:
  - platform: ld2410
    timeout:
      name: timeout
    max_move_distance_gate:
      name: max move distance gate
    max_still_distance_gate:
      name: max still distance gate
    g0:
      move_threshold:
        name: g0 move threshold
      still_threshold:
        name: g0 still threshold
    g1:
      move_threshold:
        name: g1 move threshold
      still_threshold:
        name: g1 still threshold
    g2:
      move_threshold:
        name: g2 move threshold
      still_threshold:
        name: g2 still threshold
    g3:
      move_threshold:
        name: g3 move threshold
      still_threshold:
        name: g3 still threshold
    g4:
      move_threshold:
        name: g4 move threshold
      still_threshold:
        name: g4 still threshold
    g5:
      move_threshold:
        name: g5 move threshold
      still_threshold:
        name: g5 still threshold
    g6:
      move_threshold:
        name: g6 move threshold
      still_threshold:
        name: g6 still threshold
    g7:
      move_threshold:
        name: g7 move threshold
      still_threshold:
        name: g7 still threshold
    g8:
      move_threshold:
        name: g8 move threshold
      still_threshold:
        name: g8 still threshold
    light_threshold:
      name: light threshold
  
text_sensor:
  - platform: ld2410
    version:
      name: "LD2410 presence sensor version"
    mac_address:
      name: "LD2410 presence sensor mac address"
 
switch:
  - platform: ld2410
    engineering_mode:
      name: "LD2410 engineering mode"
    bluetooth:
      name: LD2410 control Bluetooth
 
sensor:
  - platform: ld2410
    moving_distance:
      name: "LD2410 Moving distance (cm)"
    still_distance:
      name: "LD2410 Still Distance (cm)"
    moving_energy:
      name: "LD2410 Move Energy (%)"
    still_energy:
      name: "LD2410 Still Energy (%)"
    detection_distance:
      name: "LD2410 Distance Detection (cm)"
    g0:
      move_energy:
        name: LD2410 g0 move energy
      still_energy:
        name: LD2410 g0 still energy
    g1:
      move_energy:
        name: LD2410 g1 move energy
      still_energy:
        name: LD2410 g1 still energy
    g2:
      move_energy:
        name: LD2410 g2 move energy
      still_energy:
        name: LD2410 g2 still energy
    g3:
      move_energy:
        name: LD2410 g3 move energy
      still_energy:
        name: LD2410 g3 still energy
    g4:
      move_energy:
        name: LD2410 g4 move energy
      still_energy:
        name: LD2410 g4 still energy
    g5:
      move_energy:
        name: LD2410 g5 move energy
      still_energy:
        name: LD2410 g5 still energy
    g6:
      move_energy:
        name: LD2410 g6 move energy
      still_energy:
        name: LD2410 g6 still energy
    g7:
      move_energy:
        name: LD2410 g7 move energy
      still_energy:
        name: LD2410 g7 still energy
    g8:
      move_energy:
        name: LD2410 g8 move energy
      still_energy:
        name: LD2410 g8 still energy
    light:
      name: LD2410 light
 
  - platform: bh1750
    name: "BH1750 Illuminance"
    address: 0x23
    update_interval: 30s

  - platform: aht10
    id: aht10_sensor
    variant: AHT20
    update_interval: 60s
    temperature:
      name: "AHT10 Temperature"
      id: aht10_temp
    humidity:
      name: "AHT10 Humidity"
      id: aht10_humi
 
binary_sensor:
 
  - platform: ld2410
    has_target:
      name: LD2410 Presence
    has_moving_target:
      name: LD2410 Moving Target
    has_still_target:
      name: LD2410 Still Target

output:
  - platform: esp8266_pwm
    id: RGB_Led_Red
    pin: D5
  - platform: esp8266_pwm
    id: RGB_Led_Green
    pin: D6
  - platform: esp8266_pwm
    id: RGB_Led_Blue
    pin: D7
  - platform: esp8266_pwm
    id: RGB_Led_Red_2
    pin: D4
  - platform: esp8266_pwm
    id: RGB_Led_Green_2
    pin: D0
  - platform: esp8266_pwm
    id: RGB_Led_Blue_2
    pin: D3
    
light:
  - platform: rgb
    name: "LED RGB"
    red: RGB_Led_Red
    green: RGB_Led_Green
    blue: RGB_Led_Blue
  - platform: rgb
    name: "LED RGB 2"
    red: RGB_Led_Red_2
    green: RGB_Led_Green_2
    blue: RGB_Led_Blue_2

Result in home assistant integration :

do-it.dev Avatar
if you liked it, please contribute !

Leave a Reply

Your email address will not be published. Required fields are marked *

Aurélien Bordinat

I am a french computer engineer, adept of DIY, home automation and new technologies. When i’m not busy trail running, i spend some time prototyping.