A/AFO / Research recorder
ENGINEERING PROTOTYPE Muttakin Rahman MR
Documentation / Release 0.1 engineering preview

Build the recorder with evidence.

A practical guide to choosing one hardware configuration, assembling it in controlled stages, recording synchronized EMG and motion data, and keeping software evidence separate from physical measurements.

Design and software checks recordedFirmware builds, host tests, PCB rules, metadata, wiring data, and viewer flows have saved evidence.
Physical validation still requiredNo completed power, noise, timing, storage endurance, radio coexistence, or battery-runtime measurements.

Choose one complete setup

Every package combines one ADC choice, one EMG capacity, and one IMU family. Use its breadboard plan, firmware, converter, PCB, and documentation together. Mixing packages can silently change GPIOs, bus protocols, timing records, and channel rules.

Current-parts path: if you have the RoboticsBD AD7606 module, two bare MyoWare 2.0 sensors, two GY-521 boards, and need exactly two EMG channels, use the fixed-two AD7606 / MPU-6050 package shown first.

AD7606 · fixed two · ICM-42688-P

Same two-channel scope with SPI motion sensors and timestamp-bearing sensor packets.

16-bit2 EMGSPI IMUs

AD7606 · expandable · MPU or ICM

Four populated analog inputs. Firmware enables either two or four simultaneous 8 kHz channels.

16-bit2 or 4 EMG2 IMUs

ADS131M04 · expandable · MPU or ICM

Twenty-four-bit ADC design with external clock and ADC-specific CRC/status handling. Lab carrier availability remains a dependency.

24-bit2 or 4 EMG2 IMUs
DecisionAD7606ADS131M04ICM-42688-PMPU-6050
InterfaceSimultaneous ADC, serial readoutSimultaneous delta-sigma ADCSPII²C with FIFO
Recorded precision16-bit signed codes24-bit signed codesSensor timestamp retainedESP32 interrupt/FIFO estimate
Lab dependencyQualify exact seller moduleObtain and adapt a carrierSelect exact carrierQualify GY-521 power and pull-ups
Key open testMode straps, VIO, header and codesInput loading, clock, CRC and noiseCarrier mapping and clock alignmentRise time, FIFO timing and drift

One recorder, two acquisition paths

EMG and motion enter the ESP32-S3 through different hardware paths. The controller adds its timing evidence, writes the authoritative recording to microSD, and optionally forwards a best-effort copy over Wi-Fi.

MyoWare RAW2 default / 4 optional
→
Protected analogbias · buffer · filter
→
Simultaneous ADCAD7606 or ADS131M04
→
ESP32-S3counter · time · faults

Motion path

Foot and shank IMUs connect by SPI or shared I²C. ICM packets retain sensor timing; MPU packets retain FIFO order and ESP32 timing estimates.

Output path

microSD is the primary recording. Wi-Fi is a live convenience copy whose gaps remain visible rather than being hidden or filled.

Timing is evidence, not magic

ADC frames are simultaneous within the selected converter, but EMG and IMU clocks are independent. The recording preserves counters, trigger or data-ready timing, FIFO order, and read timing so alignment can be characterized later. Filtering and analog stages also introduce delay that must be measured before interpreting millisecond relationships.

Breadboard and compact PCB are electrically aligned at the functional level, but physically different. Development-board regulators, carrier pull-ups, wire length, connector parasitics, and layout noise mean a successful breadboard test does not prove the compact PCB's noise or radio performance.

Advance through ten measured gates

Build one block at a time. Later diagnostics preserve earlier stages, so a failure can be isolated without guessing across the complete system.

Power and midpoint

Verify polarity, regulated rails, startup, ripple, load response, and temperature with current limiting and dummy loads.

Controller

Verify programming, reset, buttons, LEDs, current, USB detection, and recording inhibition.

ADC and timing

Check communication or status, conversion timing, known DC codes, simultaneous frames, counters, and faults.

