Internet of Things explorer and Open Source contributor.

For just $2, convert any existing wired doorbell into a smart doorbell; using ESPHome and Home Assistant

F

This article is going to show you how to convert your (existing) wired doorbell (also works for battery-powered chimes) into a smart, WiFi-enabled, doorbell. The essential components needed sets you back about $2, yes, that is correct, just two bucks. No soldering is required and you don’t have to be an electronics expert.

Photo of the resulting DIY Smart Doorbell on my test bench
The result of this DIY Smart Doorbell project on my test bench, ready to be installed

Integrating your doorbell into your smart home is a very logical step to take. Making your doorbell smart, allows you to do cool things with it, for example:

  • Turn the chime/bell off after a specific time, when the kids or you went to bed. Also, turn it on again in the morning.
  • Send out push notifications to your phone/tv/watch/smart speaker, on the doorbell button push.
  • Take a snapshot from a front door camera, on the doorbell button push.
  • Stream your front door camera to your TV, on the doorbell button push.
  • Ring the doorbell continuously in case of an emergency (e.g., smoke detectors triggered).

I have provided some of these automations for Home Assistant, as an example, at the end of this article.

The method I provide is, of course, not the only solution. However, I guarantee it is the cheapest out there and a great way to get into DIY. The feeling of having it made yourself is satisfactory beyond any other solution.

Are you curious yet?

How does a doorbell work; Before and after.

Before we start doing anything, let’s take a quick look at how a wired doorbell works. For this article, I am going to assume a wired and AC powered doorbell. However, battery-powered chimes are not that different, and I’ll provide instructions for that as well.

Shows a regular doorbell circuit/wiring schema
Regular doorbell circuit schema

A pretty standard doorbell set up has a power supply, hooked up directly to the chime. Prevent the doorbell chime going continuously, the circuit is interrupted by the doorbell button, which acts as a switch. The circuit is only active/complete when the doorbell button is pushed. Hence, your chime turns on when someone pushes the doorbell button.

Shows an circuit/wiring schema for the DIY Smart doorbell
DIY Smart doorbell circuit schema

The image above should give you an idea of the result of this article. Basically, you are going to split your doorbell circuit into two separate circuits. One circuit detects the doorbell button push; the other circuit controls the chime. This split allows for controlling those separately, e.g., detecting a doorbell push from Home Assistant, without activating the chime.

The device we are using is going to act as a sensor for the doorbell button push, and acts as a switch for the chime. Effectively, we are moving the activation of the chime from the doorbell button, to the new device. Our new device needs power, and since the one used consumes 5 volts. Any old USB phone charger you have, does the job just fine.

Smart doorbell stuff you’ll need

To achieve this, you need some “stuff”. The $2 price tag is based on the actual device we are going to create, however, if you don’t have some of the needed tools, that would raise the total price. Nevertheless, the additional stuff is really cheap and are things that, in my humble opinion, every DIY home automator should have in their toolbox (for future projects).

Based on the country you are in, additional shipping costs may apply. I live in the Netherlands, and I’ve paid 1,80EUR in total, including shipping. Checking out the different sites for the right price helps. I’ve noticed the prices for these little boards vary, but getting it for around $2 is doable.

The main components

This project consists of just 2 parts. An ESP8266-based chip called the ESP-01S and a small board with a relay on it.

Product image of the ESP-01S chip

ESP-01S

The ESP-01S is one of the smallest WiFi boards available, that works ESPHome and Home Assistant.

Product image of the ESP-01(s) relay module board

Relay module

This relay module board for the ESP-01(S), It comes pre-soldered, and the ESP will just slide on top of it.

The nice thing about these two is that they fit together, are pre-soldered and often sold together. There is also another version of the ESP chip, without the S, the ESP-01. That chip is viable for use as well, however, the ESP-01S is an improved version and has double the amount of memory. Since the price difference is just a couple of cents, I would highly recommend getting the S version.

The board needs to be powered and requires 5 Volts. Lucky, most phone chargers provide those and I’m sure most of you have an old one around you could use.

That brings me to the shopping list of the main components needed:

Other tools and hardware

Besides the main components, you’ll need some other things for building it as well. Without a doubt, you need some screwdrivers and a wire stripper. A pair of tweezers can also help put wires to place, and for modifying to the board later on.

The ESP01-S chip needs to be programmed. To do that, you’ll need an FTDI adapter. If you have ever flashed ESP chips before (e.g., SonOff switches), you probably already have one. If not, you should get one! It is an essential tool to have when you are into home automation.

Product image of an FTDI adapter

FTDI Adapter

An FT232RL FTDI USB To serial converter adapter is a must a have
for any smart home enthusiastic to have in its toolbox.

