DIY Smart Doorbell, a non-invasive way!

DIY Smart Doorbell using Wemos D1 Mini

Smart doorbells are fun and useful to have but they are usually expensive. In this video, I will show you how I upgraded a typical doorbell and connected it to Home Assistant in a non-invasive way - for cheap!

Components used (Amazon links - affiliate):

Components

I powered the d1 mini using the doorbell AC power supply after I converted it to DC then used a reed switch connected to D5 to detect the doorbell chime as shown in the schematic below.

Components

Most doorbells are powered by a 21 volt AC current. To get a DC current, I first passed it by a diode and then added a 680micro farad capacitor to smooth the output. This is called a half bridge rectifier. Last step was to add a buck converter to drop the voltage down to 5v.

Now that the circuit is ready, it was time to put it all together. I used a 3x7 perfboard and mounted all components according to the schematics. I tested everything to make sure the 21 volt AC current is converted into a 5v direct current. Once everything looked good, I cut the extra perfboard area.

Next, I printed a small case to easily mount it: WEMOS D1 Mini Bumper Mount by Mitzpatrick - Thingiverse

Back at the laptop, I connected the D1 mini to load Tasmota. Next, I followed a typical Tasmota setup to connect it to my network. Once the device was connected, I updated all the settings though the console. You can find the full command line here. Just make sure you update the MQTT IP address and the credentials.

Next, it was time for the integration.

Components

Before I started, I disconnected the power. Attaching the device to the doorbell was easy: (1) I removed the cover, (2) attached the device to the wall using screws, (3) connected the power wires, (4) attached the reed switch using double sided tape (5) and put back the cover.

Back in home assistant, I opened the configuration file and added a new MQTT sensor, saved and restarted. The code is in the description. After I saved, I restarted home assistant.

This doorbell sensor can be used to trigger alerts or any other Home Assistant automation!

I configured it so it sends me an alert and shows me a stream from my security camera on the TV when someone is at the door.

I hope you find this useful!

Thank you for reading!

3 Likes

I would add

device_class: door

to the binarysensor

1 Like

I converted my doorbell but using ESP-01, some challenge appeared due to its 3.3V DC power requirement and I did not use MQTT instead from ESPHome I directly created binary sensor with doorbell switch pressed. Below is the schematic diagram:

Below is the ESPHome doorbell.yaml:

esphome:
  name: doorbell
  platform: ESP8266
  board: esp01_1m
wifi:
  ssid: "YourSSID"
  password: "YourPassword"

  # Static manual IP
  manual_ip:
    static_ip: 192.168.0.229
    gateway: 192.168.0.1
    subnet: 255.255.255.0
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "doorbellHotspot"
    password: "test1234"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "somepassword"

ota:
  password: "somepassword"

binary_sensor:
  - platform: gpio
    name: "Doorbell"
    pin: GPIO2
    filters:
    - invert:
    - delayed_off: 999ms

Every time doorbell switch is pressed I am receiving binary sensor state ON but duration is very short to update icon changes etc. and still trying to tune ON state duration using delayed_off. Automation based on binary_sensor state is working fine and I am able to send messages or play doorbell ring mp3 on my sonos player.

There was no need for any external box requirement for final circuit; entire thing tightly fit well onto a 3cmx7cm PCB, I have to file PCB edge about 0.5mm in length using sand paper. I paced a very thin plastic layer (from a food package box) between buck converter PCB and my base board PCB, that assembled everything. There was need to find appropriate location, on PCB, for a large 35V capacitor to be accommodated inside doorbell original box. In addition to this, first time I programmed my ESP-01 using CH340G USB adapter placed directly on my raspberry HA server USB port, now everything is OTA.

For your reference below is DC-DC buck converter, you may find it at amazon:
Lysignal LM2596 DC-DC Step Down Power Supply Module 3A Adjustable Step Down Module Buck Converter 24V to 12V 5V 3V
**DC2**DC_BuckConverter

2 Likes

I would like to know how and since Indonesia is running 220V its much difficult to find a schematics

What I understand that very likely voltage across doorbell switch would be 220V AC but you need to identify if doorbell box has any step down transformer inside, you need to get the voltage that feeds the doorbell circuit. Basis that you need to choose your dc to dc buck converter circuit, rest all should remain the same. This is for very old doorbells.

However it will be lot easier to convert later versions of doorbells, having multiple musical ring tones as those would operate with DC power supply ranging 5V-12V and you can appropriately step down to supply ESP board. Hope this helps.

1 Like