FPGA DEVICES · ENGINEERING · SOURCING Source-linked information. Clear project requirements.

Tutorials

Design a Motion Data Logger with nRF52840 and LSM6DSOX

Published · Updated

A motion logger needs a defined data record, enough storage for its disconnected interval, and a sampling path that does not wait for a phone. An nRF52840 and LSM6DSOX are candidates for the control, wireless, and motion-sensing roles, but choosing them does not finish the power, storage, firmware, or mechanical design. This article develops an untested prototype architecture and a storage worksheet. It is a design study, not a tested wearable, medical device, or ready-to-manufacture reference board.

Set a Measurable Logging Requirement

Specify the recording contractRequirements determine whether the design is a live display, recorder, or both.Specify the recording contract1Motion requirementAxes / rate / range2Record definitionBytes / time / gaps3Offline intervalStorage and full policy4Acceptance evidenceRecoverable ordered dataConcept diagram / not a measurement
Requirements determine whether the design is a live display, recorder, or both.

Define what the logger must preserve. List the required axes, sample rate, measurement range, timing accuracy, recording duration, and acceptable behavior when storage fills. State whether the device must continue recording when the phone disconnects. A live motion display and an autonomous recorder may use similar components but need different buffering, storage, and recovery strategies. Resolve that difference before drawing the block diagram.

For the worked calculation, assume one application record at 104 records per second, with sixteen stored bytes per record. This is an application-format assumption, not the sensor's FIFO-word format or a measured firmware output. The six raw sixteen-bit axis values would occupy twelve bytes; the remaining four bytes in this illustrative format could hold a relative time field. A real format may require additional sequence information, status, checksums, alignment, or chunk headers. Include those costs when the format is finalized.

Specify the meaning of a missing record. Will the logger stop, overwrite the oldest data, reduce its recording rate, or continue while explicitly reporting a gap? The choice depends on the application. Silent loss is usually harder to analyze than a declared gap. Include a recording-session identity and a way for the reader to distinguish a restart from a continuous run, even if that metadata is stored once per file rather than in every sample.

Define acceptance in terms of recoverable data. For example, require the host reader to identify record order, detect declared gaps, interpret units and scaling, and reject an incomplete final chunk. Those are proposed requirements to test. They are more actionable than “reliable wearable data,” which says little about timing, failure behavior, or the conditions under which reliability will be assessed. Keep comfort, enclosure, charging, and environmental requirements in the project brief as separate design work.

Choose the MCU Sensor and Optional Storage

Motion logger candidate rolesCandidate architecture; it is not a validated circuit, wearable or medical product.Motion logger candidate rolesLSM6DSOXMotion sensingnRF52840Control + wirelessOptional flashCapacity still to selectPower subsystemIndependent designworkConcept diagram / not a measurement
Candidate architecture; it is not a validated circuit, wearable or medical product.

Use the nRF52840 device page to investigate the controller and wireless role, and the LSM6DSOX page for the motion sensor's documentation. Select the exact package, board or module, supply arrangement, and supported development environment before implementing the interface. A component's presence in the website catalogue is a starting point for review; it does not establish that a particular combination has been electrically connected or validated by FPGA.io.

Choose the sensor interface from the exact device specifications and the prototype's constraints. Review voltage domains, bus ownership, pull components where applicable, interrupt access, and routing. Preserve a way to observe the interrupt and bus during development. A prototype built on evaluation boards can help separate firmware questions from a new PCB's hardware questions, but record the actual board revisions and any level translation or onboard circuitry that affects the test.

External flash is optional only if the recording requirement can be met without it. The linked W25Q128JVSAQ is a candidate memory to investigate, not a declaration that it provides the worksheet's default capacity. The worksheet defaults to an abstract 64 MiB storage budget. Do not assign that number to the linked part. Establish the selected memory's capacity in bytes, electrical interface, erase organization, write behavior, and software support from its own documentation before completing the BOM.

Add other sensors only for a stated requirement. The LPS22HH page can support investigation of a pressure-sensing extension, but an unused sensor increases power, firmware, and verification work. The power subsystem remains a separate selection: regulator, battery, charging arrangement, protection, and measurement access depend on the product requirements. Do not infer a safe charging or battery design from this logger block diagram. Treat the architecture as a set of candidate roles with explicit unresolved engineering decisions.

Budget Record Size and Storage Time

Separate the stored recordIllustrative application format, not the LSM6DSOX FIFO-word format.Separate the stored record12 bytesSix raw 16-bit axes4 bytesAssumed time field16 bytesExample application record104 records/s1,664 stored bytes/sConcept diagram / not a measurement
Illustrative application format, not the LSM6DSOX FIFO-word format.

