In 2020, while watching small birds nesting in my garden, I decided that I wanted to learn more – from a time series data mining point of view – about their apparent restless activity. After some initial brainstorming I realized I got into something really cool relating to digital electronics, sensors and signal processing & storage. Here’s some implementation detail:
+ Birdhouse fitted with dual-channel, pulsed-IR (38kHz) barriers
+ Atmega 328 µ-Controller acting as pulse source for the IR LEDs
+ Postgres database for long term event storage
+ NodeMCU ESP8266-12E µ-Controller as master:
- fifo-type binary event buffer for 2 event channels (IR light barriers)
- regular-expression style evaluation of event pattern + pattern duration (see table below):
- detection of direction: (out > in) vs. (in > out) and depth of a connected action:
- show: penetrate, retract from single barrier
- peek: penetrate, retract through two barriers
- look: penetrate, retract through two barriers, freeing initial one
- walk: penetrate, retract through two barriers, passing both ones
- anti-flicker filtering, suppressing repeated state alternations < 10ms
- detection loop frequency achieved: ~ 800Hz
- NTP time sync
- periodic sensor self-checks on IR barrier function
- birdhouse connected to wifi home network
- local buffering of up to 200 qualified events in a transactional log
- birdhouse webservice (json) endpoint to deliver event logs to a backend
- Server backend (python) polling BirdyIO endpoint for new events
Event table

how this looks like in practice


full in/out transitions and other events in the 2020 nesting season