Click here to get one

Additionally, some wire is needed. I always have a bunch of Dupont cables in stock. They are really helpful in many many projects I’ve done. It allows you to wire up prototypes really quickly as well.

Product image showing a bunch of Dupont wires

Dupont wires

Having a collection of Dupont wires with different male/female connector combinations, is useful to have around. It allows for quick DIY prototypes, but useful in final projects as well.

Product image of a Dupont crimper set

Dupont crimper

Alternatively, create your own Dupont wires using a wire crimper. It is way more flexible compared to pre-made wires.

Depending on where you are going to place the smart doorbell, you might be need a case as well. The resulting board is pretty small. Maybe it can already fit one of your electrical boxes. Another option is getting a small project box online, like this one:

Product image showing a small project box

Small project box

Small project boxes really finish a DIY project and make them look slick while protecting the electronics as well. For this project, a small box like this does the trick.

Needed software

Obviously, you need some software to pull this off. All software used is open source and free for you to use.

Home Assistant is my home automation hub of choice, and for this guide, I assume you are using it as well. However, this project can be used on other hubs as well (like Domoticz or OpenHAB). I’ve added a section at the end of the article for more information about this.

Modifying to the ESP-01S chip

To make this setup work, you would have to make a small modification to the ESP-01S chip. Reason for this modification is that you have to free up an additional pin for connecting your doorbell button. These input/output pins, are called GPIO pins.

The ESP-01S has two GPIO pins available. Using the relay board, one of the GPIO pins is wired to the relay, the other is wired to a reset mechanism. Without this modification, a doorbell button push would result in a reset/restart of the chip, which of course, isn’t what we want.

Don’t worry, this modification is easy. We need to bend the GPIO2 pin from the ESP-01S. This allows you to access the pin for connecting the doorbell button, while disconnecting it from the relay board.

The lost reset functionality is later be restored via a software switch in ESPHome. Furthermore, the reset button on the side of the relay board isn’t affected by this and keeps working as a reset button as well.

Flashing the firmware on the chip

This project uses ESPHome to create firmware for the ESP-01S chip. I’m not going to make a full tutorial on how to set up ESPHome since that is really well covered on their website. So, before continuing, make sure you’ve set up ESPHome.

For the rest of this guide, I’m going to assume you are running Hass.io. However, the ESPHome getting started guide for non-Hass.io users is extremely detailed, and you should be able to adapt easily.

Creating, building and downloading the firmware

Create a file called doorbell.yaml; for Hass.io users, create the file in the /config/esphome folder, so you end up with the file: /config/esphome/doorbell.yaml.

Next, add the following contents to the file:

The above file shows a ESPHome project definition; the ESPHome project code, or also referred to as ESPHome YAML. The code describes the firmware allowing ESPHome to generate it. I’ve have tried to add as much additional text as possible to the above, to help you understand how it works.

On line 9 & 10, make sure to set your WiFi details or else you might end up with failures. Save the file and open up the ESPHome web interface; The doorbell project should appear!

Now, you should be able to validate, build and download the firmware from ESPHome. Let me show you a screen recording on how that works:

Animation on how to validate, compile and download ESPHome firmware
Doorbell ESPHome: Validate, compile and download

Uploading the firmware to the ESP-01S chip

Image shows my ESP-01S being flashes for the smart doorbell
Flashing my ESP-01S for the smart doorbell

Now you have the firmware (the downloaded doorbell.bin), you can start putting it onto the ESP-01S chip for use. This flashing procedure is the hardest part, and if you are new to this, please have some patience, it might need a couple of tries for you get it right.

Start with wiring up the ESP-01S chip to the FTDI adapter, using some Dupont wires. Don’t freak out now, we only need to do this once. Once you’ve flashed the chip, future flashing/upgrades can be done Over-the-Air (OTA) via WiFi. Wire the FTDI & ESP-01S according to the following wire schematic:

Illustrates how to wire an FTDI adapter to an ESP-01S chip.
FTDI to ESP-01S Wiring Schema

Make sure to double-check the wiring and set the FTDI to 3.3V. Even if you are an experienced flasher of ESP chips, please note, the VCC/3.3V and ground wires being double wired! Although, I’ve used a very common FTDI board in this schema, your FTDI might look different, ensure you wiring up correctly by verifying the names on your board.

Ready to flash? Good!

Plugin the FTDI adapter to your PC, and start-up the ESPHome Flasher tool. Yes, I know, it is possible to flash directly from ESPHome itself, however, if you are like me: I don’t have the machine running Home Assistant near my desk. Furthermore, it can be quite a challenge for people running Hass.io on a virtual machine. The ESPHome Flasher is easy to use and just works from your desktop.

