Embedded systems
STM32 Backpack Alarm
An interrupt-driven backpack alarm with motion sensing, PIN control, and live configuration over Bluetooth.
- Year
- 2025
- Role
- ADC sensing and Bluetooth UART
- Built with
- C · STM32 · UART · Interrupts · ADC
An alarm that goes inside your backpack
For CMPE 443 Embedded Systems, our six-person team built a prototype to detect someone picking up your backpack without you noticing. The enclosure goes inside the bag, and a PIN keypad lets you activate or deactivate alarm mode.
The system combines an STM32 Nucleo board, a vibration sensor, an accelerometer connected to the ADC, a Bluetooth module connected over UART, and the keypad. The firmware is written in C and is fully interrupt-driven.
From the first movement to an alarm
- Arm the device. The PIN keypad activates alarm mode. A computer can also arm or disarm the device over Bluetooth.
- Detect initial motion. The vibration sensor detects the first movement and activates ADC sampling.
- Measure the movement. The ADC samples the accelerometer for a set time. The program uses those measurements to determine whether movement exceeds a threshold and should trigger the alarm.
Bluetooth provides a live control and configuration interface: a computer can change device settings on the fly as well as activate or deactivate the alarm. Interrupts drive the sensing, timing, and communication work throughout the program.
My contribution: ADC and UART
I implemented the ADC path for accelerometer measurements and the UART communication used by the Bluetooth module. These were my responsibilities in the original team prototype.
I later made additional improvements in the GitHub repository, including changes to UART interrupt handling and blocking behavior for increased energy efficiency.
From the bench to the enclosure
The photographs show the development setup and the assembled hardware. My ADC and UART implementations were part of a team effort that brought sensing, alarm control, user input, and the enclosure together.
The result was a working prototype of an interrupt-driven backpack alarm, with local PIN control and remote configuration over Bluetooth.