← all projects

project

Stackable multi-beam IR security detector

Two blocks facing each other across a protected zone. Break any beam and both fire their relays. Stack up to five detector units per block without touching the firmware.

Date
Jun 2024
Role
PCB design, firmware, troublishooting, product testing
Status
shipped
Built with
ATmega328P, ATtiny44, Embedded C, IR beam detection, PCB design

I contributed to the firmware design, PCB-design, troublishooting, product testing and final validation.

The idea is straightforward. Two blocks, M and S, face each other across whatever gap you’re protecting. M emits an IR beam from its top, S from its bottom, and each block’s detector units watch for the other’s beam. The moment any beam breaks, both blocks fire their relay outputs simultaneously.

The facinating part of this project is how the hardware scales. Three PCB types: an alarm and control unit (ATmega328P) at the base of each block running the show, an IR emitter unit (ATtiny44), and an IR detector unit (ATtiny44). Up to five detector units stack per block in a daisy chain — snap them together like Lego — making the block taller and the covered area bigger without changing a line of firmware or redesigning anything.

Power is flexible too: 3.6V lithium C cells, a mains adapter, or any DC source from 12V to 24V. On battery a single rack runs about six months.

What I took away

Designed a custom signalling scheme that allowed the two blocks to communicate state through the IR beam channel itself — no additional wires or radio hardware required.

Separated all configuration into dedicated config files in the codebase, loaded and applied in a well-defined startup sequence before the super loop begins. This made it straightforward to adjust parameters and understand what was happening at boot without digging through application logic.

The IR detector units were specified to operate reliably at up to 25 metres separation, but initial builds only reached 20 metres before detection became unreliable. The issue was never in the firmware. Traced the 20-metre limit to a capacitor in the IR signal filter circuit. The capacitance was rolling off the signal too aggressively at the longer range. Correcting the component value brought detection up to the full 25-metre specification. Methodical hardware debugging caught it and a firmware changes would have gone nowhere.

HardwareFirmware