Auta Building Intercom and Entry System

Background

In the apartment I'm currently living in, the building intercom and entry system unit is installed outside the living room door, plus I usually play music or sleep in the bedroom further inside, it's rather difficult to hear the doorbell, thus I frequently miss the deliveryman. So I decided to integrate it into my Home Assistant, then another benefit is that I don't need to take my keys anymore when go out.

overview

After removing the case, the sticker on the PCB shows that the model number is "auta 700105"

inside

Hacking

According to the technical manual found on the manufacturer's website, the four wires that came from outside the apartment to terminal CON1 are, from left to right, GND (black), +24 VDC power (brown), microphone (blue), speaker and data (gray). CON2 connects the handset via an RJ11 connector.

wiring

I took out the PCB and started to reverse engineer the circuit.

pcb-front

pcb-back

The ICs:

  • U1 is a "78L05A" voltage regulator, which provides +5 V to other components

  • U2 is a "PIC16F870-I/SO" MCU, which implements the main functions

  • U3 is a "ULN2003A" Darlington transistor array, which lets the MCU to drive peripheral circuits

    • Channel 1: input is the MCU's PIN27 RB6, output is the handset speaker amplifier circuit
    • Channel 2: input is the MCU's PIN26 RB5, output is the relay RY1
    • Channel 3-7: input is the MCU's PIN25 RB4, output is the "Auxiliary bell (24 Vdc output, in call)" terminals of CON1
  • U4 is a "LM393" voltage comparator
    • Comparator 1 is not used
    • Noninverting input 2: +12 V
    • Inverting input 2: the "Speaker and Data" terminals of CON1
    • Output 2: PIN23 of the MCU
  • U5 is a "PC357NJ0000F" optocoupler, input is the "Ding-Dong function (tension free button)" terminals of CON1, which pulls down the MCU's PIN22 RB1 when they are shorted

MCU pin functions

  • 1 MCLR: reset
  • 2 RA0: input of the bell melody select button PB1 (low level trigger)
  • 3 RA1: output of the red LED
  • 4 RA2: output of the green LED
  • 5 RA3: input of the building door unlock button (low level trigger)
  • 6 RA4: input of the AUX1 button (low level trigger)
  • 7 RA5: output of unlock signal?
  • 8 Vss: GND
  • 9 OSC1, 10 OSC2: inputs of the crystal oscillator X1
  • 11 RC0 - 14 RC3: inputs of the 5-8 positions of the DIP switch SW1 (low level trigger)
  • 15 RC4 - 18 RC7: inputs of the 1-4 positions of the DIP switch SW1 (low level trigger)
  • 19 Vss: GND
  • 20 Vdd: +5 V power input
  • 21 RB0: input of the master-slave selection jumper J1 (high level as master)
  • 22 RB1: input of the "Ding-Dong function (tension free button)" through optocoupler U5's collector pin (low level trigger)
  • 23 RB2: input of the doorbell signal?
  • 24 RB3: output of the unlock signal?
  • 25 RB4: output of the "Auxiliary bell", through the driver IC U3's channels 3-7 (high level trigger)
  • 26 RB5: output of the relay, through the driver IC U3's channel 2 (low level trigger)
  • 27 RB6: output of the doorbell sound to the handset speaker, through the driver IC's channel 1
  • 28 RB7: input of the switchhook for handset (low level while hanging)

We can see that PIN5 RA3 can be used to unlock the building door, and PIN27 RB6 can be used to detect if the doorbell is ringing.

Hardware

The circuit is shown in the following figure, since the PIC uses 5 V TTL but ESP8266 uses 3.3 V, they need a logic level shifter to talk:

schematic

Install

As shown in the figure, +5 V (purple), GND (green), MCU PIN5 (white) and PIN27 (blue) are tapped from several contacts that are easy to solder:

hack-wiring

Since I already have an ESPHome device (Whole Home Energy Monitoring) lying nearby, I just modified and reused it (the 4-pin DuPont cable is for the PZEM energy monitor):

hack-board

Connected to the intercom phone with an old USB cable:

hack-connected

Software

Example ESPHome configuration:

esphome:
  name: building-intercom
  comment: 'Auta building intercom and entry system hack'

esp8266:
  board: d1_mini

preferences:
  flash_write_interval: 10min

logger:
  level: WARN
  baud_rate: 115200

wifi:
  fast_connect: true
  networks:
    - ssid: !secret wifi_ssid
      bssid: !secret wifi_bssid
      password: !secret wifi_password

api:
ota:
  password: !secret ota_password

binary_sensor:
  # intercom bell sensor
  - platform: gpio
    pin: 12
    id: intercom_ringing
    name: 'Building Intercom Ringing'
    filters:
      - delayed_off: 30s  # adjust this to the actual ringing time
    icon: mdi:bell-outline
    on_press:
      - homeassistant.service:
          service: script.building_intercom_ringing_notification

output:
  # pull down to trigger the unlock button
  - platform: gpio
    id: intercom_unlock_door_button_output
    pin:
      number: 14
      inverted: true

button:
  # expose the unlock button to HASS frontend
  - platform: output
    id: building_door_unlock_button
    name: 'Unlock Building Door'
    output: intercom_unlock_door_button_output
    duration: 3s
    icon: mdi:door

After flashing the firmware, it can be added to HASS:

hass

Then I created a script in HASS to push a notification to my phone when the intercom bell is ringing:

alias: Building Intercom Ringing Notification
mode: restart
icon: mdi:bell-outline
sequence:
  - service: notify.mobile_app_phone  # target phone
    data:
      message: 'Building Intercom Ringing'
      data:
        push:
          sound:
            name: default
            critical: 1
            volume: 1
        actions:
          # a button to unlock the door
          - action: UNLOCK_BUILDING_DOOR
            title: 'UNLOCK'
            destructive: true  # show it in red

And an automation is needed to receive the unlock button event from the notification (the following YAML is only for display and the automation should be created using the UI):

alias: Unlock Building Door by Notification Callback
mode: restart
trigger:
  - platform: event
    event_type: mobile_app_notification_action
    event_data:
      action: UNLOCK_BUILDING_DOOR
condition: []
action:
  - device_id: f13cff1a6a2eb06cbd79e584e91f2e21
    domain: button
    entity_id: button.unlock_building_door
    type: press

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published.