

BirdNestV3
BirdNest Camera
- Size
- 100 × 100 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 68
- Nets
- 41
- Pads
- 172
- Tracks, vias
- 280, 25
- Pours
- 1
- Routed
- Yes
- KiCad
- KiCad 10.0 (file 20260206)
- Created
- 30 Apr 2026
- Updated
- 7 Nov 2026
Overview
BirdNestV3 is an open-source printed circuit board by VorosEgyes, from the VorosEgyes/BirdNest repository on GitHub, published under the MIT licence. It is a 2-layer board of 100 × 100 mm with 68 parts on 41 nets, routed with 280 tracks and 25 vias.
It is built around the ESP32-CAM, DS18B20 and ME2188A50PG, with the CN3065, DW01A and LM393 among its other parts. Its parts include 18 capacitors, 18 resistors, 7 ICs, 4 diodes and 3 transistors. It belongs with the home automation and IoT boards and the ESP32 and RISC-V boards of this library.
Main components
11ESP32-CAM
插件插件 WiFi Modules ROHSAi-ThinkerWiFi ModulesDS18B20
TO-92-55℃~+125℃ 12bit 3V~5.5V 750ms Single-bus ±0.4℃ TO-92 Temperature Sensors ROHSUMWTemperature SensorsME2188A50PG
SOT-89-3-40℃~+125℃ 1 300mA 320kHz 5V 7uA 900mV~5V Boost Boost Built-in Fixed Overcurrent Protection、Light load efficient mode Yes SOT-89-3 DC-DC Converters ROHSMICRONEDC-DC ConvertersCN3065
DFN-8(3x3)-40℃~+85℃ 1 4.2V 4.4V~6V 650uA 900mA Constant current charging、Constant voltage charging、Trickle charging、Automatic recharge、Charge termination、Programmable charging current、Under-voltage lockout Lithium Battery Support DFN-8(3x3) Battery Management ROHSShangHai Consonance ElecBattery ManagementDW01A
SOT-23-6L-40℃~+85℃ 1 2.5V 300mV~10V 3uA 4.3V Protection IC Support SOT-23-6L Battery Management ROHSPUOLOPBattery ManagementLM393
SOP-8-16V~16V 0℃~+70℃ 2 2.5mA 250nA 2V~36V 36V 5mV 5nA Fail-safe function Open-drain SOP-8 Comparators ROHSMSKSEMIComparatorsDMG2305UX
SOT-23-55℃~+150℃ 1 P-Channel 1.7W 190pF 1V 20V 4.1A 52mΩ@4.5V 7.8nC 740pF P-Channel SOT-23 MOSFETs ROHSTECH PUBLICMOSFETsFQP27P06
TO-220-55℃~+175℃ 1 P-Channel 1.4nF 120W 27A 43nC@10V 4V 60V 70mΩ@10V TO-220 MOSFETs ROHSonsemiMOSFETsFS8205A
SOT-23-6-55℃~+150℃ 1.2V 1.5W 2 N-Channel 20V 31.5mΩ@2.5V 466pF 5.7nC@4.5V 58pF 65pF 6A SOT-23-6 MOSFETs ROHSTECH PUBLICMOSFETsSMAJ90CA
DO-214AC(SMA)ESD And Surge Protection (TVS/ESD)hongjiachengSS34
SMA(DO-214AC)-55℃~+125℃ 3A 40V 500uA@40V 550mV@3A Independent SMA(DO-214AC) Schottky Diodes ROHSMDDSchottky Diodes
README
README.mdBirdNest ESP32-CAM Project
BirdNest is a battery-aware ESP32-CAM wildlife and bird nest monitoring project built with PlatformIO and Arduino. It captures photos on schedule or command, sends images and status updates to Telegram, and supports MQTT telemetry for smart home and IoT integrations. The firmware includes deep sleep power saving, OTA remote updates, WiFi recovery logic, DS18B20 temperature monitoring, and calibrated battery voltage reporting for reliable long-term outdoor operation.
Single firmware binary model. All cameras share one firmware build. Device-specific identity (label, OTA hostname, AP name) is stored in NVS at runtime, with a MAC-address-based fallback for first boot. Identity can be changed remotely via Telegram commands without reflashing.
GitHub OTA. Starting from v0.1.0, firmware releases are published to GitHub automatically via CI. Each device can check for and install updates over HTTPS, with SHA-256 verification and rollback support. Updates are controlled via Telegram commands at runtime. In the current firmware, the OTA install path is gated by network health and battery checks; weak RSSI alone no longer blocks installation, but the device still requires a live Wi-Fi connection and a valid OTA partition layout.
Hardware Design Files (KiCad)
The hardware design assets are stored in hardware/BirdNest_pcb/.
- Schematic:
hardware/BirdNest_pcb/BirdNest_pcb.kicad_sch - PCB layout:
hardware/BirdNest_pcb/BirdNest_pcb.kicad_pcb - KiCad project:
hardware/BirdNest_pcb/BirdNest_pcb.kicad_pro - KiCad project local settings:
hardware/BirdNest_pcb/BirdNest_pcb.kicad_prl - Backup folder:
hardware/BirdNest_pcb/BirdNest_pcb-backups/
3D PCB View

