🏡🔔DIY yard bell with ESPHome and Home Assistant

During the last summer I often missed the bell from our front door when I was working in the back yard. This mostly ended up either in a missed package or pizza delivery which was kinda annoying. The solution for this problem was quite simple, a yard door bell and because I love tinkering I wanted to build my own version instead of buying an off the shelf product.

DIY yard bell circuit in a 3D printed case next to a zigbee button.
DIY yard bell in case with zigbee button

Parts list

For this yard bell we will use the following components:

*Some links are affiliate links. If you use them to buy the parts for your project you will help me and my next project. These links will cause no extra fees or costs to you

Top view of all components except the 3D printed case and the Zigbee button
All components except the 3D printed case and the Zigbee button

Starting on a breadboard

Because I had no clue if my idea would work, I started on a bread board. The D1 Mini is hooked up to 3.3V and the buzzer and the vibration motor are connected to two GPIO pins on the D1 Mini (D5 & D6). The idea is to pull both pins high when the Zigbee button is pressed which then turns on the buzzer and the vibration motor. After some delay both pins should turn low automatically. The D1 Mini is running ESPHome which makes it easy to announce both pins as momentary switches in Home Assistant.

Top view of the main circuit on a solder-less bread borad.
Main circuit on a bread board

The ESPHome sketch and Home Assistant

To make the pins available as momentary switches in Home Assistant I used the following sketch. This sketch connects to my Wifi and defines both pins as switches which auto turn off after 750-1000ms.

esphome:
  name: diy-yardbell

esp8266:
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "SuperSecr3t"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Diy-Yardbell Fallback Hotspot"
    password: "SuperSecr3t"

captive_portal:

switch:
  - platform: gpio
    pin: D6
    id: buzzer
    name: "Buzzer"
    icon: "mdi:volume-high"
    on_turn_on:
    - delay: 750ms
    - switch.turn_off: buzzer
    
  - platform: gpio
    pin: D5
    id: vibrator
    name: "Vibrator"
    icon: "mdi:vibrate"
    on_turn_on:
    - delay: 1000ms
    - switch.turn_off: vibrator

After uploading this sketch to my D1 Mini, the two pins show up as buttons in Home Assistant and I was able to create an automation which triggers both switch 3 times in a row with a delay of two seconds.

Screenshot of the details of the ESPHome device with German titles
Details of the ESPHome device with German titles
Screenshot of the Home Asssistant automation
Automation details triggered by the Zigbee button

With that all set I was able to give the project a first test.

Click here to display content from X.
Learn more in X’s privacy policy.

Lets start soldering

After the successful tests everything was ready to solder. I started with the short female connectors and soldered them onto the perfboard. Then I soldered the positive wire of the vibration motor to the D5 pin and the negative wire to the GND pin.

Top view of female connectors and vibration motor soldered to the perfboard
Female connectors and vibration motor soldered to the perfboard

In the next step I soldered the buzzer onto the perfboard. I chose a position where the negative leg of the buzzer lines up with the negative wire of the vibration motor, for easier connection.

Top view of the aligned buzzer
Buzzer aligned on perfboard

To persist the buzzer I soldered it in place and connected the positive leg to the D6 pin.

Bottom view of the soldered perfboard with buzzer connected to pin D6
The complete soldered perfboard

Last not least I soldered the long female pin headers to the D1 Mini battery shield and the male pin headers to the D1 Mini.

Side view of soldered D1 Mini and battery shield
D1 Mini and battery shield soldered

Stack it up!

With the complete soldering I was able to stack everything together. I stacked the battery shield on top of the perfboard that the pins were lined up and placed the battery next to it. Then I realized that my battery wires were a bit to short so I had to extend them a few cm’s. The vibration motor went on top of the battery to keep the form factor small.

Top view of the perfboard with the battery shield stacked ontop next to the battery
Battery with extended wires.

To finish the assembly I stacked the D1 Mini on top, connected the battery to the battery shield and secured the vibration motor with some electrical tape.

Top front view of the complete functional stack.
The complete stack, ready for the enclosure

The enclosure

As a reaction on my testing tweet I got an DM from Evis Home who asked me If I want to try his tinkercad code block for a project box. This was an awesome coincidence, because I simply had to measure the dimension of the perfboard stack, typed that into his script and within seconds the model was ready. I only had to import the lid into tinkercad to add some holes so that the sound of the buzzer was easier to hear.

Top view of the enclosure during the print on a 3d printer
The enclosure during the print

The final yard bell project

After the print was finished I put the perfboard stack into it. It fit’s perfect 🤩. That was the time to test everything for the last time.

Video of the final test

Sum up

After some months of project break, this was a really fun and also useful one 🤓. I really like how simple such ideas can be realized with ESPHome and Home Assistant. With only a few components I could built a DIY yard bell which is much more flexible than a off the shelf product. E.g. you could replace the Zigbee button with a motion sensor or activate the yard bell only in the evening. It’s also possible to replace the buzzer with a sound module that plays you favorite song. The possibilities are up to you 😁 .

As always, if you like this project feel free to ping me on twitter and share pictures of your own build.

Leave a Reply

Your email address will not be published. Required fields are marked *