새창 작성 수정 목록 링크 Edit G카랜다 HDD HDD HDD 게시물 주소 복사


★★★ ha작업) 추천 인체감지 센서 ld2410c 적용 및 pc speaker 피프음 사용 > 추천소스

♨ 카랜더 일정 : 2024년09월10일
  • 링크

  • 첨부

  • 컨텐츠 정보

    본문

    ● ha작업) 인체감지 센서 ld2410c pc speaker 

    인체감지 동작 참조 영상

    https://www.youtube.com/watch?v=H1qk0tn6_5M&t=1s

     

    esp32보드의 pin정보

    아두이노 ESP32 ESP-32 ESP32-WROOM-32 30PIN 2코어 와이파이-WIFI 블루투스-BlueTooth USB C-Type 

    3232235521_1719496673.6353.png

    인체감지 ld2410c

    LD2410C 24GHz 휴먼 프레전스 센서 FMCW 웨이브 레이더 유도 모듈 바디 하트 비트 감지 센서 고정밀

    https://ko.aliexpress.com/item/1005005400130647.html?

    5V용 입니다 >

    3232235521_1714889598.1764.png

    3232235521_1714889663.7192.png

    pc 음급용 스피커 적용 / speaker

    3232235521_1725896523.2332.png

    esp32 이용 esphome 구성 소스


    3232235521_1725897025.4686.png


    추천 소스>esp32

    substitutions:
      name: senser-ld2410c-type-ip78
      device_description: "esp32dev lving ld2410 type ip78"

    esphome:
      name: ${name}
      comment: ${device_description}

    esp32:
      board: esp32dev
      framework:
        type: arduino

    api:
      encryption:
        key: "RaYHao1JNO719dysZIQnulcdmD6cG/xXYyRZivkZMiE="

    ota:
      - platform: esphome
        # safe_mode: true
        # password: !secret ota_password
        password: "b8efc75909ce6bb9f5efb564a07b0b5b"

    wifi:
      ssid: !secret wifi_ssid
      password: !secret wifi_password
      power_save_mode: LIGHT  
      manual_ip:
        static_ip: 192.168.0.78
        gateway: 192.168.0.1
        subnet: 255.255.255.0
        dns1: 8.8.8.8
        dns2: 8.8.4.4
      # Enable fallback hotspot (captive portal) in case wifi connection fails
      ap:
        ssid: "Esp32-2410 Fallback Hotspot"
        password: "Hex5ZsOwz6l5"


    captive_portal:

    # =============================================================
      # tx_pin: GPIO1
      # rx_pin: GPIO3
      # number: GPIO2
      # number: GPIO15
      #  pin: GPIO13
    # =============================================================
    # =============================================================
    logger:
      level: debug
      baud_rate: 0  

    web_server:
      port: 80
      version: 2
      include_internal: true
       
    mqtt:
      broker: 192.168.0.35
      username: mqtt_user
      password: mqtt_pass
      port: 1883

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

    ld2410:
      id: my_ld2410

    sensor:
      - platform: ld2410
        light:
          name: "light ${name}"
        moving_distance:
          name: "Moving Distance  ${name}"
        still_distance:
          name: "Still Distance  ${name}"
        moving_energy:
          name: "Move Energy  ${name}"
        still_energy:
          name: "Still Energy  ${name}"
        detection_distance:
          name: 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

      - platform: uptime
        name: "Uptime Sensor ${name}"

    # sensor:
      - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
        name: "WiFi Signal dB ${name}"
        id: wifi_signal_db
        update_interval: 60s
        entity_category: "diagnostic"

      - platform: copy # Reports the WiFi signal strength in %
        source_id: wifi_signal_db
        name: "WiFi Signal Percent ${name}"
        filters:
          - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
        unit_of_measurement: " %"
        entity_category: "diagnostic"
        device_class: ""
     

    binary_sensor:
      - platform: status
        name: "Connection Status  ${name}"  
      - platform: ld2410
        has_target:
          name: "Presence  ${name}"
          # on_press:
          #   then:
          #     - light.turn_on: mmwave_to_led
          # on_release:
          #   then:
          #     - light.turn_off: mmwave_to_led      
        has_moving_target:
          name: "Moving Target  ${name}"
        has_still_target:
          name: "Still Target  ${name}"
          filters:
            - delayed_on: 15s
            - delayed_off: 15s

        out_pin_presence_status:
          name: "out pin presence status  ${name}"

      - platform: gpio
        device_class: PRESENCE
        pin:
          number: GPIO2
          mode: INPUT_PULLUP
          # inverted: true
        name: "mmwave_ld2410c_out  ${name}"
        filters:
          - delayed_off: 10ms

    switch:
      - platform: restart
        name: "Restart Node  ${name}"

      - platform: ld2410
        engineering_mode:
          name: "engineering mode  ${name}"
        bluetooth:
          name: "HLKRadar on bluetooth  ${name}"

     
    number:
      - platform: ld2410
        timeout:
          name: "timeout ${name}"
        light_threshold:
          name: "light threshold ${name}"
        max_move_distance_gate:
          name: "max move distance gate ${name}"
        max_still_distance_gate:
          name: "max still distance gate ${name}"
        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

    button:
      - platform: ld2410
        factory_reset:
          name: "factory reset ${name}"
        restart:
          name: "restart ${name}"
        query_params:
          name: query params

    text_sensor:
      - platform: ld2410
        version:
          name: "firmware version ${name}"
        mac_address:
          name: "mac address ${name}"

    # text_sensor:
      - platform: wifi_info
        ip_address:
          name: "Address ${name}"
          id: ip
        ssid:
          name: "SSID ${name}"
        mac_address:
          name: "Mac ${name}"
         
      - platform: template
        name: "Uptime ${name}"
        update_interval: 1s
        lambda: |-
          auto s = millis() / 1000;
          return str_snprintf("%02d:%02d:%02d:%02d", 11, s / 86400, s / 3600 % 24, s / 60 % 60, s % 60);            

    select:
      - platform: ld2410
        distance_resolution:
          name: "distance resolution ${name}"
        baud_rate:
          name: "baud rate ${name}"
        light_function:
          name: "light function ${name}"
        out_pin_level:
          name: "out pin level ${name}"


    # GPIO13에 연결된 스피커 출력 설정
    output:
      - platform: gpio
        pin:
          number: GPIO15
          inverted: true
        id: led_output

      - platform: ledc
        pin: GPIO13
        frequency: 300 Hz  # 고정된 주파수 설정 (500Hz) 변경 소리의 음색을 결정 하세요
        id: speaker_output13

    # 스피커 관련 구성 (light로 설정)

    light:
      - platform: monochromatic
        name: "Beef sound ${name}"
        output: speaker_output13
        id: speaker13
        on_turn_on:
          - light.dim_relative:
              id: speaker13
              relative_brightness: 5%
              transition_length: 0.1s
              brightness_limits:
                  max_brightness: 90%
          # `Beef sound`가 켜질 때 `led_sw`도 켬
          - light.turn_on:
              id: led_output_id

        on_turn_off:
          # `Beef sound`가 꺼질 때 `led_sw`도 끔
          - light.turn_off:
              id: led_output_id

      - platform: binary
        name: "led_sw ${name}"
        output: led_output
        id: led_output_id
    # 888888888888888888888888888888888


    ☞ https://11q.kr 에 등록된 자료 입니다. ♠ 정보찾아 공유 드리며 출처는 링크 참조 바랍니다♠1.png

    [ 추가 정보 ... 더보기) ]
    뷰PDF 1,2



    office view

    관련자료

    댓글목록

    등록된 댓글이 없습니다.


    새창 작성 수정 목록 링크 Edit G카랜다 HDD HDD HDD 게시물 주소 복사


    ♥간단_메모글♥


    최근글


    새댓글



    PHP 안에 HTML ☞ 홈페이지 화면갱신 시간은 ♨
    ▶ 2024-11-18 21:17:31

    오늘의 홈 현황


    • 현재 접속자♨ 186 명
    • 오늘 가입자※ 1 명
    • 어제 가입자※ 4 명
    • 주간 가입자※ 17 명
    • 오늘 방문자 1,795 명
    • 어제 방문자 1,974 명
    • 최대 방문자 13,042 명
    • 전체 방문자 4,786,623 명
    • 전체 게시물※ 8,851 개
    • 전체 댓글수※ 25,220 개
    • 전체 회원수 11,321 명

    QR코드


    ☞ QR코드 스캔은 kakao앱 자체 QR코드

    알림 0








    최신글↑