First EMG input

Use a synthetic source to measure offset, scaling, passband, baseline noise, clipping, and unplugged bias.

Remaining inputs

Verify identity, two/four-channel rules, disabled-channel handling, timing, and crosstalk.

Motion sensors

Add one IMU, then two. Verify identity, orientation, 200 Hz rate, stationary readings, timing evidence, and cable behavior.

microSD

Record continuously, convert data, test storage errors, fill behavior, and interrupted-file recovery.

Wi-Fi + SD

Observe explicit wireless gaps while confirming the primary SD file has no unexplained loss under radio load.

Battery system

Measure startup/shutdown, one-hour recording behavior, rail stability, temperature, and at least two hours of runtime.

MyoWare and wearable

Check mounting, motion artifact, cable security, AFO clearance, ethics, consent, and electrical safety before supervised recording.

Stop at a failed gate. Browsing a later stage is harmless; physically adding its hardware before the current stage passes makes fault isolation harder and invalidates the intended evidence chain.

Open an interactive staged build ↗ Read the detailed Markdown guide

Build and analyze the matching profile

Run commands from the selected design package. Expandable packages accept two or four EMG channels; fixed-two packages accept only two. Breadboard builds use GPIO47 for SD CMD, while compact-PCB builds use GPIO38.

Build a two-channel breadboard recorder

cd designs/<selected-configuration>/firmware
idf.py -B build-breadboard-2 \
  -DEMG_CHANNEL_COUNT=2 \
  -DAFO_HARDWARE=breadboard \
  -DAFO_WIFI=1 \
  -DAFO_DIAGNOSTIC_STAGE=0 \
  -DAFO_IMU_COUNT=2 build

Convert a recording

cd designs/<selected-configuration>
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r host/requirements.txt
python host/convert.py trial.afolog --out exported-trial

Receive the best-effort Wi-Fi copy

python host/live_receiver.py --help
# Join the recorder access point, start the receiver,
# then start recording on the device.

The converter exports timestamped EMG and IMU tables, metadata, quality findings, and basic plots. Recovery mode salvages valid records from an interrupted file and reports damage; it does not invent missing samples. Keep the original binary recording unchanged.

GitHub Pages hosts documentation only. A browser page on this public site cannot connect directly to a nearby ESP32 access point. Live reception runs on the laptop using the package's local receiver.

What has passed—and what has not

The repository preserves raw JSON, logs, reports, and manifests. The summary below is intentionally split by evidence type.

Integrated recorder verification · AD7606, two channels, ICM-42688-P

Laboratory firmware 1.12 compiles in nine profiles and passes the host and native tests. All 18 integrated cases pass on its simulation image in Wokwi’s web editor (12 October 2026), checked with the production converter and live decoder. The 1.11 run found a Wi-Fi preview race (a new session’s first data packet could precede its metadata), which 1.12 fixes. The AD7606 was checked against ADI’s Rev. G data sheet. Following ADI AN-1091, the PCB now holds the converter in shutdown until the firmware releases STBY on GPIO14, and a BAT760 diode limits VDRIVE − AVCC while the 5 V rail starts. This is DRC/ERC clean but not yet built. Its ICM-42688-P setup was checked line by line against TDK’s official datasheet (DS-000347 rev 1.6) and the MIKROE carrier schematic: every register write, the 16-byte FIFO packet, the 32/30 µs timestamp tick, SPI timing and supply limits match, and the production driver runs against a register-level sensor model with no rule violations. Two IMU-only bench builds (diagnostic-imu-bench-one and -two) print PASS/FAIL verdicts for identification, sample rate, timestamp step, gravity magnitude and gyroscope bias, with rate gates at the datasheet’s ±2 % clock tolerance; the converter adds a host_time_fitted_us column that removes the sensor clock error from IMU-to-EMG alignment. These are software and datasheet checks; the first measurement on real carriers is still pending. All eighteen v1.6 cases pass actual ESP-IDF execution in Wokwi’s web simulator, with complete exports checked by the converter and live decoder. Nominal saved acquisition has no detected sample loss. The recorder runs acquisition, FreeRTOS, FatFS and UDP together with documented sensor, storage and radio substitutes. The complete visible scene passed an additional nominal run. Earlier failed or incomplete attempts remain preserved; physical performance and a current downloaded VCD trace remain unqualified. The other five designs carry the same ported fixes (firmware dual-1.3 / mpu6050-1.3, 47 profiles rebuilt); their other evidence is unchanged.