Complete Hardware Pin Mapping (AI-Thinker ESP32-CAM)
| Function | Pin | Notes |
|---|---|---|
| XCLK | GPIO0 | 20 MHz camera clock |
| Camera D0 (Y2) | GPIO5 | Data pin |
| Camera D1 (Y3) | GPIO18 | Data pin |
| Camera D2 (Y4) | GPIO19 | Data pin |
| Camera D3 (Y5) | GPIO21 | Data pin |
| Camera D4 (Y6) | GPIO36 | Data pin |
| Camera D5 (Y7) | GPIO39 | Data pin |
| Camera D6 (Y8) | GPIO34 | Data pin |
| Camera D7 (Y9) | GPIO35 | Data pin |
| HREF | GPIO23 | Control line |
| VSYNC | GPIO25 | Control line |
| PCLK | GPIO22 | Control line |
| SDA (I2C) | GPIO26 | Camera I2C data |
| SCL (I2C) | GPIO27 | Camera I2C clock |
| OneWire (DS18B20) | GPIO13 | OneWire bus |
| ADC (Battery) | GPIO12 | Battery voltage measurement |
| Flash LED | GPIO4 | PWM control |
Hardware modification
The current board revision uses a more elaborate power-management section around the ESP32-CAM module than the original single-regulator layout. In the current KiCad schematic, the power path is implemented with a ME2188-based regulator stage together with battery switching, UVLO sensing, and a 2.5 V reference network for battery monitoring.
Current hardware notes from the schematic:
- The firmware still targets the standard AI-Thinker ESP32-CAM pinout described above.
- The board includes battery-related nets such as BAT_RAW and BAT_MON, plus UVLO control/sense circuitry for low-voltage protection.
- The schematic also routes the DS18B20 one-wire sensor and a PIR signal net in addition to the camera and power rails.
Complete Boot Sequence (PHASE 1 in setup())
- Serial init — initialize UART at 115200 baud for debug output
- tempInit() — DS18B20 on GPIO13 OneWire bus with internal pull-up
- batteryInit() — GPIO12 ADC setup for battery voltage reading
- WiFi connect phase — STA connect with boot retries; rescue captive portal on repeated failures; deep-sleep fallback when boot connectivity cannot be recovered
- otaInit() and startup OTA window — check for ArduinoOTA updates (
OTA_STARTUP_WINDOW_SEC, orOTA_RECOVERY_WINDOW_SECwhen recovery is armed) 5b. ghOtaInit() — initialize GitHub OTA module after the ArduinoOTA window settles; confirm post-install rollback health ifESP_OTA_IMG_PENDING_VERIFY; run auto-check and install ifotaAuto=true - syncTimeIfNeeded() — NTP sync with up to 30 retries, 200ms between each
- telegramInit() and startup message processing — initialize Telegram bot and handle first message
- nightSleepIfNeeded() — if after sunset, sleep until sunrise using week-number lookup table
- Welcome / startup photo decision — send welcome message only on normal boot; on timer wake, capture+send photo if maintenance mode is off
- Final deep sleep decision — call
esp_deep_sleep_start()when sleep interval is enabled and OTA is not active
Photo Capture Sequence (PHASE 2)
- cameraInit() — configure AI-Thinker pins (D0-D7, HREF, VSYNC, PCLK, XCLK, SCCB), JPEG mode, and grab mode
- PSRAM profile select — if PSRAM is present use PSRAM frame/quality flags and
fb_count=2, otherwise fallback profile withfb_count=1 - Init resilience — handle
ESP_ERR_INVALID_STATEwith deinit+retry, plus second init retry after 500 ms - Sensor tuning — apply white balance, AGC/AEC settings, orientation (
/mirrorand/flip), and light-based OV2640 register ladder - Warm-up capture phase — capture
CAMERA_WARMUP_FRAMESframes (current active profile: 4), with frame-grab retries (CAMERA_FB_GET_RETRIES) - Final fallback capture — if all warm-up grabs fail, run one final retried frame-grab attempt
- HTTPS multipart upload — send Telegram
sendPhotorequest with chunked JPEG write (8 KBchunks) overWiFiClientSecure - Response validation — parse response body and treat only
"ok":trueas success; store detailed failure reason otherwise - Upload retry loop — outer retry in
captureAndSendPhoto()with WiFi reconnect and progressive backoff (PHOTO_SEND_RETRY_BACKOFF_MS * attempt) - cameraDeinit() — deinitialize camera and wait 100 ms before any next init
Telegram Command Processing (PHASE 3 in loop())
- 5-second polling interval
- Update ID persistence every 30 seconds
- Command table:
/status,/help,/photo,/sleepXX,/maint_on,/maint_off,/netdiag,/reboot,/reboot_ota,/setlabel,/sethostname,/bootstrap_prepare,/reset_config,/debug0|1|2,/mirror0|1,/flip0|1,/battcal,/battcalset,/battcalclear,/mqtt,/mqttset,/mqtttopic,/mqtttopic_reset,/mqttoff,/otastatus,/otaupdate_check,/otaupdate_now,/otaupdate_auto_on,/otaupdate_auto_off,/otachannel,/otatoken_set,/otatoken_clear /statusreturns status only; full command listing is in/help- Callback execution for each command
Deep Sleep & Wakeup (PHASE 4)
- ESP32 hibernates: CPU off, RTC timer running
- Current draw: 100–500 µA during deep sleep
- Wakeup detection via
esp_sleep_get_wakeup_cause() fromSleepflag behavior: setsfromSleepto true on wake, false on normal boot
Detailed Module Descriptions
WiFi Manager
- Telegram credential check from NVS (
botToken,chatId,debugChatId) before connect flow - Fail-fast STA reconnect path (
WIFI_FAIL_FAST_SEC) when captive portal is disabled - Rescue captive portal opens on missing Telegram fields or repeated boot failures
- Persistent WiFi failure counter (
wifiFail) in NVS; reset to 0 on successful connect
WiFi Connection Lifecycle (full program behavior)
1) Boot-time connection strategy
- The device first loads Telegram credentials and WiFi failure counter from NVS.
- If captive portal is disabled and Telegram fields are present, it tries normal STA reconnect first (
wifiInit()). - Boot retries are applied by the main program:
WIFI_BOOT_CONNECT_RETRIESWIFI_BOOT_RETRY_BACKOFF_SEC
- In fail-fast mode, each WiFi attempt uses
WIFI_FAIL_FAST_SECtimeout.
2) Rescue captive portal fallback
- If Telegram credentials are missing, captive portal is opened immediately.
- If
WIFI_ENABLE_CAPTIVE_PORTAL != 0, portal path is always allowed. - With repeated STA failures, rescue portal opens after
WIFI_RESCUE_FAIL_COUNTfailures. - Optional periodic rescue windows use
WIFI_RESCUE_PORTAL_INTERVAL_FAILS. - Portal timeout uses
WIFI_RESCUE_PORTAL_TIMEOUT(rescue) orCONFIG_PORTAL_TIMEOUT(normal). - Captive portal includes custom fields for Telegram token, main chat ID, and debug chat ID.
3) Boot failure fallback (failsafe deep sleep)
- If WiFi cannot be established after boot retries, device enters deep sleep backoff.
- Default backoff path uses
WIFI_RETRY_BACKOFF_SEC. - If OTA recovery is armed, recovery sleep timing is used instead (
otaGetRecoverySleepSeconds), including low-battery protection.
4) Runtime link-loss handling (while running)
- The loop continuously checks WiFi state before network-heavy tasks.
- On disconnect:
- reconnect attempts are triggered every
WIFI_RUNTIME_RECONNECT_INTERVAL_SEC - diagnostics counters are updated (
/netdiag)
- reconnect attempts are triggered every
- If disconnected too long, failsafe reboot is triggered after
WIFI_RUNTIME_REBOOT_AFTER_SEC.
5) OTA interaction
- OTA processing runs first in loop (
otaLoop()). - While OTA is active, other network work is deferred.
- Deep sleep is suppressed during active OTA transfer.
- Startup OTA polling window is dynamic: normal
OTA_STARTUP_WINDOW_SEC, or extendedOTA_RECOVERY_WINDOW_SECwhen recovery mode is armed. - OTA transfer watchdog restarts the device if no OTA events arrive for
OTA_STALL_TIMEOUT_SEC.
6) Maintenance mode behavior
- Maintenance mode suppresses automatic sleep/photo cycle decisions, but does not bypass WiFi requirements.
- If network quality is poor, runtime reconnect/failsafe logic still applies.
- Manual diagnostics command:
/netdiag.
Telegram
- Bot token stored in NVS
- Poll loop every 5 seconds
- NVS persistence of sleep/maintenance settings
lastMsgIdtracking for message updates/helpprovides the full command list, while/statusstays focused on runtime state
Camera
- AI-Thinker pin mapping: D0–D7 data, HREF/VSYNC/PCLK control, XCLK 20 MHz
- PSRAM-aware frame profile (
CAMERA_FRAMESIZE_*,CAMERA_JPEG_QUALITY_*,fb_count) - Warm-up frames from build flag (
CAMERA_WARMUP_FRAMES, active profile uses 4) - JPEG capture and frame buffer
- Upload via HTTPS multipart POST using
WiFiClientSecureandwriteAll()helper - Manual lowlight/day exposure register ladder based on ambient light register (
0x2f) - Multi-attempt Telegram photo upload with reconnect/backoff on failure
- Remote error diagnostics via Telegram debug messages (serial not required)
Camera Exposure / Lowlight Logic (actual implementation)
- Ambient light value is read from sensor register
0x2f CAMERA_DAY_THRESHOLDseparates lowlight and daylight branches- AGC is disabled (
set_gain_ctrl(0)), gain is manual (set_agc_gain(0)), and exposure is controlled by register ladder writes - A post-frame fine-tuning pass adjusts
0x47,0x2a, and0x2bfor very low to medium light - Current implementation does not use
CAMERA_DYNAMIC_EXPOSURE_PROFILE,CAMERA_DAY_*, orCAMERA_LOWLIGHT_*flag families
Photo Upload Reliability and Remote Diagnostics
- Upload attempts are retried with progressive backoff and WiFi reconnect between tries.
- Retry behavior is configurable with:
PHOTO_SEND_MAX_RETRIESPHOTO_SEND_RETRY_BACKOFF_MSCAMERA_FB_GET_RETRIESCAMERA_FB_GET_RETRY_DELAY_MS
- On each failed attempt, the device sends detailed failure reason to Telegram debug chat.
- Final failure message includes the last known upload error cause.
Common remote error reasons (cameraGetLastError):
empty_chat_id- no chat ID was providedmissing_bot_token- Telegram bot token is missing/emptywifi_not_connected_before_upload- WiFi dropped before upload starttelegram_tls_connect_failed- TLS connection toapi.telegram.org:443failedcamera_fb_get_failed_final- frame grab failed after warm-up and final fallback attemptupload_failed_headers_or_prefix- multipart request header/prefix write failedupload_chunk_write_failed_offset_N- JPEG data upload interrupted at byte offsetupload_multipart_tail_failed- multipart tail write failedtelegram_response_not_ok_empty_body- Telegram returned non-OK with empty bodytelegram_response_not_ok_...- Telegram API responded withok:falseand body snippet
Temperature
- DS18B20 on GPIO13 OneWire protocol with internal pull-up
- One blocking conversion is performed on cache miss; the result is reused for up to 60 seconds across status, MQTT, and photo-caption reads.
- If no sensor is detected during initialization, reads return
-127.0without polling the OneWire bus.
Battery
- ADC on GPIO12 with resistor divider formula
- Two-point calibration math using
bCalA/bCalB - GPIO12 is ADC2 on ESP32. While WiFi is connected, ADC2 sampling is not reliable/available, so the firmware returns the last cached valid value.
- A fresh battery sample is taken during boot before WiFi connect (
batteryRefresh()in setup), then reused during active WiFi on ADC2 hardware. /statusreports that cached value on ADC2+WiFi. This is typically the most recent wake-time sample.- If
/statusis sent while the device is in deep sleep, it is processed after wake, so battery data in the reply reflects the new measurement from that wake cycle.
Runtime Device Identity
All cameras run the same firmware binary. Each device's identity is stored in NVS and loaded at every boot.
| NVS key | Default | Description |
|---|---|---|
devLabel | BirdNest-XXXXXXXX (MAC) | Human-readable device name |
otaHost | birdnest-xxxxxxxx (MAC) | ArduinoOTA mDNS hostname |
| AP name | derived from devLabel + -cfg | Captive portal AP name (not stored separately) |
On first boot the label and hostname are generated from the lower 32 bits of the chip MAC address, so multiple devices with the same factory firmware never collide on the same LAN.
Telegram commands:
/setlabel <name>— change device label (persisted in NVS, affects MQTT topics and photo captions)/sethostname <name>— change ArduinoOTA hostname (reboot required to apply mDNS)/statusand welcome message show current label and OTA hostname
ArduinoOTA (local network upload)
- Startup OTA window:
OTA_STARTUP_WINDOW_SEC(default 8 s) - Extended recovery window:
OTA_RECOVERY_WINDOW_SEC(default 120 s) when recovery latch is armed - OTA stall watchdog: restart if transfer is idle for
OTA_STALL_TIMEOUT_SEC - Recovery sleep policy:
OTA_RECOVERY_SLEEP_SEC, with low-battery fallbackOTA_RECOVERY_LOW_BATTERY_SLEEP_SECbelowOTA_RECOVERY_MIN_BATTERY_V - Recovery state is persisted in NVS via
otaArmedandotaCycles /reboot_otaarms recovery and reboots — opens an extended OTA window for PlatformIO upload
GitHub OTA (automatic over-the-internet updates)
Starting from v0.1.0, every v* git tag triggers a CI build that publishes a single firmware binary and ota-manifest.json to GitHub Releases. Devices can check and install these releases over HTTPS without physical access.
How it works
- Check: device queries
api.github.com/repos/VorosEgyes/BirdNest/releases, finds the best candidate by SemVer and channel (stable/beta), downloadsota-manifest.json. - Install gate: battery ≥ max(3.60 V,
manifest.min_battery_v), WiFi stable. - Install: streams the
.binvia HTTPS, verifies SHA-256 incrementally, writes to the inactive OTA partition, reboots. - Health confirm: on first boot after install, pings
api.github.com/rate_limitup to 3 times; if any succeed, marks the image valid and cancels rollback.
Partition table requirement
GitHub OTA install requires an A/B OTA partition layout (partitions_ota_4m.csv). Devices previously flashed with min_spiffs.csv (single app partition) will run all GitHub OTA code normally but install will be blocked with reason no_update_partition until the device receives a full flash. This is why the first installation should be done over USB/serial for a new or previously single-partition device.
| Scenario | ArduinoOTA upload | GitHub OTA install |
|---|---|---|
Device with partitions_ota_4m.csv | ✅ | ✅ |
Device with min_spiffs.csv (old layout) | ✅ | ❌ blocked |
First-install / partition migration guide
To migrate an existing camera from min_spiffs to OTA partitions:
- Connect via USB.
- Run a full flash (includes partition table + bootloader + firmware):
bash pio run -e cam1 -t upload --upload-port /dev/cu.usbserial-XXXX # or cam2, cam3, cam4 — all envs produce the same binary - After this one-time flash, all future updates can be done via GitHub OTA with no physical access.
For cameras only reachable via ArduinoOTA, use /bootstrap_prepare before the USB flash session to ensure maintenance mode is on and sleep is off.
Bootstrap preflight command
/bootstrap_prepare — run this before any first-install or partition migration session:
- Sets maintenance mode ON (suppresses deep sleep)
- Sets sleep interval to 0
- Disables WiFi modem sleep
- Arms ArduinoOTA recovery
- Runs and reports a preflight check:
- Battery ≥
BOOTSTRAP_MIN_BATTERY_V(default 3.80 V) - WiFi connected and RSSI ≥
BOOTSTRAP_MIN_RSSI_DBM(default −82 dBm) - Telegram credentials present
- OTA update partition reachable
- Battery ≥
Reports READY or NOT READY with per-check detail.
GitHub OTA Telegram commands
| Command | Description |
|---|---|
/otastatus | JSON status: current version, channel, auto mode, pending target, last reason |
/otaupdate_check | Query GitHub releases; report available version or no-update |
/otaupdate_now | Check and immediately install if update found |
/otaupdate_auto_on | Enable automatic check+install on every boot |
/otaupdate_auto_off | Disable automatic updates (manual only) |
/otachannel stable|beta | Switch release channel |
/otatoken_set <token> | Set GitHub API token (private repos; message auto-deleted) |
/otatoken_clear | Clear token; drops pending private target |
Versioning and CI release workflow
FW_VERSIONis injected at build time from the nearest git tag viascripts/fw_version_from_git.py.- Local/untagged builds use
0.0.0-devas fallback. - CI (
release-ota.yml) triggers on anyv*tag push:- Builds
[env:release](same binary as camX envs) - Calculates SHA-256
- Uploads
birdnest-esp32cam-vX.Y.Z.binandota-manifest.jsonto GitHub Releases
- Builds
- Devices on stable channel only see non-prerelease tags; beta channel sees prerelease tags too.
Check/backoff policy
- Auto-check runs at most once per day (
GH_OTA_DAILY_CHECK_SEC). - WiFi instability increments a fail streak with exponential backoff: 6 h → 12 h → 24 h → 48 h max.
- Backoff is reset after 2 consecutive stable WiFi cycles.
- Manual
/otaupdate_checkand/otaupdate_nowbypass daily interval and backoff. - The Telegram TLS connection is closed before the automatic GitHub health probe.
If an automatic check ends in a crash, the next boot disables automatic checks
and reports the retained OTA stage and minimum free task stack in bytes through
Telegram. Manual checks remain available; use
/otaupdate_auto_onto retry.
GitHub OTA NVS keys (namespace: birdnest_gh)
| Key | Type | Description |
|---|---|---|
otaAuto | bool | Auto-update enabled |
otaChannel | string | stable or beta |
otaToken | string | GitHub API token (private repos) |
otaLastChk | uint32 | Unix timestamp of last successful check |
otaWifiFail | uint16 | Consecutive WiFi stability failures |
otaChkFail | uint16 | Consecutive check failures |
otaWifiOk | uint8 | Consecutive stable cycles (for backoff reset) |
otaBackoff | uint32 | Backoff-end timestamp (0 = no backoff) |
otaTarget | string | JSON-serialized pending install target |
otaLastReason | string | Last OTA block/fail reason code |
otaRebootFlg | bool | Set before install reboot, cleared on next boot |
otaLastTgt | string | Version string of last attempted install |
MQTT
- Runtime MQTT client with automatic reconnect
- JSON status publish to a configurable state topic (channel)
- Config stored in NVS and editable from Telegram
- Supports auth and no-auth brokers
- Periodic publish (
MQTT_STATUS_INTERVAL_SEC) and immediate publish on boot/config change - LWT availability support (
online/offline, retained) - Separate state/event/availability topic model
- Payload schema versioning (
schema_version) - GitHub OTA events published via
mqttPublishOtaEvent()to the event topic
MQTT Setup and Usage
Default Topics
If no custom topic is set, these topics are used:
- State topic:
birdnest/<deviceLabel>/status - Event topic:
birdnest/<deviceLabel>/event - Availability topic:
birdnest/<deviceLabel>/availability
Where <deviceLabel> is the runtime device identity loaded from NVS (see Runtime Device Identity section). The default is BirdNest-XXXXXXXX based on MAC address.
If you set a custom topic with /mqtttopic:
- The custom value is used as the state topic.
- If it ends with
/status, event and availability are derived as sibling topics. - Otherwise
/eventand/availabilityare appended.
Telegram Commands for MQTT
/mqtt- show current MQTT config and active channel/mqttset <ip-or-host> <port> <user|-> <pass|->- set broker and auth in one message/mqtttopic <topic>- set custom publish channel/topic/mqtttopic_reset- reset topic to default (birdnest/CAMERA_LABEL/status)/mqttoff- disable MQTT and clear broker credentials
/mqtt now reports:
- State topic
- Event topic
- Availability topic
- Schema version
One-message setup examples
- Auth enabled:
/mqttset 192.168.1.100 1883 mqtt_user mqtt_pass
- No auth:
/mqttset 192.168.1.100 1883 - -
Channel/topic examples
- Set custom channel:
/mqtttopic birdnest/BirdNestCam1/status
- Reset to default channel:
/mqtttopic_reset
Published payloads
State payload (status) is JSON and includes:
schema_versiondevicereason(boot,periodic,manual,config_updated, ...)iprssiuptime_stemp_cbattery_vbattery_pctmaint
Event payload (event) is JSON and includes:
schema_versiondeviceeventdetailuptime_s
GitHub OTA event payload additionally includes:
reason— machine-readable reason code (e.g.no_update,battery_low,sha256_mismatch)current_version— running firmware versiontarget_version— target version being installed (empty if check-only)channel—stableorbeta
OTA event types: ota_check_start, ota_check_no_update, ota_update_available, ota_install_blocked, ota_update_start, ota_update_progress, ota_update_ok, ota_update_fail, ota_check_fail
Availability payload (availability) values:
online(retained on successful connect)offline(retained via LWT or explicit MQTT disable)
NVS Storage Structure
All keys live in the birdnest namespace unless otherwise noted.
Device identity
| Key | Type | Description |
|---|---|---|
devLabel | string | Runtime device label (default: BirdNest-XXXXXXXX) |
otaHost | string | ArduinoOTA mDNS hostname (default: birdnest-xxxxxxxx) |
Telegram credentials and runtime config
| Key | Type | Description |
|---|---|---|
botToken | string | Telegram bot token |
chatId | string | Telegram main chat ID |
debugChatId | string | Telegram debug chat ID |
sleepSec | uint32 | Deep sleep interval in seconds |
maintMode | bool | Maintenance mode |
dbgVerb | uint8 | Debug verbosity (0–2) |
camMirror | bool | Camera mirror |
camFlip | bool | Camera vertical flip |
lastMsgId | int32 | Last processed Telegram update ID |
Battery calibration
| Key | Type | Description |
|---|---|---|
bCalEn | bool | Two-point calibration enabled |
bCalA / bCalB | float | Calibration slope / offset |
bCalRV1/MV1/RV2/MV2 | float | Calibration reference points |
ArduinoOTA recovery
| Key | Type | Description |
|---|---|---|
otaArmed | bool | Recovery mode armed |
otaCycles | uint16 | Recovery cycles remaining |
WiFi
| Key | Type | Description |
|---|---|---|
wifiFail | uint16 | Consecutive WiFi boot failure counter |
MQTT
| Key | Type | Description |
|---|---|---|
mqttHost | string | Broker host/IP |
mqttPort | uint16 | Broker port |
mqttUser | string | Username (optional) |
mqttPass | string | Password (optional) |
mqttTopic | string | Custom state topic (optional) |
GitHub OTA (namespace: birdnest_gh)
| Key | Type | Description |
|---|---|---|
otaAuto | bool | Auto-update enabled |
otaChannel | string | stable or beta |
otaToken | string | GitHub API token |
otaLastChk | uint32 | Unix timestamp of last check |
otaWifiFail | uint16 | WiFi stability fail streak |
otaChkFail | uint16 | Check fail streak |
otaWifiOk | uint8 | Stable cycles counter (backoff reset) |
otaBackoff | uint32 | Backoff end timestamp |
otaTarget | string | Pending install target (JSON) |
otaLastReason | string | Last block/fail reason code |
otaRebootFlg | bool | Set before install reboot |
otaLastTgt | string | Last attempted install version |
Power Consumption & Battery Life
- Awake: ~80–150 mA
- WiFi connecting: ~150 mA
- Camera: ~200 mA
- Deep sleep: ~0.1–0.5 mA
Example: 2000 mAh battery with 5-min photo interval = 100+ hours of operation Night sleep (12 hours OFF) saves 50%+ battery
Parts
68| Qty | Value | Footprint | References |
|---|---|---|---|
| 10 | 100nF | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C1, C3, C7, C10, C11, C16, C19, C20, C22, C25 |
| 5 | TestPoint | TestPoint:TestPoint_Pad_D3.0mm | TP1, TP2, TP3, TP4, TP5 |
| 4 | 100k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R15, R18, R23, R27 |
| 4 | MountingHole | MountingHole:MountingHole_3.2mm_M3 | H1, H2, H3, H4 |
| 3 | 100uF | Capacitor_THT:CP_Radial_D6.3mm_P2.50mm | C2, C6, C12 |
| 3 | 10uF | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C15, C23, C24 |
| 3 | 1M | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R19, R28, R29 |
| 2 | 4.7k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R6, R12 |
| 2 | CableTieHole_5.3mm | BirdNestV3:CableTieHole_5.3mm | H5, H6 |
| 1 | 100R | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R11 |
| 1 | 10k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R1 |
| 1 | 10k 3950 K | Connector_PinHeader_1.00mm:PinHeader_1x02_P1.00mm_Vertical | TH1 |
| 1 | 1k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R10 |
| 1 | 2.2M | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R30 |
| 1 | 22k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R17 |
| 1 | 22uF | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C8 |
| 1 | 22uH | Inductor_SMD:L_10.4x10.4_H4.8 | L1 |
| 1 | 3.9k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R14 |
| 1 | 330R | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R13 |
| 1 | 39k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R22 |
| 1 | 47uF | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C9 |
| 1 | 680R | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R25 |
| 1 | AM312 connector | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3-5.08_1x03_P5.08mm_Horizontal | J2 |
| 1 | Battery | BirdNestV3:BAT_1042 | BT3 |
| 1 | CN3065 | CN3065:DFN300X300X90-9N | U11 |
| 1 | DMG2305UX | DMG2305UX:SOT23 | Q9 |
| 1 | DS18B20 | Package_TO_SOT_THT:TO-92_Inline | U1 |
| 1 | DW01A | Package_TO_SOT_SMD:SOT-23-6 | U10 |
| 1 | ESP32-CAM | ESP32-CAM:ESP32-CAM | U4 |
| 1 | FQP27P06 | Package_TO_SOT_THT:TO-220-3_Vertical | Q6 |
| 1 | FS8205A | FS8205A:SOP65P640X120-8N | Q3 |
| 1 | Jumper_2_Open | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | JP7 |
| 1 | LED GREEN | LED_SMD:LED_0805_2012Metric | D7 |
| 1 | LED RED | LED_SMD:LED_0805_2012Metric | D8 |
| 1 | LM393 | Package_DIP:DIP-8_W7.62mm | U7 |
| 1 | ME2188A50PG | Package_TO_SOT_SMD:SOT-89-3 | U3 |
| 1 | PIR OR DS18B20 | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | JP3 |
| 1 | SMAJ90CA | Diode_SMD:D_SMA | D9 |
| 1 | SS34 | Diode_SMD:D_SMA | D10 |
| 1 | Solarpanel | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_Horizontal | J4 |
| 1 | TL431DBZ | Package_TO_SOT_SMD:SOT-23 | U8 |
More from VorosEgyes/BirdNest
2- 2 layers100 × 100 mm