Calculate stored data rate as record rate multiplied by stored bytes per record. At 104 records per second and sixteen bytes per record, the illustrative rate is 1,664 bytes per second. Define usable capacity as nominal capacity multiplied by the fraction retained after reservation. With an assumed 64 MiB capacity and twenty percent reserved, usable space is 53,687,091.2 bytes in the planning arithmetic. Dividing by the data rate and then by 3,600 gives about 8.96 hours.

The fractional usable byte count is a budgeting result, not a real allocation. Actual storage is divided into pages, sectors, blocks, or files, and the usable capacity must ultimately be rounded down to the implemented allocation. Reserve space for metadata, erase management, recovery information, and any other data sharing the device. The calculator reports an estimate; the firmware's measured allocation determines the final recording duration.

Distinguish MiB from MB. One MiB is 1,048,576 bytes, while one decimal MB is 1,000,000 bytes. Record which unit a component specification or filesystem report uses. Also distinguish bits from bytes when reading a flash density. An unnoticed unit conversion can create a much larger error than rounding the final duration to two decimal places. The worksheet makes the capacity unit explicit and rejects empty or non-positive capacity inputs.

Try changing one requirement at a time. Doubling stored bytes per record halves the estimated duration if other inputs stay fixed. Increasing reserved space reduces duration without changing the sensor rate. Adding a second stream requires its own stored rate, not simply a larger nominal sample-rate label. For mixed record types, compute their total average storage demand and separately check burst and write-latency requirements. Capacity arithmetic alone cannot establish that the storage device can sustain the write workload.

Interactive planning worksheet

The worked method remains in the article. JavaScript adds input fields and a local summary export; no data is submitted.

Separate Sampling from Wireless Transfer

Separate acquisition and transferQueue ownership and full behavior must be defined at every handoff.Separate acquisition and transfer1Sensor acquisitionOwn bounded buffers2Storage writerHandle erase / write delays3Wireless transferPhone may disconnect4Queue policyStop or declare a gapConcept diagram / not a measurement
Queue ownership and full behavior must be defined at every handoff.

Separate sensor acquisition, storage writing, and wireless transfer into cooperating activities with explicit queues. Acquisition should not block indefinitely while waiting for a phone or a flash erase operation. Define who owns each buffer and when ownership transfers. For example, a completed data chunk can move from the acquisition path to a storage queue while the acquisition path fills another buffer. This is an architectural pattern to implement and test, not supplied production firmware.

Specify the queue-full policy. If storage is temporarily busy, estimate how much incoming data accumulates before the writer resumes. If the delay can exceed the available RAM, decide whether to stop recording or declare a loss event. Avoid overwriting a buffer that a writer or wireless task is still using. Sequence identifiers and explicit ownership states make these faults easier to detect than a single shared array with an informal “ready” flag.

For wireless transfer, use measured application throughput under the selected phone, firmware, connection settings, and radio conditions. A radio PHY rate is not the application's delivered byte rate. Nordic's throughput example is a useful experimental starting point, but select a fixed SDK release and board configuration that supports the nRF52840 before adapting it. No particular SDK release or throughput result is validated by this article.

Decide whether wireless traffic carries live samples, stored chunks, or both. Downloading recorded data while continuing to sample creates simultaneous workloads that should be tested together. Define acknowledgements or chunk verification at the application layer if the use case requires an end-to-end record of completed transfers. After a disconnect, resume from an agreed position instead of assuming that the receiver obtained every byte the sender queued. Keep these transfer guarantees distinct from the sensor's sampling guarantees.

Plan Power States and Verification

Measure relevant power statesConcept activity timeline; durations and currents are not measured or drawn to scale.Measure relevant power statesAcquireWriteTransmitIdleTime (not to scale)Concept diagram / not a measurement
Concept activity timeline; durations and currents are not measured or drawn to scale.

List the states that affect current: idle, sensor acquisition, processor activity, flash programming or erase, wireless transfer, and any charging or external-power condition. Record which activities overlap. A simple duty-cycle estimate can organize measurements, but do not add unrelated typical datasheet currents and present the result as measured battery life. Regulator efficiency, sleep configuration, peripheral behavior, and the chosen board implementation affect the actual input demand.

Use the power-rail planning tool to organize supply assumptions, then measure the prototype in its defined states. Capture both average behavior and transients relevant to the supply design. Record the measurement point and whether the setup includes development-board LEDs, debug interfaces, or other loads absent from the intended product. Measurements on a development kit can guide investigation without being a direct battery-life result for a custom wearable board.

Verify data integrity under stressful but controlled conditions. Test phone disconnects, storage delays, low remaining storage, application restarts, and interrupted writes. Confirm that the reader can recover completed chunks and identify incomplete data. Check sample ordering and time interpretation over the full intended duration rather than validating only a short screen display. Keep a record of every detected gap and compare it with deliberately introduced interruptions.

Separate motion-data quality from transport correctness. Correctly stored bytes can still represent unsuitable sensor placement, range selection, calibration, or mechanical coupling. Define the physical experiment and expected interpretation for the intended application. This article does not validate physiological measurements or clinical use. For a general motion prototype, start with simple repeatable movements and stationary intervals, and record mounting orientation and processing settings so that later changes can be evaluated against a known baseline.

Create the Prototype BOM and Test Plan

Prototype with observable gatesProposed verification milestones; no hardware completion results are claimed.Prototype with observable gates1Read sensor identityVerify basic interface2Sustain ordered recordsCount and interpret samples3Store / recover chunksTest interruption behavior4Transfer under loadTest reconnect + powerConcept diagram / not a measurement
Proposed verification milestones; no hardware completion results are claimed.

Organize the BOM by role: controller or module, motion sensor, optional storage, power subsystem, clock and support components where required, programming access, connectors, and enclosure-related hardware. For every selected part, include the exact ordering code and the reason it is needed. Keep alternatives conditional on an interface and firmware review. A similarly described sensor or memory is not automatically a drop-in replacement.

Progress through observable milestones. First identify the sensor and read a small data set. Then verify sustained acquisition with record counters. Add storage and test interrupted-write recovery. Add wireless transfer and check reconnect behavior. Finally run the combined workload for the required duration while collecting current and queue-occupancy evidence. Each milestone should retain firmware revision, hardware revision, configuration, expected result, actual result, and unresolved issues.

Export the storage calculation together with its inputs so that a later BOM change cannot silently preserve an obsolete recording-duration claim. In a no-script environment, use rate times record size for bytes per second, convert capacity to bytes, subtract the reserved fraction, and divide by rate. Check the static worked example before entering project values. The result does not include measured flash endurance, radio throughput, battery life, or a guarantee against power-loss corruption.

For a device enquiry, follow the relevant existing chip page and provide the exact code and quantity. For a project discussion, provide the recording requirement, candidate architecture, calculation, and test milestones through the engineering entry. Copying the summary does not submit the enquiry. The useful outcome of this study is a reviewable prototype plan: what each chip is expected to do, how much data the system must preserve, and what evidence is still needed before calling the logger a working product.

Sequence illustration and static alternative

Concept animation: highlighted stages show the order of checks, not elapsed time or a measured hardware result. Close the disclosure to hide motion. The numbered static diagram provides the same sequence.

Static four-stage sequence for Design a Motion Data Logger with nRF52840 and LSM6DSOX
Read the numbered stages from top to bottom. All stages are conceptual.
Show the short illustrative animationNamed task animation: Design a Motion Data Logger with nRF52840 and LSM6DSOX

Continue the specific engineering task

  • nrf52840 — Review the exact device identity and linked documentation.
  • lsm6dsox — Review the exact device identity and linked documentation.
  • w25q128jvsaq — Review the exact device identity and linked documentation.
  • lps22hh — Review the exact device identity and linked documentation.
  • power rails — Use this related method or service to resolve the next requirement.
  • Prepare an engineering review — Use this related method or service to resolve the next requirement.

Prepare an enquiry after reviewing the result

Copy or download your worksheet first. Include the exact part, quantity and unresolved conditions for a component enquiry, or board revision, requirements and test scope for a project discussion. These links open the enquiry entry; this page does not submit a request or promise automatic prefill.

Open the component enquiry entry · Discuss the engineering scope

Source scope and editorial method

ST LSM6DSOX official product page is the primary manufacturer reference for this article. Source check: 2026-11-13. This article presents planning methods; it does not establish measured prototype results, current stock or delivery availability.

Additional reference addresses (plain text; scope must be checked for the selected board and software):

ST AN5272 LSM6DSOX application note Rev 5 — https://www.st.com/resource/en/application_note/dm00571818-lsm6dsox-alwayson-3d-accelerometer-and-3d-gyroscope-stmicroelectronics.pdf
Nordic official Bluetooth throughput example — https://github.com/nrfconnect/sdk-nrf/blob/main/samples/bluetooth/throughput/README.rst

Back to Tutorials →

Related evidence and next tasks

Continue the task with the relevant source scope. These reading paths do not establish interchangeability or current supply.

Source addresses and citation trail

Full source addresses are retained below. Read each citation with its document revision, page, table and applicability conditions above.

  1. https://www.st.com/en/mems-and-sensors/lsm6dsox.html