doorlink for ESP32-S3
An ESP32 camera project for ESP32-S3 involving OV5640, Microphone, Speaker.
Parts and sourceBefore you start
Check the exact OV5640, Microphone, Speaker configuration against the upstream wiring or parts list.
Upstream README
Doorlink
Living in an apartment without a concierge, you're often left guessing who's at the door, and asking questions like "did my package arrive?". Providing an interface for visitors to notify me of package deliveries and general presence is really convenient.
Doorlink is a self-hosted smart doorbell built around a custom ESP32-S3 board and a Raspberry Pi, with no cloud subscription required. A button press wakes the board, captures a still image, and sends the event to a local gateway. The gateway stores the media, updates the web dashboard, and sends ntfy notifications to household members. The doorbell plays a local chime; when configured, the gateway also sends a Home Assistant webhook to play a chime on all configured smart speakers in the home. Visitor recordings and stored, turn-based voice replies are also supported. A full parts and cost breakdown is in the docs.
See the labeled enclosure.
Demo
https://github.com/user-attachments/assets/69bbac34-c78c-457d-b82e-8ea92b961eb2
Recorded at my door on 2026-10-24: phone video of the doorbell beside a screen recording of the dashboard, synced and uncut. Part 1 shows a button press, the photo arriving, the desktop alert, and the Home Assistant chime. Part 2 shows a visitor voice message and a Push to Talk reply played back at the door. Each part ends with step timings from the gateway logs.
Prototype Status
The assembled Rev C board is mounted at my door on battery power and in daily use. Each button press wakes the board from deep sleep, captures a QXGA image, uploads it over Wi-Fi, updates the dashboard, sends notifications, and returns to deep sleep. From 2026-09-14 to 2026-10-27, excluding the demo recording on 2026-10-24, the gateway stored a photo for all 35 visitor presses, with a median of 2.9 s from the press alert reaching the gateway to the photo being stored. The microphone, speaker, and stored voice-reply path have been exercised on hardware. This is a working prototype, not a qualified outdoor product.
Battery life is still being measured. The single-cell battery was installed at about three-quarters charge (roughly 78%) in mid-September and ran 11 weeks on it, until a recharge on 2026-12-01; its last reading before then was 3.55 V on 2026-11-29. An earlier projection of about 12 weeks per charge, at an average draw under 1 mA, came from the first four weeks and 97 presses, over which the battery fell from roughly 78% to 46%. That figure is a projection from an approximate starting reading and voltage-based percentages, not a measured current or an observed runtime. The gateway now stores a battery reading on every press, and the first fully observed cycle began on 2026-12-02 after a full charge. A measured runtime will replace the projection when that cycle ends.
This is my first PCB layout and my first time hand-soldering surface-mount parts, including the ESP32-S3 module and ICS-43434 microphone. It took three revisions to get here: some scope creep, plus a few dumb mistakes that waited until after I ordered the boards to announce themselves.
Upgrades With the Enclosure Closed
The enclosure has stayed closed since the doorbell went up. Firmware now updates over Wi-Fi, and the photo and voice cleanup run on the Pi, which keeps each original and stores a cleaned copy for the dashboard. Both cleanups are plain Java in the gateway, with no native libraries. The gateway measured the figures below on the Pi in December 2026.
Firmware Updates Over Wi-Fi
The doorbell checks for a new release at the end of a visit. Images are signed with an RSA-3072 key that stays on my development machine; the Pi only hosts them, and the doorbell rejects any image without a valid signature. Two app slots give automatic rollback: a new image is kept only after a self-test that reaches the gateway. Updates are skipped below 3.5 V. A bench run on 2026-12-01 covered an install, a rollback after a failed self-test, a corrupted image, and an image signed with another key. Versions 6 and 7 then installed over Wi-Fi on 2026-12-02. See over-the-air updates.
Photo Cleanup
The OV5640 adds faint vertical column stripes and grain to every photo. The gateway estimates and subtracts each column's brightness offset, then removes speckle, grain, and colour noise. Across the 42 measurable photos on the Pi, the median stripe strength fell from 2.75 to 0.23, a median of 7.5% left; the worst photo kept 50%. Stripe strength measures brightness offsets that repeat down each column, so dark vertical edges and text in the scene count too, and the after figures overstate what is left. Cleaning takes about a minute per photo on the Pi 4, in the background. Very wide bands are only partly removed, dark areas can look slightly smooth, and motion blur is untouched.
Shorter Exposure
Visitors move, so long exposures blur faces. Firmware 7 lets the gateway choose the camera's exposure profile: the doorbell fetches it at the end of each visit and uses it on the next, without a reflash. A 13-press test at the door compared five profiles under the hallway's constant light. The chosen profile caps the exposure at 33 ms, against about 100 ms before, and lets the gain rise to about 6x instead of 2x, for about the same brightness. None of its 3 test photos had a blurred face, against 2 of 6 at 50 ms. The higher gain roughly triples the stripes before cleaning (a median of 7.6 against 2.4 on earlier 2x photos), and the cleaned copies keep a little more of them (0.41 against 0.20). The test was small and the visitor mostly stood still, so it shows the trade-off rather than a blur rate.
Voice Message Cleanup
Recordings from the hallway come in quiet, hissy, and echoey. The gateway filters out rumble, reduces noise and the hallway's echo with spectral suppression tuned to its reverberation time of about 1 s, turns down steady whistles, fades out the click of the button being released, and levels speech to a consistent loudness. Speech level is measured over the speaking parts of each clip and noise over its quietest parts. Across 11 hallway recordings, the median speech level rose from -37.2 to -21.7 dBFS and the median speech-to-noise ratio from 16.2 to 24.4 dB. Echo after words is 2.6 to 3.9 dB quieter than without the echo stage. A steady 2906 Hz whistle in 9 of the 11 recordings, about as loud as the hiss around it, now sits 8 to 13 dB below that hiss. Each clip takes 0.2 to 1 s on the Pi.
How It Fits Together
flowchart LR
A[Doorbell PCB<br/>ESP32-S3 · camera · audio] -->|Wi-Fi| B[Raspberry Pi gateway<br/>Spring Boot]
B --> C[(PostgreSQL<br/>events)]
B --> D[(MinIO<br/>images and audio)]
B --> E[Next.js dashboard]
B --> F[ntfy notifications]
A --> G[Local doorbell chime]
B -->|Configured webhook| H[Home Assistant]
H --> I[Smart speaker chimes]
E -->|Stored voice replies| B
The firmware captures the image before joining Wi-Fi, then powers the camera down. Audio is turn-based: the visitor microphone and doorbell speaker do not run as a full-duplex call. The Raspberry Pi also runs Mosquitto for device commands. The gateway is best run on a device that is reliably always on, which is why I chose a Raspberry Pi.
Household alerts
- The gateway sends an HTTP webhook to a Home Assistant automation, which plays a chime on all configured smart speakers in the home. This supplements the doorbell's local chime.
- Household members receive notifications through ntfy on their phones or computers, subscribed to a shared topic on ntfy.sh. Tapping a notification opens the Doorlink dashboard in their browser.
The home installation uses both alert paths. See gateway environment configuration for the Home Assistant webhook and ntfy topic settings. The local development profile disables both integrations.
Hardware Gallery
| Rev A | Rev B | Rev C |
|---|---|---|
![]() |
![]() |
![]() |
All three revisions were assembled by JLCPCB and tested before settling on Rev C. Rev A to Rev B was the largest change, adding substantially more components. Rev B to Rev C corrected the mirrored pin mapping on the 24-pin camera FPC connector and made smaller optimizations. Images are KiCad 3D renders of each revision.
| Rev C Schematic |
|---|
![]() |
| Copper Layers (F.Cu and B.Cu) | Rev C Before ESP32 and Mic Soldering | Front Lid Marked Out | Finished Doorbell Enclosure |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
| Bench Bring-Up | Populated PCB | Enclosure Wiring |
|---|---|---|
![]() |
![]() |
![]() |
The board uses an ESP32-S3-WROOM-1-N16R8, OV5640 camera, ICS-43434 microphone, MAX98357A amplifier, MCP73871 charger, and TPS63802 3.3 V regulator. The PCB overview links the KiCad source and exact Rev C manufacturing files.
Door Mounting
The enclosure is attached to my apartment door with two pairs of white Command Large picture-hanging strips, arranged vertically on its back. 3M rates four pairs for 16 lb (7.2 kg), so two pairs work out to about 8 lb (3.6 kg). That is several times the doorbell's weight, and more than enough to hold it securely in daily use. The strips are removable, so there are no holes for building management to object to. The mount is not tamper-proof: someone determined enough could pull the doorbell off the door 😅.
Explore the Project
| Area | Contents |
|---|---|
main/ |
ESP-IDF firmware and routed board pin map |
config/firmware/ |
Firmware build presets and archived camera configurations |
gateway/ |
Spring Boot event API, persistence, media storage, and notifications |
dashboard/ |
Next.js event and intercom interface |
pcb/ |
KiCad project and manufacturing records |
docs/parts.md |
Main unit parts and CAD cost |
docs/firmware-architecture.md |
Firmware flow and validation status |
docs/hardware-bringup.md |
Detailed Rev C hardware test record |
Dashboard Preview (Synthetic Data)
This preview uses synthetic session data and a generated doorbell-camera view. My actual dashboard is hosted on a subdomain with authenticated access. The demo shows it in presentation mode, which hides sessions from before the recording.
Run Locally
Install Docker Compose, Java 21, Node.js with npm, and the dashboard dependencies (cd dashboard && npm ci). From the repository root, run ./scripts/run-dev.sh to start the isolated development stack. The gateway uses port 8081 and the dashboard uses localhost:3001. On first run, enter the setup token printed by the launcher. Ctrl+C stops the stack. The local credentials in .env.dev are for development only.
Firmware builds require ESP-IDF. Copy main/config.example.h to the ignored main/config.h, set your Wi-Fi and gateway values, then see firmware architecture for the safe and production build commands. Raspberry Pi deployment is documented in docs/pi-deployment.md.
License
Software and written documentation: MIT. KiCad hardware designs and manufacturing files under pcb/: CERN-OHL-P-2.0. Project photographs: CC0 1.0.











