Jack Shkifati

03 / 10 · Hardware · RTOS · Signal processing

Embedded Sentry

A multi-threaded, event-driven gesture lock on an STM32 with Mbed OS. An interrupt-driven 1 MHz SPI pipeline reads the gyroscope, and Dynamic Time Warping matches the gesture at any speed.

1 MHz
interrupt-driven SPI
DTW
variable-speed matching
Stylized 3D model of Embedded Sentry
Fig. 00 · Stylized model, not CAD
Fig. 01

Try it

AI-generated voice and avatar
Interactive demoDraw a gesture to set the key, then unlock it
01

Problem & approach

The problem

Use a hand movement as the key: record a gesture once, then recognize it again even when it is performed at a different speed.

The approach

An event-driven Mbed OS program on the STM32: a worker thread handles button interrupts, mutexes guard shared flags and sensor data, and an interrupt-driven SPI pipeline feeds a complementary filter and a DTW matcher.

02

How it works

  1. ConcurrencyConcurrent task scheduling with a dedicated worker thread for asynchronous button interrupts, and mutexes that prevent race conditions on shared flags and 3D sensor data.
  2. SPI pipelineAn interrupt-driven SPI pipeline at 1 MHz captures raw gyroscope telemetry, with EventFlags for non-blocking data-ready callbacks.
  3. FilteringA complementary filter stabilizes the angular velocity.
  4. MatchingDynamic Time Warping with Euclidean distances matches the gesture sequence even when it is performed faster or slower.
03

Results & stack

1 MHz
interrupt-driven SPI
DTW
variable-speed matching
  • STM32
  • Mbed OS
  • SPI
  • C++
  • DTW