Close
0%
0%

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.

v1.0 update

For v1 I made two major changes.

Disable AP/STA mode

After one year of use it proved to be pretty reliable with one exception: due to "gateway" mode, when handset unit served as an access point for outdoor unit and as a client for indoor WiFi, it would occasionally loose connection between handset and door for 10-30 minutes. Probably it had something to do with connection to home network, router switching channels, renewing lease or whatever and ESP trying to reconnect. When home router was powered down, handset and door would not connect at all, as ESP would constantly search for home network. When connection to home network was disabled this problem when away completely. As pretty much only purpose of connection to home network is adding/deleting keys, which I didn't do for entire year, I decided to ditch it.

Instead of MQTT for managing keys I've added a simple web-interface powered by Vue.js and Bulma.css.

Switch to i2s DAC

I got rid of MCP4725 DAC and replaced it with i2s-compatible PT8211/TM8211 16bit DAC. I connected MCP3201 CS and TM8211 WS pins, as a result I can read sample from ADC and send sample to DAC in the same SPI transfer, which happens in background via hardware peripheral. I've update ISR handler to read previous transfer result first, then start next transfer and return immediately.

Ditching MCP4725 requiring software i2c allowed me to run esp8266 at normal 80MHz, which contributed to stability as well.

I got rid of long analog connections by moving ADC and DAC to speakerphone, now all the communication between ESP and speakerphone panel happens via SPI. For this purpose I designed and etched a small board (gates-v1-speaker.kicad-pcb) for ADC, DAC ICs and MFRC522 connector.

Handset

Now all components of indoor unit are encased in handset. Pickup/hangup triggered with reed switch in the back of the handset and a magnet in the stand.

3D-printed enclosures

3D-printed parts were designed in OpenSCAD.

Some details

Main board of the door unit:

Main board populated with breakout boards: ESP-12, DC-DC converter, motor driver. 

Lock controller moved to attiny13 on the back side:

Layout of components in the speakerphone panel:

Layout of components in the handset:

Ringtone speaker, reed switch and microUSB port mounted on the back cover.

Original (v0.1) build

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...

Read more »

  • 2 × ESP8266 ESP-12 modules
  • 2 × ESP-12 breakout board
  • 2 × MCP4725 breakout board
  • 2 × PAM8403 Amplifier board
  • 1 × PT8211/TM8211 i2s DAC (replaced MCP4725 in v1)

View all 14 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?

Share

Discussions

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