Create a DIY Smart Doorbell with ESP and Alexa

Learn to create a smart, DIY doorbell using ESP and Alexa in this easy guide.

Posted by Nina Alvarez on April 20, 2025 · 6 mins read

Create a DIY Smart Doorbell with ESP and Alexa

Introduction

Imagine this: You’re enjoying a relaxing afternoon at home when suddenly, you hear the sound of the doorbell. Instead of rushing to the door, you glance at your smart device to see who it is, all thanks to your DIY smart doorbell! If you’re a fan of smart home automation like many of us are, then creating your own DIY smart doorbell using ESP (Espressif Microcontroller) and Alexa can be an enjoyable and rewarding project.

This blog post will guide you through the step-by-step process to build your very own DIY smart doorbell. Whether you’re a beginner or someone looking to sharpen your skills in automation, we’ve got you covered. Let’s get started!

Step-by-Step Setup Guide

What You’ll Need

Before diving in, make sure you have the following components:

  • ESP8266 or ESP32: These microcontrollers are perfect for Wi-Fi-connected projects.
  • Push Button: This will act as your doorbell button.
  • Buzzer: For audible notifications.
  • Resistors: 10kΩ should work for the button.
  • Breadboard and Jumper Wires: For connecting everything.
  • Node-RED: A fantastic tool for creating flows and integrating with Alexa.

Step 1: Set Up Your ESP with Node-RED

  1. Install Node-RED: If you haven’t installed Node-RED, follow the official guide.

  2. Integrate Alexa: To allow Alexa to interact with your Node-RED flows, you can use the node-red-contrib-alexa-notifyme module. This will help you set up notifications and announcements.

  3. Configure your ESP Board: You’ll need to initialize the ESP with the Arduino IDE. Install the ESP8266/ESP32 board via the Board Manager, and then upload a basic Wi-Fi connection sketch.

Step 2: Wiring Your Components

Now, let’s wire your components together:

  • Connect the Push Button: Connect one terminal of the button to a digital pin on the ESP (let’s say D2), and the other terminal to ground. Also, connect a 10kΩ resistor between the GPIO pin and ground to create a pull-down resistor.

  • Connect the Buzzer: Connect one wire of the buzzer to a different digital pin (D5) on the ESP, and the other wire to ground.

Step 3: Load the Code

You’ll need to write the code that handles the button press event and communicates with your Node-RED flows. Here’s a simple example:

#include </code>

const char* ssid = "Your_SSID"; const char* password = "Your_PASSWORD";

const int buttonPin = D2; const int buzzerPin = D5;

void setup() { Serial.begin(115200); pinMode(buttonPin, INPUT); pinMode(buzzerPin, OUTPUT); WiFi.begin(ssid, password); }

void loop() { if (digitalRead(buttonPin) == HIGH) { Serial.println("Doorbell pressed!"); digitalWrite(buzzerPin, HIGH); // Turn on buzzer delay(1000); // Buzz for 1 second digitalWrite(buzzerPin, LOW); // Turn off buzzer // Replace with your Node-RED flow URL WiFiClient client; client.begin("http://your-node-red-ip:1880/doorbell"); client.get(); delay(2000); } }

Make sure to replace "Your_SSID" and "Your_PASSWORD" with your actual Wi-Fi credentials and update the URL to your Node-RED instance.

Step 4: Create Node-RED Flows

  1. Set Up an HTTP Endpoint: In Node-RED, use an “HTTP In” node to create an endpoint that listens for GET requests from the ESP.

  2. Add a Function Node: Use a function node to handle incoming requests. You can put your logic here to trigger Alexa to announce that someone is at the door.

  3. Set Up an Alexa Announcement: Use the node-red-contrib-alexa-notifyme module to send notifications to your Echo devices when the doorbell is pressed. You can configure what announcement Alexa should say, like “Someone is at the door!”.

You can find even more inspiration and basics on how to set up your flows in Node-RED dashboard examples.

Helpful Tips Block

  • Test Each Part Separately: Before assembling everything, test your ESP Wi-Fi connection and ensure your Node-RED flows are working properly.
  • Customize Alexa’s Response: You can make the announcement funny or whimsical; get creative with it!
  • Check Your Connections: If the doorbell isn’t responding, double-check your wiring and code for any common mistakes.

Common Issues & Troubleshooting

  1. ESP Not Connecting to Wi-Fi: Ensure you’re using correct credentials and that the Wi-Fi signal is strong.
  2. Node-RED Not Responding: If you can’t access your Node-RED instance, ensure it is running and reachable from your ESP.
  3. Buzzer Not Working: Check the wiring and ensure the buzzer is functioning. Occasionally, the GPIO pin might be configured as input instead of output.

Final Thoughts

Building your own DIY smart doorbell with ESP and Alexa is not only a fun project but also enhances your smart home capabilities. With a little coding and the Node-RED platform, you can create a reliable smart notification system, ensuring you never miss a visitor again.

Take your time with each step, and don’t hesitate to experiment with different features. Before you know it, you’ll have a fully functioning smart doorbell that integrates beautifully with Alexa. Enjoy the process and happy building!


Now go ahead and get started with your DIY smart doorbell project! If you have any questions or need further assistance, feel free to leave a comment below.