Zry.IO

返回

背景

由于现在住的公寓大楼对讲门禁装在客厅门外,门关着时很难听到门铃,因此经常错过邮递员。于是打算将其接入 Home Assistant,这样出门也不用带钥匙了。

overview

拆开外壳后,从 PCB 上的贴纸可以看到型号是 “auta 700105 [存档]”。

inside

硬件

根据厂家官网提供的技术手册 [存档],接线柱 CON1 连着的四根入户线从左到右依次是 GND(黑)、+24 VDC 电源(褐)、麦克风(蓝)、扬声器与数据通信(灰)。CON2 通过一个 RJ11 接口连接了听筒。

wiring

将 PCB 拆下后,开始逆向电路。

pcb-front

pcb-back

各个 IC:

  • U1 是一颗 “78L05A” 稳压器,给其他元件提供了 +5 V 电源

  • U2 是一颗 “PIC16F870-I/SO” MCU,实现了主要的功能控制

  • U3 是一颗 “ULN2003A” 达林顿管驱动,让 MCU 驱动外围功能电路

    • 通道 1:输入为 MCU 的 PIN27 RB6,输出为听筒扬声器功放
    • 通道 2:输入为 MCU 的 PIN26 RB5,输出为继电器 RY1
    • 通道 3-7:输入为 MCU 的 PIN25 RB4,输出为 CON1 接线柱上的 “Auxiliary bell (24 Vdc output, in call)”
  • U4 是一颗 “LM393” 电压比较器

    • 比较器 1 未被使用
    • 正相输入 2:+12 V
    • 反相输入 2:CON1 接线柱上的入户线 “扬声器与数据通信”
    • 输出 2:MCU PIN23
  • U5 是一颗 “PC357NJ0000F” 光耦,输入端是 CON1 接线柱上的 “Ding-Dong function (tension free button)”,短接时下拉 MCU 的 PIN22 RB1

MCU 引脚功能

  • 1 MCLR:复位
  • 2 RA0:铃声切换按钮 PB1 输入(低电平触发)
  • 3 RA1:红色 LED 输出
  • 4 RA2:绿色 LED 输出
  • 5 RA3:解锁门禁按钮 PB2 输入(低电平触发)
  • 6 RA4:AUX1 按钮(低电平触发)
  • 7 RA5:解锁信号输出?
  • 8 Vss:GND
  • 9 OSC1, 10 OSC2:时钟晶振 X1 输入
  • 11 RC0 - 14 RC3:拨码开关 SW1 5-8 位输入(低电平触发)
  • 15 RC4 - 18 RC7:拨码开关 SW1 1-4 位输入(低电平触发)
  • 19 Vss:GND
  • 20 Vdd:+5 V 电源输入
  • 21 RB0:主/副机选择跳线 J1 输入(低电平为副机)
  • 22 RB1:“Ding-Dong function (tension free button)” 光耦集电极输入(低电平触发)
  • 23 RB2:门铃信号输入?
  • 24 RB3:解锁信号输出?
  • 25 RB4:“Auxiliary bell” 输出,通过驱动 IC U3 通道 3-7(高电平触发)
  • 26 RB5:继电器输出,通过驱动 IC U3 通道 2(低电平触发)
  • 27 RB6:听筒扬声器铃声输出,通过驱动 IC U3 通道 1
  • 28 RB7:挂机插簧开关 BT1 输入(低电平为挂机)

可见 PIN5 RA3 可以用于解锁门禁,和 PIN27 RB6 可以用于检测门铃在响。

电路如下图所示,由于 PIC MCU 使用 5 V TTL,而 ESP8266 使用 3.3 V,需要通过一个电平转换器来通讯:

schematic

安装

如图所示,通过方便焊接的几个触点分别引出 GND(绿)、MCU PIN5(白) 和 PIN27(蓝)(请忽略连接了对讲机电路板 +5 V 的紫色线,因为在供电输入有一个非常有限的 400 mA 保险丝,切勿使用其提供的 +5 V):

hack-wiring

由于附近已有一个 ESPHome 设备(全屋电能监控),直接修改复用了它(请忽略用于连接 PZEM 电能监控器的 4-pin 杜邦线):

hack-board

通过一根废旧 USB 线缆连接:

hack-connected

软件

ESPHome 配置示例:

刷入固件后添加至 Home Assistant:

hass

在 Home Assistant 新建一个自动化,用于在门铃响的时候推送通知至手机(以下两个 YAML 仅为展示配置,应通过图形界面创建):

另一个自动化用于处理通知中的解锁按钮回调事件:

alias: '解锁楼门通知按钮回调'
trigger:
  - platform: event
    event_type: mobile_app_notification_action
    event_data:
      action: UNLOCK_BUILDING_DOOR
condition: []
action:
  - device_id: # 通过 UI 创建
    domain: button
    entity_id: button.unlock_building_door
    type: press
mode: restart
yaml
Auta 楼宇对讲门禁系统
https://zry.io/zh/smart-home/auta-building-intercom-and-entry-system
作者 zry98
发布于 2022年7月1日
2 条评论
Alex

Hi, I have a similar project that I'm trying to implement but it differs from yours a bit. I have the board "auta 050136" and wanted to detect just the ringing so I'm looking at reading 1.2v from the led diode to my ESP8266MOD, the challenge is that that 1.2v is too small to detect and also I wanted to take 5v from the intercom board to power up my ESP if this possible.

zry98
@Alex :

Hi, can you confirm it's the same as in the manuals of Auta 700305 or 700505? If so, it seems they are using individual wire for each function, maybe you can simple tap your ESP into the corresponding wires (with voltage divider of course); if not, you can try adding a suitable transistor, or simply use the ADC pin (be careful and use a voltage divider if necessary) on your ESP and trigger on voltage threshold.

Also I would suggest you not to power your ESP with the +5V from the intercom board, as they usually come with a low-rated fuse, just enough to power the board itself. The ESP8266 (with some peripherals) can peak to around 1W.