A Self-Powered Wireless Smart Doorbell
Imagine never having to worry about your doorbell's battery running out. Not too long ago, we relied on wired doorbells. Press the button, and a familiar chime would echo inside. But things changed – the doorbell broke, the wiring became a hassle, and we replaced the front door. Reinstalling a wired doorbell now seems daunting. Could a wireless solution be the answer?
Today, the market is flooded with wireless doorbell options. From cheap, battery-powered models to smart, rechargeable versions, the choices seem endless. Initially, we opted for a battery-operated doorbell, but the hassle of replacing batteries and the risk of damaging the device while doing so led me to search for a better solution.
Before diving deeper into doorbells, let's talk about an intriguing device – the Philips Hue Tap. It is a disc-shaped remote, part of Philips' smart home lineup, that can be used to trigger actions such as turning a light on or off. Most interestingly, it operates without batteries.
How can something work without batteries? Is it witchcraft? Almost. The Philips Hue Tap uses kinetic energy – the force exerted when pressing a button generates enough energy to transmit a signal. This eliminates the need for a traditional power source. Unfortunately, Philips discontinued this clever device due to the practicality of battery-powered alternatives and the stiff buttons required for kinetic energy generation. On top of the fact that battery-powered switches are cheaper to make, and that we have gotten batteries to last for ages in devices like these, little reason remains to keep a product such as this around. After all, how hard is it really to replace a battery every one or two years?
When it comes to doorbells, it's a whole other story. Doorbells need to be water resistant, and secured quite well to the wall. Making it easy to swap batteries in wireless doorbells while also satisfying the other two requirements is hard. In practice, it is a pain to replace the battery once it inevitably runs out. If only there was a way to have a Philips Hue Tap as a doorbell button...
Needless to say, I looked into doorbells that were powered by the same kinetic energy tech. Not having the hassle of batteries is a really nice add, and the stiffer buttons wouldn't be much of an issue as doorbells do not very regularly need to be pressed. If anything, it ensures that whenever your doorbell does get pressed, it was done so with intent.
Unfortunately, the options for doorbells powered by kinetic energy were incredibly sparse. I was unable to find anything offered by a major brand, and rather quickly did I have to turn to a Chinese site like AliExpress. There I found someone selling a set consisting of such a self-powered doorbell and a receiver. Time to give this a try!
The doorbell button I found felt surprisingly decent with a tactile click. However, the range was a major issue. Due to my situation, I had to mount it on a metal plate. This means the signal couldn't reach most parts of the house.
This doorbell is not smart, meaning you rely on the receivers to pick up the doorbell button's signal and play an audible sound. Due to the range, the receiver had to be placed close to the front door. However, the chime wasn't always audible in other parts of the house. If only I could have the doorbell button trigger something other than these receivers...
One of the things that makes smart home products so smart, is that they can be automated. One signal is enough to trigger anything you could think of. I have a bunch of smart speakers around the house, couldn't I use those as doorbell gongs as well? Turns out, you can, but first we need to find a way to make the doorbell smart. Now, there is not a lot we can do with the doorbell button. It's small, sits outside, has been water-proofed and doesn't have power. The receiver is another story though. If somehow, we can manage the receiver to relay the doorbell button's signal to another device, such as an ESP32 micro-controller, we're in.
At home, I use Home Assistant to manage my smart home. It is an immensely powerful tool, and offers a ton of integrations. My idea was, to have the ESP32 monitor the receiver in case it gets triggered by the bell, and relay that information to Home Assistant, where an automation would be triggered responsible for playing sound on all the smart speakers throughout the house. I had to try a few different approaches before I found one that worked.
Troubleshooting
Picking Up RF Signals
According to the item description, the doorbell's radio frequency is 433 MHz. As such, I tried was picking up the RF signal with an RF module. I settled for a RXB6 433 MHz RF receiver and 433 MHz antenna from TinyTronics, attached those to a Raspberry Pi and began testing. And... nothing showed up. I thought I misconfigured something, but that can't have been the case because it was able to pick the signal from my garage remote just fine. It also can't have been a signal strength issue, as I tried placing the module right next to the doorbell as well. It seems like the doorbell emits a non-standard signal that cannot be picked up by this module, bummer!
Light Sensor
Whenever the doorbell is pressed, a light can be seen blinking on the receiver. The idea here is to measure the light intensity of the LED. Whenever a light sensor crosses a certain threshold, we can assume that the LED light is turned on. The only other thing we would need to keep in mind, is that the light doesn't stay solid, but rather blinks for a while after the doorbell has been pressed. After the light intensity exceeds the threshold, we should therefore also implement a cooldown until the light has stopped blinking again.
Unfortunately, did this not work out. I attached the light sensor to the housing of the receiver, and taped the sensor to the opening of the LED, making sure no light from outside would leak in (though this was not strictly necessary, as the receiver is located somewhere where it's nearly always pitch black). The light sensor I got turned out not to be sensitive enough to reliably sense when the LED is on.
Final Set-up
The final solution ended up involving the LED. But rather than sensing the light, we will be sensing the voltage going across. It does unfortunately require you to open up the device and solder some wires to the positive and negative ends of the LED, which can be quite tricky. Luckily, my set came with a back-up receiver and the receivers themselves can easily be opened by removing a few screws.
On my ESP32, I wrote a script to connect it to a Wi-Fi network and have it read the voltage from an analog input pin. If the voltage exceeds a certain threshold and the change in voltage since the last reading is significant, it triggers a webhook by sending an HTTP GET request.
#include <WiFi.h>
#include <HTTPClient.h>
const char* ssid = "Wi-Fi Network";
const char* password = p@ssword";
const char* webhookURL = "http://server:8123/api/webhook/doorbell";
const int analogInputPin = 34; // GPIO pin to measure voltage
const float thresholdVoltage = 2.5; // Threshold voltage in volts
float previousSensorValue = 0.0;
void setup() {
Serial.begin(115200);
delay(1000); // Delay to allow time to open serial monitor
// Connect to Wi-Fi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to Wi-Fi...");
}
Serial.println("Successfully connected to Wi-Fi.");
}
void loop() {
int sensorValue = analogRead(analogInputPin); // Read the voltage
float voltage = sensorValue * (3.3 / 4095.0); // Convert ADC reading to voltage (3.3V is the ESP32 reference voltage)
Serial.print("Voltage: ");
Serial.print(voltage);
Serial.println("V");
if (voltage > thresholdVoltage) {
if (sensorValue - previousSensorValue > thresholdVoltage) {
triggerWebhook();
}
}
previousSensorValue = sensorValue;
delay(100);
}
void triggerWebhook() {
HTTPClient http;
http.begin(webhookURL); // Specify destination URL
int httpResponseCode = http.GET(); // Send the GET request
if (httpResponseCode > 0) {
Serial.print("Webhook triggered. Response code: ");
Serial.println(httpResponseCode);
} else {
Serial.print("Error triggering webhook. Response code: ");
Serial.println(httpResponseCode);
}
http.end(); // Close connection
delay(5000); // Wait for 5 seconds before reading again
}
This webhook is defined in Home Assistant as part of an automation. When a request from the ESP32 has been received, Home Assistant will make sure to notify all my devices that the doorbell has been pressed. It plays audio on Google Cast-enabled speakers, such as the Google Home Mini, around the house, but it also sends a notification to my phone, watch and VR headset. This is possible thanks to the Home Assistant companion app. On VR headsets running Android, it is possible to install the app as well, which means doorbell notifications reach me even though I am completely immersed in a game.
After much trial and error, my smart, wireless, battery-free doorbell is now a reality. It seamlessly integrates with my home automation system, ensuring I never miss a visitor, no matter where I am in the house.