Select the available serial port, and load the downloaded doorbell.bin file, by clicking the “Browse” button. Start the flash procedure by clicking the “Flash ESP” button. The console shows you the progress and tells you when it finishes.

Animation on how to flash firmware using the ESPHome Flasher
Flashing firmware using the ESPHome Flasher

If this process fails, please make sure to check your wiring. A common mistake is mixing up the TX/RX wires between the FTDI & the ESP-01S. They should be cross-connected (TX -> RX, RX -> TX).

Installing and wiring your smart doorbell

Time to install your newly created smart doorbell. The following schema helps you to connect the wires correctly.

This image shows how to wire up your smart DIY doorbell.
DIY Doorbell Wiring Guide

Please note, how the ground wire from the phone charger is shared with the push button. To hook up the push button to the bent GPIO-2 pin, I recommend using a Dupont wire, since you can slide it right onto the pin in that pretty tight space.

Photo of GPIO-2 wired with a Dupont wire
Wiring the GPIO-2 pin with a Dupont wire

If your chime is a battery-powered one, the schema does not differ that much. Just act like the transformer is not in the above image. The two connections from the battery-powered chime, connect directly connect to the board (to the COM and NO labeled ports).

Done? Awesome! Pushing the doorbell button should now ring the chime already! So basically, you’ve now ended up with what you had already…

Now you can continue to configure your smart doorbell in Home Assistant, let the fun begin!

Integrating with Home Assistant

Welcome to the easier part of this guide. Integrating your new, self-created, smart doorbell with Home Assistant. Home Assistant will discovery it automatically. The only thing you need to do is to activate it and unlock a bunch of new entities for you to play with.

This screen recording shows how that works:

Animation on how to integrate the DIY smart doorbell with Home Assistant
Integrating the ESPHome DIY smart doorbell with Home Assistant

Home Assistant smart doorbell automations

At this point, you have a WiFi-enabled doorbell. Is it smart already? Not really…

Adding some automations to Home Assistant would make it really smart! There are many automations one could create with this. However, let me give you a couple of basic and useful examples.

Sending notifications to your phone

This little automation sends a notification to our phone when someone is at the door. We have Apple iPhones and watches, so those notifications would end up on our wrist as well, even if the chime is disabled!

Disable the chime during the late hours

I have two kids. Nothing is more annoying than the sound of the doorbell chime about 15 minutes after you’ve put them into bed 😞. This little automation will disable the chime during the late hours and enable it again in the morning.

Streaming the front door camera when someone is at the door

This little automation is useful if you have a camera pointing at your front door. If you push the doorbell button, it will send out the camera stream of your front door camera to your living room TV 📺.

More smart doorbell automation ideas

  • Disable the chime when you arm the alarm when home, indicating you went to bed.
  • Use pressure sensors in your bed to turn off the chime when sleeping.
  • Create a camera snapshot when someone is at the door, and send it out to your phone.
  • Use the chime as an alarm bell as well, e.g., in case smoke or water leak is detected.
  • Use facial recognition on your front door camera, to disable the doorbell for the ones you don’t want to open the door for. E.g., an unknown person or your mother in law 😈
  • Prevent over abuse of doorbell pushes, by disabling it for a couple of minutes after it was pushed.
  • Hook the doorbell chime active switch into your voice assistant, allowing you to say “Hey Google, turn off the doorbell”

Optional changes and modifications

There are probably a hundred variations on this approach I took, but that was not the point of this guide. However, some are worth mentioning.

Using the chimes’ power supply using a step-down

In my case, my doorbell chime is powered by 8 Volts (DC) from the transformer. While to voltage is too high for the board, I could have used a little regulator to “step-down” from the 8 Volts to the 5 Volts required by the board.

Product image of an AMS1117 step down to 5v

DC Voltage Regulator Step Down
4.75V-12V to 5V 800mA

The pin headers are usually delivered separately, so this would require soldering.

These “step-down” are available for around a dollar on AliExpress. However, since I have enough older chargers I could use, and do have a power outlet available in my utility closet (where the doorbell wires are at); I saved myself the extra buck 😉.

Using multiple doorbell buttons (e.g., front- & backdoor)

In some homes, there are multiple doorbells. E.g., one for the front door, the other for the back door. Mostly they are connected to the same chime. There are three ways to use this guide in those cases:

  1. Connect the doorbell push buttons in parallel to a single chip. This is fast and cheap, however, you cannot distinguish which button was pushed.
  2. Connect two of those boards in parallel to the chime. You would need two boards and one chime, however, you can still distinguish the doorbell pushed.
  3. Replace the ESP-01S and relay board with one of the bigger brothers. Those provide more GPIO pins. However, it would be more expensive compared to using just two of this project.

