Project

Buddy System

LoRa-based hiking beacon with GNSS (In Progress)

Overview

A private network of handheld tracking devices currently in development for hikers and outdoor enthusiasts. Built with STM32WLE5JC and FreeRTOS, enabling off-grid location tracking through LoRa communication and sensors.

Highlights

  • 10 km LoRa range with mesh networking between 4+ devices
  • FreeRTOS task scheduling for sensor polling, LoRa TX/RX, and UI updates
  • NFC-based device configuration through mobile app
  • Custom PCB with compass, barometer, OLED display, and AES encryption
  • 5-day battery life with low-power sleep modes and distance-based positioning

Tech Stack

STM32WLE5JCFreeRTOSLoRaNFCI2CPCB DesignCEmbedded Systems

Problem Statement

Existing tracking devices like Garmin inReach Mini 2 ($400+ with subscription) and eTrex 22x ($300) rely heavily on GPS satellites and cellular infrastructure, making them expensive and dependent on external services. The Buddy System addresses three key issues: lack of connectivity in remote areas, high recurring costs, and the absence of direct group communication. By creating a private LoRa mesh network, hikers can track each other's relative positions without GPS, subscriptions, or phone connectivity.

System Architecture & Block Diagram

The Buddy System architecture centers around the STM32WLE5JC microcontroller with integrated LoRa transceiver. The block diagram illustrates the complete system design including power management, sensor interfaces, communication modules, and user interface components. Each device functions as both a transmitter and receiver in the mesh network, enabling peer-to-peer communication without central infrastructure.

System block diagram showing STM32WLE5JC integration with LoRa, NFC, sensors, and display

System block diagram showing STM32WLE5JC integration with LoRa, NFC, sensors, and display

System Architecture

  • STM32WLE5JC microcontroller (48MHz, 256kB flash) with integrated LoRa and hardware AES encryption
  • FreeRTOS with priority-based task scheduling: LoRaTask, DisplayTask, SensorTask, ButtonTask, PowerTask
  • Compass and barometer sensors for relative positioning using Time-of-Flight (ToF) and RSSI measurements
  • 1-inch I2C OLED display with 3-button menu interface and visual feedback
  • NFC module for one-tap device configuration and pairing through mobile app
  • Piezo buzzer and LEDs for audible/visual alerts during close-range device location

Implementation Details

Each device broadcasts encrypted data packets containing device ID, timestamp, compass bearing, and barometric altitude at configurable intervals (15 min sleep mode, 1 min active mode). Devices calculate relative distance using LoRa RSSI and ToF, then display bearing and distance to other devices on the OLED. The custom PCB includes a patch antenna for NFC, debounce circuitry for buttons, and a hardware watchdog timer. Power management uses STM32 low-power modes with ADC monitoring for battery voltage. The system supports up to 10 km range in ideal outdoor conditions.

Key Challenges

  • Trilateration algorithm: Solved intersection of circles using pairwise distance measurements to calculate 2D coordinates
  • RTOS task synchronization: Used FreeRTOS mutexes and event flags to prevent I2C bus conflicts between sensor and display tasks
  • LoRa timing coordination: Implemented TDMA-like scheduling to avoid transmission collisions in the mesh network
  • Power optimization: Achieved 5-day battery life by reducing display refresh to 15Hz and using deep sleep between broadcasts
  • PCB antenna design: Designed patch antenna for NFC with proper impedance matching and ground plane

Results & Specifications

Successfully demonstrated 4-device network with ~800m range in wooded terrain. Location accuracy within 30 feet using trilateration. NFC configuration completes in under 10 seconds. Device weight under 150g with rechargeable Li-ion battery. Fault detection system handles low battery, communication timeout, sensor failure, and over-temperature conditions. The device operates in temperatures from -30°F to 120°F in a weather-sealed 3D printed enclosure.

Senior Design Experience

  • Completed full product development cycle: proposal, requirements specification, technology investigation, and implementation
  • Designed custom PCB in Altium including power regulation, sensor breakouts, and antenna layout
  • Developed mobile app for NFC configuration with device naming and firmware updates
  • Created comprehensive system requirements document with 50+ functional and hardware requirements
  • Presented at MSOE Senior Design Show demonstrating live tracking between multiple devices