Most apartments these days have electronic door buzzers that let you buzz visitors into your apartment complex from the front door. I thought it would be pretty cool to be able to let myself into my building from my smartphone, or give access to my friends so that they can buzz themselves into the building instead of waiting outside. The electronically controlled door buzzer was an easy target for this and this guide will explain how I control, what I think is a common door buzzer design, from my smartphone.

Preparing

You will need just a few things to get this working:

  1. WeMos D1 mini
  2. WeMos Relay shield
  3. Tools
    • Soldering iron to construct the relay shield
    • Multimeter to examine your door buzzer

Door Buzzer Circuit

The door buzzer in my apartment is incredibly simple, it’s just a button that momentarily connects two terminals which signals the door to unlock. The idea is that in addition to the button closing the circuit, I’ll add a relay in parallel with the button so that when either the button or relay closes, the circuit will be closed and the buzzer will actuate the door lock. I measured the open circuit voltage of my circuit as 24V and the closed circuit current around 20mA, just within the safe operating zone of the relay shield which supports up to 28V and 10A.

Door buzzer

Programming the WeMos

You can program the WeMos however you like, but I used my MRPC library to skip some of the more boring boilerplate. The idea is to expose a service like door.buzz() which will close the relay for a few seconds. The sketch can be found in the MRPC library examples, but I’ll include it in full here since it’s relatively short:

#include <mrpc.h>

using namespace Json;
using namespace MRPC;
unsigned long start_buzz;

Value buzz(Value &arg, bool &success) {
    start_buzz = millis();
    digitalWrite(D1, true);
    return true;
}

void setup() {
    Serial.begin(115200);
    init(50123);            //Begin MRPC on UDP port 50123
    pinMode(D1, OUTPUT);
    create_service("buzz", &buzz);
}

void loop() {
    poll();
    if(millis() - start_buzz > 2000) {
      digitalWrite(D1, false);
    }
}

Connecting the Relay

First attach two wires to the relay, and verify you picked the two terminals that are connected when the relay is closed and not open.

Then find and attach the wires to the two terminals that connect to the buzzer button.

Mine had a nice label, but you can just find them with a multimeter in connectivity mode.

Seal it back up, and hope that management doesn’t ask you where that wire is going to.

Buzzing yourself in

The easiest way to use your new door buzzer is to download the Enlight app from the Play Store. Otherwise MRPC is easy enough to use so you can develop your own applications that talk to your door buzzer.