Using MQTT (e.g., for use with OpenHAB)

Are you not using Home Assistant? Really? Or maybe you prefer to use MQTT with OpenHAB, Node-RED or Domoticz. Well, you can use this project as well! ESPHome provides an MQTT interface.

For more information about using MQTT with ESPHome, refer to the ESPHome MQTT Client Component documentation.

This article is not about a smart doorbell…

I hope you enjoy your DIY smart doorbell! However, now the time has come for me to come clean. This article was never about the doorbell! This article is about showing you how easy, fun, and cheap DIY smart home solutions are. ESPHome & Home Assistant are just amazing tools to allow everyone to jump in and create amazing things.

The ESP-01S is an amazingly cheap and tiny ESP8266-based board, that is rarely considered or discussed nowadays. Mostly you’ll find articles and references to her big brothers; the ESP8266 and ESP32. However, if you need just one or two GPIO pins, it is a viable option.

Consider this: Replace “doorbell” with “bedside LED light” in this article… 🤯. Anything with a switch and/or button can be replaced by this board (stay within the power limits of course).

But did you know, you can buy other module boards for the ESP-01S as well?

Product image of a RGB Led module for ESP-01(s) chips

RGB LED
module

This RGB led module goes for about a dollar and can control addressable LED strips like the WS2813.

Product image of a ESP-01(S) breakout board.

Breakout
module

This little board breaks out the pins from the ESP. Helpful if you want to be able to remove the ESP from your project.

Product image of a DHT11 module board

DHT11
Module

The DHT11 module allows you to build a simple temperature and humidity sensor.

Did you build the doorbell? Nice! I love to see how you did!
Send me a picture of the result via Twitter!

../Frenck

About the author

Franck Nijhof

Home Assistant enthusiast and contributor, Hass.io add-ons creator, IoT explorer, slightly assholic at first sight but actually a nice guy.

18 comments

Leave a Reply

  • thanks for this very good explanation. In your streams, this technical details are not always too clear. Hope you can show some of this more (ventilation setup?), would be highly appreciated.

  • Thanks for this, I was thinking of doing something like this too, first I wanted to create it with a raspberry pi but since I’m just into ESP this is perfect!

  • Thanks French, I’ve made my doorbell smart already where I use my google home as sound device, but since I cannot hear it upstairs I will reuse the original chime like you did. Additionally I use telegram as a notification platform, this way I can also use it to send a video rtsp capture from my cam to my phone.

  • Awesome explanation Frenck! I did mine using Arduino IDE, but will be moving over to ESPHome (using some of what you did here). ESPHome just makes life so much easier.

  • Hi Frenck,
    Great write up, this so much easier to follow than a Youtube clip where you would have to pause and rewind all the time. This I can do in my own pace (which is not to fast 😉
    I love to see one for garage doors from you. Yes, I know, there are dozens of them on YouTube and I’ve seen most of them. Now I can’t see the forest through the trees anymore, which one was the best?
    In my case I’ve got a 2 car garage with one single large door. I would like a push notification if both cars are not in the garage and the door is open. Than be able to close the door remotely use Home Assistant.

  • Don’t understand why continue to use ESP-01S
    when there is a full fledged ESP8266 D1 Mini 4MB + shields.

    D1 Mini + relay shield is smaller, more convenient and it has the micro usb, very useful for flashing\debugging and for powering the ESP via old phone charger.

    • Thanks for your response Davide. The D1Mini + Relay is a good option as well, however, the D1 + shield is not smaller but bigger (especially in height, I own those as well).
      Secondly, the D1 & Relay are not often delivered with soldered header pins (one of the goals of this project was: no soldering, to make it more accessable for users new to DIY home automation).
      Third, this option is cheaper (not much, but still).

      I did consider the D1, by went for the ESP-01, mainly to keep the entrance into DIY as low as possible because of the soldering.

  • Hi Frenck, Nice write-up. I want to understand the “powering of chip” section. You mentioned that you used the usb charger to power since your transformer is located in electrical closet. However from the diagram i see that one wire from door bell switch is going to transformer and one is going directly to the chime. In order to intercept, ESP chip needs both wires connected as input from the switch. How did you get access to those 2 wires? usually, one wire would go directly to the chime (ie: it would not come to the transformer at the electrical box).

  • Hi Frenck, thank you for writing this tutorial. Will build this too. Are you sure you’re using an ESP-01S? In the picture under the headline “Uploading the firmware to the ESP-01S chip” i can see the old 512kb board.

Internet of Things explorer and Open Source contributor.

Franck Nijhof

Home Assistant enthusiast and contributor, Hass.io add-ons creator, IoT explorer, slightly assholic at first sight but actually a nice guy.

Follow Me

Categories