Read the integrated test report ↗ Case-by-case results ICM-42688-P setup and bench check Register-model results

Open the complete system ↗

The complete-scene pin observer now verifies 10,041 ADC conversions/reads and both 200 Hz interrupt streams. An independent saved-data audit checks 21,116 record CRCs and CSV rows across two synthetic captures; examples include volts, g, degrees/s, channel labels, timing qualifications and quality reports. The partial derived pin waveform is explicitly separate from the unavailable native full-session VCD.

Read and download the saved data ↗ Inspect digital timing

The figures below describe the earlier six-package release. They do not imply that all six setups have run the new integrated simulation.

6 / 6Host suites passed
242Host tests in release summary
26Recording profiles compiled
0Physical recorders measured
Verified in softwareSix automated host suites, binary compatibility, metadata checks, fault conversion, navigation, wiring consistency, and recorded ERC/DRC reports.
SimulatedAnalog response and acquisition/storage fault scenarios using generated inputs. These exercise models and data paths.
Pending hardwareRail behavior, ADC accuracy/noise, timing drift, crosstalk, cable integrity, storage endurance, radio coexistence, thermal behavior, and runtime.
Passed — measuredReserved for a result entered after a documented lab procedure with instruments, settings, readings, limits, and evidence files.

Open release gates

  • Qualify the exact AD7606 or ADS131M04 lab carrier, including power, modes, logic levels, and loading.
  • Measure analog passband, clipping, baseline noise, channel crosstalk, and ADC code scaling.
  • Measure IMU rate, drift, interrupt timing, orientation, pull-ups, and cable reliability under SD/Wi-Fi load.
  • Complete full-card, write interruption, sustained recording, thermal, and battery-runtime tests.
  • Review the compact PCB after the breadboard gates pass; ERC/DRC alone is not an order recommendation.

Detailed validation status · Per-design automated results (JSON) · Wiring validation (JSON)

Keep bench power away from participants

Never attach a person during an instrument-connected electrical test. Disconnect charging, USB, the lab supply, oscilloscope grounds, and signal-generator grounds before electrodes are applied.

Human recording is a separate research activity. It requires institutional approval appropriate to the study, informed consent, exclusion and stop criteria, an electrical-safety review, a supervised procedure, and a plan for pseudonymous data handling.

The leg and AFO views illustrate placement only. They do not establish patient fit, pressure safety, comfort, biomechanics, or clinical benefit.

Find the right artifact quickly

designs/<configuration>/ ├── breadboard/ hole-level placements and named wire endpoints ├── firmware/ ESP-IDF source, profiles, and manifests ├── hardware/ KiCad source and component references ├── host/ converter, live receiver, plots, and tests ├── manufacturing/ Gerber, drill, BOM, placement, assembly, STEP ├── simulations/ analog models and acquisition fault scenarios ├── docs/ package-specific guides and evidence └── viewer/ guided build, detailed assembly, PCB preview documentation/ project-wide manual and evidence summaries validation/ bench-session records design-catalog.json machine-readable configuration index

Package-specific documentation takes priority for exact component values, terminals, build profiles, and numerical limits. Project-level pages explain the shared workflow and evidence boundary.

Detailed documents

Implementation

System architecture, staged build, firmware profiles, SD differences, and recording workflow.

Project participation

How to preserve configuration consistency, evidence, and attribution when proposing changes.