About two years ago I had one of my first (blogged) project: Making my doorbell smart This is working perfectly since I’ve made it and many others have made it the same way, like our famous Frenck did ☺️ The problem has been all the time that an extra power supply was needed to power the ESP. Well, not anymore…
I’ve been using some well known buck converters from AliExpress for a long time. They’re cheap, small and perfect for powering ESP’s. Then the idea emerged, why not combine it all together? Making use of the doorbell transformer and get rid of the extra power supply?
The idea was to make a hat that fit on the Wemos mini and integrate the buck converter, relay and connectors. Luckily those schematics are easy to find and I recreated the schematic and integrated that on the hat:
Proof of concept
When all components arrived, I noticed I made a little mistake: the capacitor on the input was only 16 volt, and my design is made for ~30 volt AC or DC in. With these components I made the pcb and tested it on max 15 volt in. It worked perfectly!
Now I know for sure it works, I’ll have to make some tiny adjustments to the layout (bigger capacitor and some silk text on the pcb). Once that is done, I might be thinking of selling it as a hat in my shop ☺️
While my ESPHome yaml code is working fine, there was room for improvement. Looking at Frenck his code, I saw he did some nice extra’s in the code. So I borrowed some of his ideas and combined it with my needs:
esphome: name: doorbell platform: ESP8266 board: d1_mini wifi: ssid: !secret wifi_ssid password: !secret wifi_password # Enable logging logger: # Enable Home Assistant API api: ota: time: - platform: homeassistant id: homeassistant_time text_sensor: - platform: version name: Doorbell ESPHome Version - platform: wifi_info ip_address: name: Doorbell IP ssid: name: Doorbell SSID bssid: name: Doorbell BSSID sensor: - platform: uptime name: Doorbell Uptime - platform: wifi_signal name: Doorbell WiFi Signal update_interval: 60s globals: - id: chime type: bool restore_value: true initial_value: 'true' switch: - platform: gpio pin: number: D1 inverted: false name: "Doorbell Relay" id: relay internal: true icon: mdi:alarm-bell - platform: restart name: "Doorbell Restart" - platform: template name: Doorbell Chime Active id: chime_active restore_state: false turn_on_action: - globals.set: id: chime value: 'true' turn_off_action: - globals.set: id: chime value: 'false' lambda: |- return id(chime); binary_sensor: - platform: gpio pin: number: D5 mode: INPUT_PULLUP inverted: true name: "Doorbell" filters: - delayed_on: 50ms - delayed_off: 50ms on_press: then: if: condition: - switch.is_on: chime_active then: - switch.turn_on: relay on_release: - switch.turn_off: relay - platform: status name: "Status Doorbell"