『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 500|回复: 3

[硬件DIY] 电动升降晒衣架控制板PCB

[复制链接]

37

主题

273

帖子

2182

积分

论坛DIY达人

积分
2182
金钱
1909
HASS币
20
发表于 2024-3-8 11:20:25 | 显示全部楼层 |阅读模式
本帖最后由 shadowba 于 2024-3-8 12:24 编辑

如题,纯属个人业余玩玩,不做专业对比,有需要的可自行打印
3D_电动晾衣架模块_2024-03-082.png

3D_电动晾衣架模块_2024-03-08.png

3D_电动晾衣架模块_2024-03-0811.png

附件:嘉立创制版文件
Gerber_电动晾衣架模块_2024-03-08.zip (234.4 KB, 下载次数: 2, 售价: 2 金钱)

微信图片_20240308112140.png

esphome程序

esphome:
  name: "clothes-hanger"
  friendly_name: "clothes-hanger"
  comment: 阳台晒衣杆、阳台灯
  platformio_options:
    board_build.flash_mode: dio
    board_build.mcu: esp32c3
esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: esp-idf
    version: recommended
    # Custom sdkconfig options
    sdkconfig_options:
      CONFIG_COMPILER_OPTIMIZATION_SIZE: y
    # Advanced tweaking options
    advanced:
      ignore_efuse_mac_crc: false
logger:
  hardware_uart: USB_SERIAL_JTAG
# Enable logging
api:
ota:
  password: "2fe5275a4f967590a20bb6179fb0ce14"
captive_portal:
wifi:
  networks:
     - ssid:  
       password:  
     - ssid:  
       password:  
  ap:
    ssid: " - "
    password: " "
sensor:
  - platform: adc
    pin: 0
    id: alarm1
    name: "超载报警"
    update_interval: 2s
    filters:
      - multiply: 10
    on_value_range:
      - above: 1.5
        then:
          - cover.stop: hanger
          - rtttl.play: 'long:d=1,o=5,b=100:e6'
  - platform: wifi_signal
    name: "clothes-hanger WiFi Signal"
    update_interval: 60s   
binary_sensor:
#上升限位
  - platform: gpio
    id: sxw
    name: "Up Limit"
    icon: mdi:arrow-collapse-up
    pin:
      number: GPIO2
      mode:
        input: true
        pullup: true
#      inverted: true
    filters:
      - delayed_on: 20ms
    on_press:
      then:
        - rtttl.play: 'scale_up:d=32,o=7,b=100:c,c#,d#,e,f#,g#,a#,b'
        - switch.turn_off: relay
#下降限位
  - platform: gpio
    id: jxw
    name: "Down Limit"
    icon: mdi:arrow-collapse-down
    pin:
      number: GPIO3
      mode:
        input: true
        pullup: true
#      inverted: true
    filters:
      - delayed_on: 20ms
    on_press:
      then:
        - rtttl.play: 'scale_up:d=32,o=7,b=100:b,a#,g#,f#,e,d#,c#,c'
        - switch.turn_off: relay1
#衣物检测限位
  - platform: gpio
    id: yzxq
    name: "衣物检测"
    pin:
      number: GPIO5
      mode:
        input: true
        pullup: true
      inverted: true
    filters:
      - delayed_on: 20ms
  #  on_press:
  #      - switch.turn_off: relay
  #      - switch.turn_off: relay1
  #      - switch.turn_on: relay2
  #      - delay: 200ms
  #      - switch.turn_on: relay2
  #      - delay: 200ms
  #      - switch.turn_on: relay2
#上升按钮
  - platform: gpio
    id: up
    pin:
      number: GPIO21
      mode:
        input: true
        pullup: true
      inverted: true
    filters:
      - delayed_on: 50ms
    on_press:
      - cover.open: hanger
