Class Project – Client: Tiree
Sep. 2024 - Nov. 2024
We set out to support Ontario bat conservation with a universal, non-invasive counter that works on existing bat boxes(rural or urban), handles high bat traffic and both small and large brown bats, and requires minimal cleaning. We didn’t want a special box or a lab setup — we wanted a drop-in device that meets all the criteria and outperforms competitors.
Proposed First Solution
We originally designed the system around a Raspberry Pi Zero 2W, using two PIR sensors, a load cell with amplifier, and an NFC module to detect and log bat activity.
After comparing power consumption, we switched to a SAMD21 microcontroller, reducing draw from 0.2775 W to 0.0185 W and allowing us to run on a smaller 3.7 V battery while adding a microSD breakout board for data storage.
The two PIR sensors were positioned inside and outside the bat box to detect motion direction, while the load celltracked weight changes to confirm entries and exits. A temperature sensor monitored internal conditions for context.
Data was stored locally on the microSD and transferred via NFC (PN532) in .txt format when scanned—offering a quick, contactless way for maintenance teams to retrieve logs.
Note: This pinout reflects our first iteration, which used a completely different component set (NFC, PIRs, load cell, and SAMD21). The final design was fully rewired around the MKR Zero, HC-05 Bluetooth module, and IR break-beam sensors.
Our NFC module wouldn’t connect consistently and, when it did, it failed to communicate with the microcontroller despite matching protocols.
PIR sensors had unacceptable latency (~5 s; ~3 s after resistor hacks that fried five PIRs) — still far too slow for bat traffic.
The SAMD21 we started with demanded time-consuming configuration to line up interfaces with other sensors, which stalled progress.
We initially added a load cell to estimate total bat occupancy, but it required a dedicated platform and structural modifications, making the device incompatible with standard bat boxes.
We replaced the load-cell concept with a sequential, beam-based counter to keep the system universal, ditched NFC for an HC-05 Bluetooth link (BLE), which gave smoother transfers, worked with a phone app for real-time pulls, and fit our power budget; we also switched to the Arduino MKR Zero to simplify data logging and keep consumption low. (We also enforce keeping BLE off except when retrieving logs to conserve battery.)
Our Solution
We built a self-contained system around an Arduino MKR Zero that logs to the onboard microSD, reads three IR break-beam sensors (two at the lower entrance, one at the top exit), and records temperature/humidity via DHT11 for context. Data can be retrieved by BLE using an HC-05 module or by pulling the SD card. The kit mounts to the side of any bat box in a waterproof enclosure and is serviced monthly for a quick battery swap.
In lab validation, the sensor logic achieved ~96% entry/exit accuracy, data logging and BLE transfer worked reliably, and the enclosure passed drop and 24-hr waterproof tests.
Early assembly of the final system showing the Arduino MKR Zero, IR sensors, and HC-05 module housed in the waterproof enclosure before wiring optimization and sealing.
Bench test setup used to validate sensor logic and data logging. Entry and exit events were simulated to fine-tune break-beam alignment and timing thresholds.
Complete deployment fixture with the three IR break-beam sensors mounted to a wooden mock bat box, replicating real installation geometry for full-scale accuracy testing.