🏡🔔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 Twitter.
Learn more in Twitter’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.

🖼️ 💡🎨Baroque picture frame lamp

Combining old and new things is something I really like. I often see things and think: “Woaw, how would that look with LED’s on it?” I also like to be inspired by others and try to rebuild projects they built. That happened to me lately as I saw the frame lamp, Paulus from the Home Assistant team built. The idea was so cool that I wanted to build my own version of this frame lamp, so I started to look for the components I needed for this project.

Frontview of the finished baroque lamp
The finished lamp with rainbow effect

Parts list

For this project 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 fee or costs to you

Top view off all parts
All components

Start building this thing

Start with centering the Dig Uno case in middle of the backside of the frame and screw it down. The case and the two angles will work as stands for the frame later on. Alternatively you can skip this step if you want to hang the frame.

Top view of the open case screwed on the backside of the frame.
Dig Uno case screwed on the backside of the frame

Next up, solder three cables to the beginning of the led strip. If your strip is brand new you can simply snip off the connector because the wires will be connected directly to the Dig Uno.

Top view of three cables soldered to the beginning of the LED strip
Soldered cables on the LED strip

Cut the strip

In this step, the strip will be cut and lined up with the frame. Check the dimensions of the frame and cut the strip in parts so that it fits on the backside including the corner connectors. This step is just to find the right dimensions for the strip, don’t glue it down yet.

Backside of the frame lined up with the cut LED strip
Aligned strip on the backside of the frame

If the strip has a good length for the frame, connect the strip using the corner connectors. If you’re using IP65 strips like I do, you have to cut off a bit of the silicone coating.

View of the connection with corner connector and LED strip
Strip connected to the corner connector

Testing and hot glue

Before you glue down the strip to the frame, give it a test using a multimeter in continuity test mode. You should test the positive and negative rail to ensure that both have a good connection. Keep in mind that this will not work on the data-rail of the strip. If one of the two rails don’t work, check the connections on the corner connectors.

Image of the continuity test
Testing the connections

Next up, pull off the blue PVC from the double sided tape on LED strip and glue it to the frame. Then heat up you hot glue gun and hot glue the heck of it 😅 ensure that all corner connectors are glued down to the frame so that nothing can fall apart or loose connection.

Top view of corner connector glued to the frame
Corner connector glued down

If you have so much trust into the double sided LED strip tape than I have, you can add some extra hot glue to the strip.

Image of LED strip glued to the frame
Double secured LED strip 😬

Connecting the Dig Uno

In the final section we will connect the Dig Uno to the strip and place it into the case. If you don’t know what a Dig Uno is, no problem! You can find all information about it on the quinled.info website. You can either buy a pre-assembled board with WLED installed or, if you’re a DIY lover like me, you can build the DIY version and get your hands dirty, which is a lot of fun 🤩

So grab the Dig Uno and place it into to case mounted on the frame. Then connect the LED strip to the controller board.

Dig Uno connected to the LED Strip.
Connected LED Strip

Last not least connect the power supply to the Dig Uno as well.

Power connected to the Dig Uno
Connected power supply to the Dig Uno

Build the stand

This step is optional, if you want to hang your frame lamp. But if you want to stand up the frame the angles on corners of the frame will give the whole construction more stability. So take the angles and screw them to the corners of the frame.

Angle screwed on the backside of the frame
Angle stand for the frame

Final test

That it! So turn the frame and power it up to the the awesome result 😎 The frame works best on a white background, cause this will reflect the LED light better than a dark background.

Front view of the finished frame lamp
The final result

Sum up

I really like this project, because its easy to build, requires nearly no soldering and it just looks beautiful. Big thx again to Paulus form Home Assistant for this idea and stunning result. 🤗

🔨〽️💦diy filament humidity sensor

If you dive in to the deep ocean of 3D printing, you will face the situation of storeing your filament in a proper way sooner or later. To be more precise, you want to keep your filament as dry as possible because most filaments absorb moisture. If you store your filament in a large box like I do, the humidity value in that box is kinda important. That was exactly the motivation behind this diy project. Of course, that’s not the only case for such a sensor. You can use it in many different scenarios where the humidity and or temperature value becomes important 😉.

Topview of the complete sensor.
The finished sensor ready to use

The Idea

I wanted to create a relatively small sensor, which is battery powered, rechargeable and can be easily integrated into Home Assistant. After some research, I decided to go with the following setup. A simple ESP8266 (D1 Mini) including a battery shield in combination with DHT-11 humidity & temperature sensor. This setup can be easily driven by an ESPHome sketch and seamlessly integrated into Home Assistant. It’s also small enough to fit into a small container which, in my case, was originally made for hair gel.

Parts list

For this project 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 fee or costs to you

Top view of all components used in this project.
All components

Prepare the D1 Mini

Start with soldering the female pin header to the D1 Mini. Mostly the D1 Mini comes with a variety of pin headers, select the female ones that fits best. Solder the pins to downside of the D1 Mini so that the WIFI antenna isn’t blocked by the battery shield if it’s connected.

Soldering process of the female pin headers
Soldering the pin headers

Prepare the battery shield

The battery shield will provide the power for the D1 Mini and will also take care of the battery charging process. That’s pretty neat, but with a slight modification, we can make the board even more useful. If you add a 100K Ohm resistor between the plus pole of the battery and the analog A0 pin, you can read the battery operating voltage, which can be used to calculate the capacity of the battery. With that value, you can create an automation in Home Assistant, to inform you if the sensor needs to be recharged.