- 2 layers94 × 78.2 mm

Similar boards
- 2 layers46 × 90 mm

- 2 layers78 × 99 mm

B W Master
Alihk93/B-W_Master_Slave_RF
Design, validate, and release two manufacturable PCBs that together form a one-way wireless link: a solar-powered remote node (**R_Slave**) transmits a 433.92 MHz ASK/OOK signal to a mains-powered base unit…
80 parts - 4 layers56 × 114 mm

STM32 x RFM96 v2
collins-emasi/KiCAD-PROJECTS-PCB
In this repository, I will be sharing some of the project I'm working on with KiCAD software.
103 parts1 - 2 layers78 × 103 mm

Embedded.old
borisg912/3DNA
This project creates a flat cylindrical DNA model with: - Magnetic DNA bases with color-coded NeoPixel LEDs and unique resistor values for identification - Interactive base pairing game that validates correct DNA base…
121 parts2GPL-3.0 - 2 layers159 × 99 mm

Controller f407
wa1hco/rotator_controller
Clean slate rebuild of full featured rotator controller.
122 partsGPL-3.0 - 2 layers120 × 92 mm

RotatorController
wa1hco/Rotator-Controller-V2
Designed to remotely control CDE rotors. Updated design with new enclosure and optional user interface
60 partsCC0-1.0 - 4 layers102.7 × 77.6 mm

Espcam
mazyacin/espcam-breakout-board
high end espcam breackout board for IOT and monetering
64 partsMIT - 2 layers60.1 × 31.8 mm

PCB Design
SarusanS/Smart-Water-Bottle
A standalone smart water bottle that tracks daily water consumption using a ToF sensor and IMU-based motion detection.
51 parts
Questions
How big is the BirdNestV3 PCB?
It measures 100 × 100 mm and has 2 copper layers, 1.6 mm thick.
What parts does the BirdNestV3 use?
68 parts, built around the ESP32-CAM, DS18B20, ME2188A50PG and CN3065. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the BirdNestV3 KiCad files?
From the VorosEgyes/BirdNest repository on GitHub, at the commit this page was made from: the board is hardware/BirdNestV3/BirdNestV3.kicad_pcb and its schematic hardware/BirdNestV3/BirdNestV3.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the BirdNestV3 design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).