#      - rtttl.play: 'scale_up:d=32,o=7,b=100:c,c#,d#'
#下降按钮
  - platform: gpio
    id: down
    pin:
      number: GPIO1
      mode:
        input: true
        pullup: true
      inverted: true
    filters:
      - delayed_on: 50ms
    on_press:
      - cover.close: hanger
 #     - rtttl.play: 'scale_up:d=32,o=7,b=100:b,a#'
#暂停按钮
  - platform: gpio
    id: stop
    pin:
      number: GPIO20
      mode:
        input: true
        pullup: true
      inverted: true
    filters:
      - delayed_on: 50ms
    on_press:
      - cover.stop: hanger
 #     - rtttl.play: 'two_short:d=4,o=5,b=100:16e6,16e6'
#灯按钮
  - platform: gpio
    id: blight
    pin:
      number: GPIO8
      mode:
        input: true
        pullup: true
      inverted: true
    filters:
      - delayed_on: 50ms
    on_press:
      - light.toggle: lamp
switch:
# 上升继电器控制
  - platform: gpio                 
    pin: GPIO7
    id: relay
#    name: "Up D15"
    restore_mode: RESTORE_DEFAULT_OFF
    interlock: &interlock_group [relay, relay1]
    interlock_wait_time: 200ms
#  下降继电器控制
  - platform: gpio                 
    pin: GPIO10
    id: relay1
#    name: "Down D4"
    restore_mode: RESTORE_DEFAULT_OFF
    interlock: *interlock_group
    interlock_wait_time: 200ms 
cover:
  - platform: endstop
    name: "hanger"
    id: hanger
    open_action:
      - switch.turn_on: relay
      - rtttl.play: 'scale_up:d=32,o=7,b=100:c,c#,d#,e,f#,g#,a#,b'  
    open_duration: 12s
    open_endstop: sxw

    close_action:
      - rtttl.play: 'scale_up:d=32,o=7,b=100:b,a#,g#,f#,e,d#,c#,c' 
      - switch.turn_on: relay1
    close_duration: 13s
    close_endstop: jxw

    stop_action:
      - switch.turn_off: relay
      - switch.turn_off: relay1
      - rtttl.play: two_short:d=4,o=5,b=100:16e6,16e6
light:
  - platform: binary
    id: lamp
    name: "阳台灯"
    output: light_output
output:
  - id: light_output
    platform: gpio
#    inverted: False
    pin: GPIO6
  - platform: ledc
    pin: GPIO4
    id: rtttl_out
rtttl:
  output: rtttl_out
text_sensor:
  - platform: template
    name: "晒衣杆状态"
    update_interval: 1s
    icon: mdi:hanger
    lambda: |-
      if (id(relay1).state == true){
        return {"晒衣杆正在下降中..."};
      } else if (id(relay).state == true){
        return {"晒衣杆正在升起..."};
      } else if (id(jxw).state == true ){
        return {"晒衣杆已降下"};
      } else if (id(sxw).state == true ){
        return {"晒衣杆已升起"};
      } else if (id(alarm1).state > 1 ){
        return {"告警,晒衣杆超负荷!"};
      } else {
        return {"待机中"};
      }    


评分

参与人数 3金钱 +22 收起 理由
simonliu009 + 2 感谢楼主分享!
book123 + 10 论坛有你更精彩!
隔壁的王叔叔 + 10 论坛有你更精彩!

查看全部评分

回复

使用道具 举报

1

主题

176

帖子

1138

积分

金牌会员

Rank: 6Rank: 6

积分
1138
金钱
962
HASS币
0
发表于 2024-3-8 13:47:49 | 显示全部楼层
支持大佬。
回复

使用道具 举报

5

主题

100

帖子

617

积分

高级会员

Rank: 4

积分
617
金钱
517
HASS币
0
发表于 2024-3-8 15:02:17 | 显示全部楼层
膜拜大佬啊
回复

使用道具 举报

6

主题

111

帖子

1285

积分

金牌会员

Rank: 6Rank: 6

积分
1285
金钱
1174
HASS币
0
发表于 2024-3-8 15:09:03 | 显示全部楼层
打板制作
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-21 02:43 , Processed in 0.054472 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表