HackSkunk had and assignment to develop simple system that would allow to detect when sisters son leaves his place at night. So he came up with prototype of motion detector based buzzer alarm based on Attiny85 microcontroller. As circuit has to be active only at night so he put a LDR resistor that cuts power in daylight.
The other principle is obvious – microcontroller simply gets trigger signal from motion sensor and then rises alarm on buzzed. No more sneaking around!