Open-source ESP32-CAM project

Gizmo Birdhouse

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.

  • A photo of every visit
  • No sensor to wire
  • Visits saved on a microSD card
Difficulty
Beginner
Build time
20 min
Soldering
No soldering
The Gizmo Birdhouse in its white and orange printed enclosure, with its arched roof and orange entrance ring, and opened up: the body slid forward out of the roof, the camera lid lifted off the ESP32-CAM, the entrance ring and the back plate.

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.

Overview

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

How it works

The firmware watches the box in a task of its own, so the web app always answers while it does.

StepWhat happens
WatchEvery 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.
PhotographWhen 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.
BrowseThe 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.

Why it is useful

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.

  • See who uses the nest box, and when, without disturbing it.
  • Follow a nest from the first visit to the day the young fly out.
  • Pull 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.

The Visits screen of the web app: the detection watching, the last visit and the space on the microSD card, then the photos of the visits, newest first.
A visit opened in the web app: the photo of a bird on its nest, its date and size, and the buttons to save the photo or delete the visit.
The visit detection settings on the Camera screen: photograph visits, the sensitivity, the wait between photos, and the resolution and flash of the visit photos.

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

    Terminal
    curl "http://gizmo-birdhouse.local/api/visits?limit=5"

Frequently asked questions

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.

Source code

View Gizmo Birdhouse on GitHub

Browse the repository for firmware, hardware notes, and the implementation details behind this build.

Open GitHub
OpenGizmo GitHub project illustration
Open source

See also

More open-source ESP32 builds you can make next.