Closeup of the resistor modification of the battery shield
Modified battery shield

Prepare the DHT-11

To connect the DHT-11 sensor to the D1 Mini grab some wires and presolder the ends on one side. Next snip of some heat shrinks and slide them over the soldered wires.

Presoldered cables with heat shrinks
Prepared cables

In the next step we will solder the wires to the DHT-11. The DHT-11 has 4 pins in general where the third one f.r.t.l isn’t in use. Solder the wires to DHT-11 as shown on the picture. I used red for positive, white for GND and green as the data wire.

The DHT-11 with soldered wires
The DHT-11 with soldered wires

Make a Sandwich😉

In this step we will connect the sensor to the D1 Mini and the battery shield. So flip the D1 Mini and slide the sensor wires into the females pin header. White goes to the GND pin, red to the 5V pin and green to the D4 pin of the D1 Mini. Further we will connect the RST pin with the D0 pin.

Downside of the D1 Mini with connected sensor and bridged reset pin.
D1 Mini with connected sensor and bridged pins

Connecting RST and D0(GPIO16) is very important, because our sensor will run on battery and not be continuously on. That would consume too much power and the battery would be empty within one or two days. To prevent this, our sensor will use a feature called deep sleep. With this feature enabled, the D1 Mini will only wake up every couple hours, take some measurements, send the data to Home Assistant and fall back into sleep / energy saving mode. This way is super efficient and will max out the battery life up to two weeks instead of two days. To enable deep sleep on an ESP8266 device you have to bridge these two pins, otherwise the D1 Mini will never wake up again.

If everything is setup properly, connect the battery shield and the D1 Mini. Keep an eye on the pins, the labels on the battery shield must match with the ones on the D1 Mini.

Close up of the battery shield connected to the D1 Mini
The senors sandwitch

Prepare the battery

Before we flash the D1 Mini with our sketch, we will prepare the battery to our sensor. If you don’t have a connector, you can simply solder the wires to the battery socket of the D1 Mini battery shield. In my case, I had a spare connector lying around, so I soldered it to the battery to make disconnections simpler. It’s also recommended to disconnect the battery from the D1 Mini while flashing. If you don’t use a connector, you have to disconnect the D1 Mini from the battery shield for the flashing process.

Battery with soldered connector
Battery with soldered connector

Flashing the D1 Mini

To flash the sketch to your D1 Mini, go to the ESP Home section in your Home Assistant installation and create a new project and start with a project name. I named mine diy-humidity-sensor.

Setup to name your device
Add a useful name

Next choose the board type. Because we are using a D1 Mini click on ESP8266.

Setup an new project in ESP HOME
Select the board

After that click on next and then on install to choose a preferred installation method. I always use the manual download option because I like to flash my ESP’s using ESP Home Flasher.

Finished setup

Install the sketch

To finish the installation, copy the script below to your editor, compile it and flash it to the D1 Mini. If you don’t use secrets, change the WIFI credentials to your needs. This sketch will create several sensors in Home Assistant including the battery percentage one. Further it will use the deep sleep function to operate 1 minute and then goes into sleep for 3 hours.

esphome:
  name: diy-humidity-sensor

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-Humidity-Sensor"
    password: "SuperSecr3t"

captive_portal:

sensor:
#VCC on batter
  - platform: adc
    pin: A0
    id: "LIFEPO"
    name: "A0 voltage x 3.0"
    update_interval: 18s
    accuracy_decimals: 3
    filters:
      - multiply: 3.0
  - platform: template
    name: "diy-humidity-sensor-battery-voltage"
    unit_of_measurement: 'V'
    update_interval: 18s
    accuracy_decimals: 2
    lambda: |-
      return (id(LIFEPO).state);
  - platform: template
    name: "diy-humidity-sensor-battery-percentage"
    unit_of_measurement: '%'
    update_interval: 18s
    accuracy_decimals: 0
    lambda: |-
      return ((id(LIFEPO).state-2.2) /0.8 * 100.00);

#Temperature and humidity
  - platform: dht
    model: DHT11
    pin: D4
    temperature:
      name: "diy-humidity-sensor-temperature"
    humidity:
      name: "diy-humidity-sensor-humidity"
    update_interval: 18s
    
deep_sleep:
  id: deep_sleep_1
  run_duration: 60s
  sleep_duration: 180min

Finish the installation

After flashing the D1 Mini, grab your enclosure and ensure that the DTH-11 will be exposed to the air. I drilled some holes into the lid of my container to ensure that.

Topview of container lid with holes
Lid with holes

Last not least connect the battery to the battery shield and place everything inside the container.

Sensor in the container
Sensor in the container

UPDATE: During my tests, I found out that the LED on the D1 Mini uses a quite large amount of power. This will decrease the run time of the sensor, so I desoldered the LED from the D1 Mini 😬.

Check Home Assistant

After connecting the battery to the sensor, you will find a new ESPHome device in Home Assistant which provides the sensors, which were defined in the sketch.

Home Assistant entity list
Entity list

These entities can simply added to a dashboard or used in an automation.

Dashboard card
Values in the dashboard

Sum up

And that’s it. Your diy filament humidity sensor is ready to go 😁 You can now measure the current humidity and temperatue inside you filament storage. You can also use the sensor data in an automation which informs you if the humidity in your filament storage increases or exceeds a certain level. Or you can display the information on a dashboard like I did.

I hope you like this project and I’m looking forward to your comments and shares.