Week7
Week 7 Progress: BLE Transmission Testing on XIAO nRF52840
Objective:
To verify the BLE (Bluetooth Low Energy) functionality of the Seeed Studio XIAO nRF52840 microcontroller and test real-time data transmission from the ankle monitoring system to a mobile app.
Hardware Background:
The microcontroller used is the Seeed Studio XIAO nRF52840, a compact and powerful board designed for wireless sensing applications. Key features relevant to this project include:
-
Processor: Nordic nRF52840 (ARM Cortex-M4F, 64 MHz)
-
Memory: 256 KB RAM, 1 MB Flash
-
Connectivity: Integrated BLE 5.0 support
-
Power: Supports 3.3V to 5V input, battery-friendly
-
Size: 21 x 17.5 mm, ultra-compact for wearables
-
Peripheral I/O: 6 analog/digital I/O pins, I2C, UART, SPI support
This microcontroller was chosen for its low power consumption, BLE capability, and small footprint—ideal for integrating into the wearable ankle device.
Implementation:
-
The board was programmed using the Arduino IDE with the Seeed nRF52 board package installed.
-
A custom BLE service was created with a writable characteristic named
stateCharacteristic. -
Real-time system state was formatted into a composite message and transmitted once per second via BLE.
-
Data includes:
-
Current system state (
MOVINGorSTAT) -
Alarm status (
ALARMorNORMAL) -
Average ADC value multiplied by 100 for precision (integer format)
-
-
BLE data could be monitored using the nRF Connect mobile app.
Code Explanation:
-
millis(): Get the system execution time. -
stateCharacteristic.writeValue(): Write string value to the BLE stack and send to mobile application. -
BLE.poll(): Deal with communication in the BLE stack.
Results:
-
BLE advertising and connection with a smartphone (via nRF Connect) worked reliably.
-
The composite string was correctly formatted and transmitted once per second.
-
Real-time values could be observed in the app, confirming the microcontroller’s BLE communication capability and data packaging logic.


Comments
Post a Comment