A 3D-printed nest box with an ESP32-CAM in its roof that photographs every bird coming in, saves the visits on a microSD card and shows them on your phone.
How the parts fit together, and what each detail of the build is for.
01The nest box opened the way you get at the camera: the body slides forward out of the roof, and the lid lifts off the camera case.
Project snapshot
A quick overview of the hardware, firmware, and behavior behind this build.
Visit detection
01
The camera itself is the motion sensor. Every 700 ms it compares a small frame with the picture of the empty box, leaves out changes of light across the whole picture, and photographs the bird when enough of it changed, with three sensitivities and a wait between photos.
Visits on the card
02
Each visit is a photo up to 1600 × 1200 (SXGA by default) and a small picture of the moment the bird came in, saved on the microSD card with its date and time. The oldest visits make room for new ones when the card fills up.
HTTP API
03
The visits are a JSON list at /api/visits and each photo a JPEG at /api/visits/photo, with live snapshots at /api/capture, so scripts, home automation servers and AI agents can use them. A Markdown guide at /llms.txt explains the API to agents.
Setup flow
04
Flashed from the browser, then set up from a hotspot on first boot, with local access through gizmo-birdhouse.local on supported networks. No code to edit and no credentials in the firmware.
Gizmo Birdhouse answers the question every birdhouse owner has: who came by today? An ESP32-CAM in its roof watches the nest, and when a bird hops in, it takes a photo and saves it on its microSD card, with the date and time. Open the web app on your phone, and the visits are there, newest first.
A photo of every visit, up to 1600 × 1200, with no sensor to wire: the camera itself notices the bird
The visits saved on the microSD card, with their date and time, and the oldest ones making room for the new
A web app built into the firmware, to browse the visits, take a live snapshot and set the detection from your phone
A 3D-printed nest box for the great tit, with the camera above a false ceiling, out of the nest
The firmware watches the box in a task of its own, so the web app always answers while it does.
Step
What happens
Watch
Every 700 ms, the camera takes a small frame and the firmware compares it with the picture of the empty box, leaving out changes of light across the whole picture, like a cloud or the evening.
Photograph
When enough of the picture changes, the firmware keeps that frame as the small picture of the visit, takes the photo at the resolution of the settings, and saves both on the card under a new visit number.
Browse
The web app reads the visits from the birdhouse and shows them newest first. Each photo comes straight from the card, and scripts get the same list from /api/visits.
After a visit photo, the birdhouse waits before the next one (30 s by default), so a bird that stays, like one sitting on its nest, isn't photographed every second.
Gizmo Birdhouse turns a few euros of hardware into a nest box you can look into without opening it, and a record of every bird that came by.
01See who uses the nest box, and when, without disturbing it.
02Follow a nest from the first visit to the day the young fly out.
03Pull the visits into a script, a home automation server or an AI agent with one HTTP request.
The web app
What you see on your phone once the device is on your Wi-Fi.
What you need
The parts to get before you start, and what to look for when you buy them.
1×
AI Thinker ESP32-CAM
With the OV2640 camera and the 4 MB of PSRAM the firmware needs: every AI Thinker module has both.
1×
ESP32-CAM-MB USB board
The USB adapter the ESP32-CAM plugs into, for flashing and power: the ESP32-CAM has no USB port of its own.
1×
microSD card
Formatted as FAT32, up to 32 GB: bigger cards come as exFAT, which the ESP32 can't read. The visits are saved on it.
1×
Micro-USB data cable and 5 V supply
The birdhouse runs from USB all the time, so it needs a good 5 V supply within reach of the cable: the flash LED and the Wi-Fi draw current peaks a weak one can't handle.
Setup flow
Follow these steps to get the project running, from the first local setup to the initial upload or configuration.
01
Step 1
Put the microSD card in and connect the ESP32-CAM over USB
Format a microSD card as FAT32 (up to 32 GB) and push it into the slot of the ESP32-CAM. Sit the ESP32-CAM on its ESP32-CAM-MB USB board, and plug that into your computer with a data USB cable. Use Chrome or Edge, so the browser flasher can find its serial port.
02
Step 2
Flash the prebuilt firmware from this page
Scroll down to the firmware flashing card, start the upload from the browser, and wait for it to complete. If the flasher can't connect, hold IO0 on the MB board, press and release RST, then release IO0 and try again. When it's done, press RST to start the new firmware.
03
Step 3
Connect the birdhouse to your Wi-Fi
On the first boot, join the Gizmo-Birdhouse hotspot with your phone, and pick your network on the page that opens. The Wi-Fi is saved on the board, never in the firmware, and the birdhouse sets its clock from the internet so every visit has a date.
04
Step 4
Open gizmo-birdhouse.local and check the camera
Open gizmo-birdhouse.local, or its IP address, and take a snapshot from the Camera tab to see what the camera sees. Inside the box the bird is only about 10 cm from the lens: turn the lens a little until a snapshot of something that close is sharp, then close the box and hang it up. The visits show up in the Visits tab, newest first.
A few practical answers about how the project works, how it is configured, and what to expect from the hardware.
The printed nest box is sized for the great tit: 124 mm inside, with a 32 mm entrance that lets it in and keeps starlings and sparrows out. The entrance is at least 15 cm over the floor of the box, out of reach of a cat's paw, and grooves under it help the young climb out.
No. The camera itself notices when a bird comes in: it compares each frame with the picture of the empty box and takes a photo when enough of it changes. There is nothing to wire besides the ESP32-CAM and its USB board.
The camera sits above a false ceiling, out of the nest, and only its lens looks down. The flash is off by default, since bright white light can scare a nesting pair: turn it on for a quick look into an empty box. A wait between photos (30 s by default, up to an hour) keeps a bird sitting on its nest from filling the card.
On the microSD card of the ESP32-CAM, with the date and time from the internet. The web app shows them newest first, so you can save or delete each one, and the oldest visits make room for new ones when the card fills up or after 1000 visits.
No. You flash the prebuilt firmware from this page, then pick your network from your phone on the birdhouse's setup hotspot. The Wi-Fi is saved on the board, and the firmware has no secrets in it.
No. The web app and the API have no login, so anyone on your network can see the visits. It only answers requests sent to its own name or address, but keep it on a network you trust and never expose it to the internet.
Source code
View Gizmo Birdhouse on GitHub
Browse the repository for firmware, hardware notes, and the implementation details behind this build.