ESP8266 door phone

Crude door phone and RFID lock project for my yard gates door

Public Chat
Similar projects worth following
"If it looks stupid but works, it ain't stupid."

Handset unit serves as a gateway creating soft AP for door unit and connecting to existing WiFi network and MQTT broker.

Basic keys management and lock control via home assistant.

Using arduino esp8266 framework and PlatformIO environment for development.

As this is one time build, it's based on breakout boards/modules from ebay/aliexpress soldered to a perfboard.

Some breakout boards/modules utilized in this project:

Power door lock actuator unlocks a simple door bolt. Reed switch and a magnet mounted on the frame used as a door contact switch.

This is the door lock actuator I'm using:

Initially it was very simple lock controller with single "unlock" button. Voice communication and RFID reader added later.

Audio quality turned out to be pretty good. There is no feedback noise due to earphone on the handset side. To get rid of digital noise and echo use shielded cable for microphone signal.

One of the reasons I decided to build this thing is to find some use for this old army phone handset I had, it has this very convenient switch I'm using as "connect" push button:

Network setup

Handset unit acts as both client and access point. It creates access point used by door unit and connects to existing WiFi network as a client to communicate with home assistant via MQTT broker.

Door unit establishes connection directly to handset unit AP using hardcoded credentials. Handset unit uses hardcoded credentials to create soft AP and WiFiManager with captive portal to configure connection to existing network.

Door unit and handset communicate using bare UDP packets and simple 1-byte commands.

There are two copies of known keys, main on the handset unit, managed via MQTT commands and a copy synced via UDP on door unit.

There are several reasons behind this setup:

1. Handset unit effectively acts as WiFi range extender.

2. I don't like having device with no encryption and easily accessible by any stranger directly connected to my internal network.

3. Door phone main function should not depend on any other hardware.

All management done in Home Assistant via MQTT.

Handset subscribes and publishes to several topics:

yard/gates/lock/setLOCK/UNLOCKLock control
yard/gates/lock/statusLOCK/UNLOCKLock status
yard/gates/keys/add[UID];[COMMENT][UID] - RFID uid in hex format - XX:XX:XX:XX
[COMMENT] - e.g. key holder
yard/gates/keys/delete[UID]Delete key, format is the same as for adding,
but without comment
yard/gates/keys/listALLIn response to this messages handset unit
publishes list of known keys to "yard/gates/status" topic
yard/gates/statusThis topic used to display status notification.

e.g. "Connected", "Unknown key scanned" and list keys.

This is what control group looks like in Home Assistant UI:

Add/Delete/List operations implemented as scripts with "mqtt.publish" actions. Lock configured as standard MQTT lock component.

Home assistant config can be found in github repo with the rest of code.


Some rough schematics made in KiCad

Perfboard layout

To make things a bit easier I designed "PCB"s in KiCad with grid set to perfboard spacing. Traces placed on front layer and outside board meant to be jumper wires when actually soldering this stuff.

Handset wiring was pretty straightforward, so I slapped it together with wires (and it looks horrendous as a result).

If you think those are bad, you didn't see my initial "schematic" :D

  • 2 × ESP8266 ESP-12 modules
  • 2 × ESP-12 breakout board
  • 2 × MCP3021 or TLC549 ADC Data Converters / Analog to Digital Converter ICs (ADCs)
  • 1 × 3.3V DC-DC step-down power supply module
  • 1 × DC motor driver

View all 12 components

  • Next steps

    Alexey01/18/2019 at 18:27 0 comments

    Next I'd like to add a secondary door bell unit in another side of the house and maybe some OS level notification for computer or mobile devices.

    It would be nice to to answer door phone from mobile devices, but not idea how to implement it yet.

View project log

Enjoy this project?



Sophi Kravitz wrote 01/20/2019 at 18:21 point

Hey Alexey- any chance you could write up the MQTT part of this project? It would be really helpful to many of us. cc @Frank Buss ;)

  Are you sure? yes | no

Alexey wrote 01/20/2019 at 18:42 point

Sure, I'll add network setup section to project details.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates