Custom ESP32-C6 Thread Node (HLK-2450 Radar + SHT41 + BH1750)

Hi everyone!
I wanted to share a custom PCB I designed around the ESP32-C6. My goal was to create a high-performance sensor node that communicates entirely over Thread, making it a future-proof addition to my Home Assistant setup.
Hardware Specs:
MCU: ESP32-C6 (supports Wi-Fi 6, Zigbee, and Thread/Matter).
Presence Detection: HLK-LD2450 (24GHz mmWave radar) for high-accuracy human tracking and zones.
Temperature & Humidity: Sensirion SHT41 (very high precision).
Light Sensing: Adafruit BH1750 (Lux sensor).
Connectivity: Running over a Thread network for low-power, mesh connectivity.

1 Like

If you don’t mind, could you show the YAML for this?

Of course, here is the code:

esphome:
  name: bijkeuken-unit
  friendly_name: Bijkeuken Unit
  on_boot:
    priority: 600
    then:
      - delay: 2s 
      - number.set: { id: z1_xmin, value: -1400 } # Left
      - number.set: { id: z1_xmax, value: 2228 } # Right
      - number.set: { id: z1_ymin, value: 5 }    # Near (Y1)
      - number.set: { id: z1_ymax, value: 2981 } # Far (Y2)
     
esp32:
  board: esp32-c6-devkitc-1
  framework:
    type: esp-idf

logger:

api:
  encryption:
    key: !secret api_encryption_key

ota:
  - platform: esphome
    password: !secret ota_password

network:
  enable_ipv6: true

openthread:
   tlv: !secret openthread_tlv
   device_type: FTD

uart:
  id: uart_ld2450
  tx_pin: GPIO18
  rx_pin: GPIO17
  baud_rate: 256000
  rx_buffer_size: 1024
  parity: NONE
  stop_bits: 1

ld2450:
  id: ld2450_radar
  uart_id: uart_ld2450

i2c:
  sda: GPIO19
  scl: GPIO20
  scan: true
  id: bus_a
      
output:
  - platform: gpio
    pin: GPIO06
    id: status_1

script:
  - id: blink_script_led_status_1
    mode: restart
    then:
      - switch.turn_on: led_status_1
      - delay: 600ms
      - switch.turn_off: led_status_1

switch:
  - platform: output
    output: status_1
    id: led_status_1
    restore_mode: ALWAYS_OFF

number:
  - platform: ld2450
    ld2450_id: ld2450_radar
    presence_timeout:
      name: "Radar Timeout"
    zone_1:
      x1: { name: "Zone-1 Left (X1)", id: z1_xmin }
      y1: { name: "Zone-1 Near (Y1)", id: z1_ymin }
      x2: { name: "Zone-1 Right (X2)", id: z1_xmax }
      y2: { name: "Zone-1 Far (Y2)", id: z1_ymax }

binary_sensor:
  - platform: template
    name: "Bijkeuken Zone 1 Occupancy"
    device_class: occupancy
    filters:
      - delayed_off: 30s 
    lambda: |-
      if (std::isnan(id(t1_x).state) || std::isnan(id(z1_xmin).state)) {
        return false;
      }
      if (id(t1_x).state > id(z1_xmin).state && id(t1_x).state < id(z1_xmax).state &&
          id(t1_y).state > id(z1_ymin).state && id(t1_y).state < id(z1_ymax).state) {
        return true;
      }
      return false;

sensor:
  - platform: sht4x
    temperature:
      name: "Temperature"
    humidity:
      name: "Humidity"
    
  - platform: bh1750
    name: "Lux"
    address: 0x23
    update_interval: 60s
    on_value: 
      then:
        - script.execute: blink_script_led_status_1

  - platform: ld2450
    ld2450_id: ld2450_radar
    target_1:
      x:
        id: t1_x
        internal: true
      y:
        id: t1_y
        internal: true

1 Like