Projects

Embedded systems

STM32 Backpack Alarm

An interrupt-driven backpack alarm with motion sensing, PIN control, and live configuration over Bluetooth.

The assembled alarm in a plastic enclosure, with a numeric keypad and battery pack on its lid.
The assembled prototype: keypad, battery pack, and the enclosure housing the STM32-based electronics.
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

  1. Arm the device. The PIN keypad activates alarm mode. A computer can also arm or disarm the device over Bluetooth.
  2. Detect initial motion. The vibration sensor detects the first movement and activates ADC sampling.
  3. 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.

Inside the alarm enclosure: STM32 boards, breadboards, sensors, and jumper wiring.
Inside the enclosure. The prototype brings sensing, communication, and user input together on the boards and breadboards.

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 development workbench with STM32 Nucleo boards, a Bluetooth module, breadboards, keypad, and battery pack.
The system during development, before the electronics were packaged together.

The result was a working prototype of an interrupt-driven backpack alarm, with local PIN control and remote configuration over Bluetooth.