Skip to main content

mmWave for XIAO を Bluetooth 経由で Home Assistant に接続

はじめに

24GHz mmWave Sensor for XIAO - Human Static Presence は、Seeed Studio XIAO シリーズ用の拡張ボードです。これは、FMCW 原理に基づいたアンテナ一体型の高感度 mmWave センサーです。センサー信号処理と正確な人体検知アルゴリズムを組み合わせることで、動いている状態と静止している状態の人体を識別できます。

この章では、主に 24GHz mmWave Sensor for XIAO が Bluetooth 経由で HA に接続する方法を紹介します。24GHz mmWave Sensor for XIAO の詳細な機能については、こちらを参照してください。

caution

この Wiki のすべての内容は 24GHz mmWave for XIAO にのみ適用され、他のミリ波センサーには使用できない場合があります。

はじめに

ハードウェアの準備

この記事では、美観と配線の簡単さのために、mmWave for XIAO を XIAO ESP32C3 と組み合わせて使用し、Home Assistant に接続します。このチュートリアルに正確に従いたい場合は、以下のモジュールを準備する必要があります。

Seeed Studio XIAO ESP32C324GHz mmWave for XIAO

このセンサーはXIAO互換性を考慮して設計されているため、一般的にこのセンサーを使用したい場合は、XIAOを準備し、センサー用のメスヘッダーピンを取り付ける必要があります。XIAOに接続する際は、センサーの取り付け方向に特に注意してください。逆向きに差し込まないでください。そうしないとセンサーやXIAOを焼損する可能性があります。

caution

正しい方向は、センサーのアンテナが外側を向くようにすることです。

接続方向が正しいことを確認した後、USB-Cタイプケーブルをコンピューターまたは3.3V電源に接続すると、センサーが動作を開始します。

tip

現在XIAOが手元にない場合は、TTLをmmwave for XIAOの3.3VピンとGNDピンに接続して個別に電源を供給することもでき、このチュートリアルの内容を使用することができます。このチュートリアルでは、RXピンとTXピンを使用する必要はありません。

ソフトウェアの準備

まだHomeAssistantをインストールしていない場合は、こちらをクリックしてHomeAssistantの公式チュートリアルを参照してください。

手順

ステップ1. デバイスの発見

Home Assistantで、左下のsettingをクリックし、中央のDevices&Servicesを選択します。

Discoveredゾーンにセンサーアイコンが表示されるので、configureをクリックします。

ポップアップウィンドウが表示されるので、submitをクリックします。

設定成功のポップアップが表示されるので、finishをクリックします。

ステップ2. デバイスの設定

configuredゾーンで、ld2410_bleをクリックします。

センサー設定ページに入ったら、1 deviceをクリックします。

センサーの戻り値をダッシュボードに追加します。

ポップアップウィンドウでADD TO DASHBOARDを選択します。

最後に、左上のoverviewをクリックすると、mmwave-for-xiaoセンサーデータがダッシュボードに正常に表示されます。これでmmwave for xiaoセンサーがHome Assistantに正常に接続されました。

次に、自動化を創造的に活用できます!

ESPHomeを使用してWifi経由でmmWave for XIAOをHome Assistantに接続

以下のyamlファイルは、ESPHomeファームウェアを使用して、レーダーモジュール付きSeeed XIAO ESP32S3 SenseをHome Assistantに接続します:

# Configuration for ESPHome
esphome:
# Name of the ESP32-S3 device
name: "seeed-xiao-esp32s3-cam"

# PlatformIO build options
platformio_options:
build_flags: -DBOARD_HAS_PSRAM
board_build.arduino.memory_type: qio_opi
board_build.f_flash: 80000000L
board_build.flash_mode: qio

# Configuration for ESP32 board
esp32:
board: esp32-s3-devkitc-1
framework:
type: arduino

# Enable logging
logger:

# Enable Home Assistant API - use your api and password
api:
encryption:
key: ""

ota:
- platform: esphome
password: ""

# Wi-Fi configuration - fill with your data
wifi:
ssid: ""
password: ""

# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Xiao-Esp32s3 Fallback Hotspot"
password: ""

# Captive portal configuration
captive_portal:

# Configuration for the ESP32 Camera
esp32_camera:
id: espcam
name: Xiao Cam
external_clock:
pin: GPIO10
frequency: 20MHz
i2c_pins:
sda: GPIO40
scl: GPIO39
data_pins: [GPIO15, GPIO17, GPIO18, GPIO16, GPIO14, GPIO12, GPIO11, GPIO48]
vsync_pin: GPIO38
href_pin: GPIO47
pixel_clock_pin: GPIO13
resolution: 800x600

# Configuration for the ESP32 Camera Web Server
esp32_camera_web_server:
- port: 8080
mode: stream
- port: 8081
mode: snapshot

# Configuration for the 24GHz mmwave XIAO Radar
ld2410:
id: ld2410_radar

uart:
tx_pin: GPIO4
rx_pin: GPIO3
baud_rate: 256000
parity: NONE
stop_bits: 1

number:
- platform: ld2410
timeout:
name: Radar Timeout
max_move_distance_gate:
name: Radar Max Move Distance
max_still_distance_gate:
name: Radar Max Still Distance
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

binary_sensor:
- platform: ld2410
has_target:
name: Radar Target
id: radar_has_target
has_moving_target:
name: Radar Moving Target
has_still_target:
name: Radar Still Target

sensor:
- platform: ld2410
moving_distance:
name: Radar Moving Distance
id: moving_distance
still_distance:
name: Radar Still Distance
id: still_distance
moving_energy:
name: Radar Move Energy
still_energy:
name: Radar Still Energy
detection_distance:
name: Radar Detection Distance
id: radar_detection_distance
g0:
move_energy:
name: g0 move energy
still_energy:
name: g0 still energy
g1:
move_energy:
name: g1 move energy
still_energy:
name: g1 still energy
g2:
move_energy:
name: g2 move energy
still_energy:
name: g2 still energy
g3:
move_energy:
name: g3 move energy
still_energy:
name: g3 still energy
g4:
move_energy:
name: g4 move energy
still_energy:
name: g4 still energy
g5:
move_energy:
name: g5 move energy
still_energy:
name: g5 still energy
g6:
move_energy:
name: g6 move energy
still_energy:
name: g6 still energy
g7:
move_energy:
name: g7 move energy
still_energy:
name: g7 still energy
g8:
move_energy:
name: g8 move energy
still_energy:
name: g8 still energy

技術サポート & 製品ディスカッション

弊社製品をお選びいただき、ありがとうございます!お客様の製品体験を可能な限りスムーズにするため、さまざまなサポートを提供いたします。異なる好みやニーズに対応するため、複数のコミュニケーションチャネルをご用意しております。

Loading Comments...