I love the ESP32, and it's one of the most versatile microcontrollers out there. It comes in all kinds of shapes and sizes, and I recently came across the ESP32-S3-EYE, sometimes referred to as the ESP32-S3-CAM. It's what the name implies; an ESP32 board with support for a camera on-board, and it works exactly as it sounds, too. I picked up the OV2640 camera sensor alongside it, a lower-quality camera module that still does the job of a Ring Doorbell pretty well.
Of course, there are numerous improvements that could be made to this project, and this merely serves as a proof of concept. As well, these cameras can have overheating problems, so you'll need to tweak the parameters and settings to make it work perfectly for you. In warmer climates, this may be more of an issue, but in Ireland, where I live, it's completely fine. I used ESPHome for this, and it's a great way to get it up and running if you want something quick and easy that integrates well with Home Assistant.
Why build your own Ring Doorbell?
It's fun, interesting, and easy
The motivation for this project was pretty simple: I wanted a smart doorbell, but I didn't want to pay for one of Ring's monthly subscription fees, and I didn't want my footage going to Amazon's servers. Plus, being honest, I don't have a huge amount of use for a Ring doorbell in the first place. When it comes to subscriptions and data privacy, though, I suspect those are fairly universal experiences, and I figured that my foray into this realm would still serve to help others who were considering doing similar. Especially given the seemingly-constant news relating to Amazon's compliance with law enforcement when it comes to sharing Ring footage without a warrant. Plus, there's a level of general creepiness when it comes to having a cloud-connected camera at your front door. As a result, a completely local solution is very appealing.
The ESP32-S3 is the perfect device for a project like this. It's powerful enough to handle low FPS video streaming, cheap enough that you won't cry if you break it during development (mine cost around $10), and most importantly, it runs ESPHome, which means everything stays on my local network. No cloud, no subscriptions, and absolutely no third party that can see or hear what's going on at my home thanks to the cloud.
The parts list is pretty simple, too. There's the board itself, the camera module, a tiny button, and a power supply. While I built this in a way that isn't designed to be permanent (as I'm sure I'll build more with it in the future), you could 3D print an enclosure and solder your wires for the button to make it a more permanent fixture of your home. It doesn't need to be perfect, as you'll be saving money by not spending tens of dollars on a Ring doorbell, or on a monthly subscription fee, either. Even better, ESPHome is brilliant for this kind of project. Rather than writing C++ code and dealing with Wi-Fi libraries and MQTT manually, you just write a YAML configuration file, and ESPHome handles all the complexity.
The basic configuration I built looks like this:
- Camera streaming at 1024*768 resolution
- MJPEG stream on port 8080
- Button input for the "doorbell" part
- Integration with Home Assistant
ESPHome's built-in support for the camera component makes all of it really easy, and all you need to do is specify the GPIO pins, image settings, and give it the ability to send commands to Home Assistant.
Putting it all together with ESPHome and some basic hardware
You can access it through Home Assistant or your browser
The camera streams MJPEG at 10 frames per second, and while I tried higher, it got... worryingly hot. It doesn't need to be super smooth anyway, and most CCTV cameras operate anywhere from 1-15 FPS, as smooth motion isn't required. At 1024*768, it does a good enough job from a resolution point of view to still be useful, so I'm happy with how it looks as is. I can also access it by navigating to http://esp32-s3-cam.local:8080 in my browser, without needing any apps or cloud-based logins to do so. If you have a buzzer (I don't) you can also use RTTTL, otherwise known as Ring Tone Text Transfer Language, which is the same format that old Nokia phones used to use. You could even get creative with it, and play a chunk of the Super Mario Bros theme if you wanted.
In order to still simulate a doorbell chime, I set up a doorbell event so that Home Assistant could do the heavy lifting instead. You can then create an automation on the Home Assistant side to interpret this event and use it to play an audio file, such as an actual doorbell chime, over a speaker. As well, I have it configured so that when a button is pressed, a snapshot is taken from the camera and stored in Home Assistant, and you can then take that further and notify a device with that screenshot, too. It's just like you can do with Frigate, except built in to Home Assistant, and running on the hardware you build yourself.
When it comes to motion detection, you could easily implement that with a basic PIR sensor, though it would be incredibly sensitive during the day based on small movements and motions, and would require tweaking to get just right. On top of that, it would also be nice to add infra-red illumination for night-time viewing, and to add Power over Ethernet support, too. Infra-red would be fairly cheap to implement, but Power over Ethernet would likely require an entirely different board to work. However, the moral of the story is that it works. And it's a lot cheaper than a true Ring doorbell. There's a much lower up-front cost, and no subscription fees to speak of. It requires a bit more work, but buying a Ring doorbell means that you're paying for the convenience rather than the technology.
Is it for everyone, though? Honestly, no. If you just want to buy something, plug it in, and have it work perfectly with minimal configuration, get something like a Ring or Nest doorbell. They're good products, and the convenience is worth the cost for many people. However, if you care about privacy, enjoy tinkering with hardware, or want to avoid monthly subscription fees, then this project is worth trying out and can be achieved in just a couple of hours. Building your own doorbell camera with an ESP32-S3 is surprisingly straightforward, especially with ESPHome handling the heavy lifting. You get a device that's completely private, has no monthly fees, integrates perfectly with Home Assistant, and does exactly what you want it to do.
If you want to use my ESPHome YAML to gain a headstart, I've published it over on GitHub!
