No description
Find a file
2025-08-22 22:36:43 +02:00
.forgejo/workflows Switched build image to "master" tag 2025-08-22 22:36:43 +02:00
.vscode Updated vscode settings 2025-07-12 15:47:32 +02:00
certs Implemented serving of compressed html 2025-06-20 17:26:59 +02:00
components Intermediate version. 2024-11-29 21:55:46 +01:00
data Moved .gitkeep to data/ 2025-06-21 12:07:04 +02:00
html Renamed project from "tuerklingel-esp" to "doorbell-esp-adf" 2025-06-29 12:40:54 +02:00
images Updated screenshots 2025-06-29 19:50:13 +02:00
main Fixed silence mode 2025-08-19 18:38:07 +02:00
scad Added CAD files for case. 2025-08-15 14:27:38 +02:00
.gitignore Updated screenshots 2025-06-29 19:50:13 +02:00
CMakeLists.txt Initial import 2024-07-31 21:58:40 +02:00
doorbell-esp-adf.code-workspace Publish sytem data to MQTT 2025-06-29 14:11:10 +02:00
doorbell-esp-adf.fzz Added Fritzing schematic of electronics 2025-08-19 18:38:56 +02:00
partitions.csv Initial import 2024-07-31 21:58:40 +02:00
partitions_4MB.csv Resized app partitions, unified log messages 2025-06-29 17:29:14 +02:00
partitions_8MB.csv Resized app partitions, unified log messages 2025-06-29 17:29:14 +02:00
pytest_https_server_simple.py Initial import 2024-07-31 21:58:40 +02:00
README.md README.md aktualisiert 2025-07-01 13:06:14 +02:00
sdkconfig.ci Initial import 2024-07-31 21:58:40 +02:00
sdkconfig.ci.dynamic_buffer Initial import 2024-07-31 21:58:40 +02:00
sdkconfig.ci.srv_ses_tkt Initial import 2024-07-31 21:58:40 +02:00
sdkconfig.defaults Added new WifiManager Class to replace example code from esp-idf 2025-06-19 12:10:45 +02:00
sdkconfig.defaults.esp32c3 Added OTA feature 2024-12-01 09:25:14 +01:00
sdkconfig.defaults.esp32s3 Added OTA feature 2024-12-01 09:25:14 +01:00
togzip.py Implemented serving of compressed html 2025-06-20 17:26:59 +02:00
version.txt Fixed silence mode 2025-08-19 18:38:07 +02:00

ESP32 based "smart" doorbell

Why?

Because I wanted to make a project with the esp-idf/-adf and because I couldn't find anything similar that you can buy. Similar means:

  • No cloud required
  • No app required
  • Can be integrated into home automation systems.
  • Can play mp3s.

At the same time, I wanted to keep the hardware of the project as simple as possible and I'm quite happy that it manages with four parts.

Partlist

You will need the following parts to build and run this project:

  • ESP32-C3 or ESP32-S3 board (I used the Seeed Studio XIAO ESP32C3 and ESP32S3 boards for testing - the later one doesn't work right now because of issues in esp-adf)
  • I2S audio board based on MAX98357A (i used this one)
  • A speaker fitting the audio board
  • A pushbutton
  • 5V powersupply

Wiring is shown here:

Hardware wiring

Current Features

This firmware provides a webserver which you can use to configure parameters like a time window in which the doorbell should be muted, a general mute switch and an interface to manage mp3 files which can be uploaded to the embedded flash filesystem. You may upload as many mp3 as will fit onto the flash filesystem and select one as default tone to be played when the pushbutton is pressed.

Screenshot of wifi settings page

If enabled the doorbell will be able to be updated automatically via OTA. You may use the default URL where you can download the current versions published by me.

Screenshot of system settings page

Access to WebUI is secured by username/password (default: admin/doorbell) and a self-signed SSL certificate.

Screenshot of login page

Configure the project

Supported Targets ESP32-C3 ESP32-S3

Checkout this repo and install esp-adf (https://github.com/espressif/esp-adf). The last versions i used is esp-adf v2.7 - take a look at the esp-adf github page to see which combinations of esp-idf and esp-adf are currently supported, if you would like to use another version of esp-idf. In the project directory issue:

idf.py set-target esp32-c3
idf.py menuconfig

Change "esp32-c3" in the "set-target" line to the chip your board uses. Open the project configuration menu (idf.py menuconfig) to configure Wi-Fi, MQTT connection and other parameters. Maybe have a look at the sdkconfig.defaults* files as well.

Build and Flash

Build the project and flash it to the board, then run monitor tool to view serial output:

idf.py -p PORT build flash monitor

On my laptop idf.py was able to autodetect the port to which the ESP board was connected to, so i could ommit the "-p PORT" part. Replace PORT with the name of the serial port to use, if autodection doesn't work.

Important: To exit the serial monitor, type Ctrl-].

See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.

Certificates

You will need to approve a security exception in your browser. This is because of a self signed certificate; this will be always the case, unless you preload the CA root into your browser/system as trusted.

You can generate a new certificate using the OpenSSL command line tool:

openssl req -newkey rsa:2048 -nodes -keyout prvtkey.pem -x509 -days 3650 -out cacert.pem -subj "/CN=ESP32 HTTPS server example"

Expiry time and metadata fields can be adjusted in the invocation.

Please see the openssl man pages (man openssl-req) for more details.

It is strongly recommended to not reuse the example certificate in your application; it is included only for demonstration.

Publishing to MQTT

To have some state information in your home automation system and get notifications when someone ringes the bell, the current system state is published to MQTT like this:

/doorbell/
    last_visitor = 2025-06-30 17:48:42
    active_melody = haru.mp3
    volume = 10
    mute_state = disabled
    silence_start = 22:00
    silence_end = 06:00
    silence_state = enabled
    silence_active = no
    ota_url = https://git.stop.pe/disvsb/doorbell-esp-adf/releases/download/latest/
    ota_state = enabled
    ota_interval = 5
    uptime = 0d, 0h, 2m, 4s
    debug = disabled
    firmware_version = 0.12.0

By watching changes to "last_visitor" you may trigger some notifications.