Arduino Doorbell Messenger

Posted on Mar 28, 2016 in Sundry
james portrait
James Jacoby
Chief Technology Officer, Founder

The goal for this project was simple: receive a push notification whenever someone presses my doorbell. This was made possible (cheaply) by using one of my favorite products from Adafruit: the HUZZAH ESP8266 Breakout Board. This $10 microprocessor has built-in WiFi capabilities, so it's perfect for little IoT projects like this. This project could be built a number of different ways, but my approach aims to be cheap and easy to install.

Parts Required

Circuit Setup

The circuit is very simple. All we need to do is power the HUZZAH, hook up the inputs and outputs, and control the doorbell's solenoid using a transistor. Normally, doorbells operate on 12-20 volts AC. However, controlling AC current is potentially more complicated, dangerous, and expensive. Most doorbells also function on 12V DC, so that's the route I took. For the short intervals in which it will operate this should not be a problem (although I'd love to hear any criticisms).


In order to receive commands over the internet and send text messages, two services are needed:

  • Twillio is a cloud messaging service, which offers an API to send text messages. After signing up, it's easy to create a phone number for sending messages.
  • Temboo is an IoT hub that can interact with many other services, including Twillio. Each interaction is organized into a "Choreo" which you can save and call from code using their software kit. Creating a Choreo for Twillio gives you a key for activating the task.


For anyone new to Arduino, I suggest reading Adafruit's Introduction to the HUZZAH. Once you have figured out how to make it blink, just copy and paste the following gist into the Arduino IDE and replace all the #define values with the actual values from the previous step. 

#include <SPI.h>
#include <ESP8266WiFi.h>
#include <Temboo.h>



WiFiClient client;

int last = -1;
int inputPin = 2;
int flashPin = 0;
int outputPin = 4;

// prototypes

void sendSMS();
void flash(int times);

void setup() {
  // Init pins
  pinMode(inputPin, INPUT);
  pinMode(outputPin, OUTPUT);
  pinMode(flashPin, OUTPUT);
  // Init serial output

  // Init Wifi
  int wifiStatus = WL_IDLE_STATUS;
  while(wifiStatus != WL_CONNECTED) {
    wifiStatus = WiFi.begin(WIFI_SSID, WPA_PASSWORD);

    if (wifiStatus == WL_CONNECTED) {
    } else {

  Serial.println("Setup complete.\n");

void loop() {
  int value = digitalRead(inputPin);
  if (value != last) {
    last = value;
    if (value == LOW) {
      digitalWrite(outputPin, HIGH);
      digitalWrite(outputPin, LOW);
    } else {
      digitalWrite(outputPin, LOW);

void runSendSMS() {
  TembooChoreo SendSMSChoreo(client);

  // Set Temboo account credentials

  // Set profile to use for execution
  // Identify the Choreo to run

  // Run the Choreo
  unsigned int returnCode =;

  // Read and print the error message
  while (SendSMSChoreo.available()) {
    char c =;

void flash(int times) {
  while(times-- > 0) {
    digitalWrite(flashPin, HIGH);
    digitalWrite(flashPin, LOW);

I highly recommend getting everything working at your workstation before installing. You can simulate a button press by grounding the input pin and test the circuit with a multimeter. The meter should read 12V very briefly off the transistor and you should receive a text message! 

If you're feeling creative, you could easily modify the code to ring the bell using a different rhythm.


Warning: The following steps involve potentially dangerous electrical work- if you don't know what you're doing, just stop. 

First, shut off the power to your doorbell. Test the doorbell before and after and take all other necessary precautions to ensure the power is off. 

Next, locate your existing doorbell transformer (usually in your basement) and disconnect the wires from it. If you're lucky, there will be two sets of wires - one for the push button and one for the solenoid. In a normal installation, the button closes the circuit and activates the solenoid to ring the bell. We are going to change it so the button is an input for the Arduino, which will then programmatically control the solenoid using the transistor circuit and external power supply.

Lastly, mount the board somewhere safe, connect the wires as show in the schematic and plug in the power supplies.

With the power back on, you should get a satisfying ding-dong, follow shortly by a text message.

Improving Design to Dev Workflows: Asset Sheets What Distance Running Teaches Us About Web Design