Skip to content

Replace QMA6100P accelerometer with ICM-42670-P 6-axis IMU - #82

Merged
thePunderWoman merged 2 commits into
mainfrom
icm42670-imu
Oct 26, 2026
Merged

thePunderWoman merged 2 commits into
mainfrom
icm42670-imu

Conversation

@thePunderWoman

@thePunderWoman thePunderWoman commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Replaces the QMA6100P 3-axis accelerometer (U_ACCEL1) with a TDK ICM-42670-P 6-axis IMU (U_IMU1: gyroscope + accelerometer, LGA-14 2.5×3 mm, LCSC C3288646, about $1.65 each at 10 vs $0.47). Low-power wake-on-motion still works the same way, over the same single INT1 → GPIO46 line, and later firmware can use the gyro.

Electrical design (TDK DS-000451 Rev 1.1, Figure 5 / Table 10)

  • I2C on the shared OLED bus at 0x68 (AP_AD0 tied low). AP_CS goes to 3V3 to select I2C, FSYNC and RESV to GND, INT2 is unused.
  • Decoupling: 100 nF and 2.2 µF X7R (CL10B225KP8NNNC) on VDD, 10 nF on VDDIO. The QMA6100P's 100 pF and 2.2 nF parts are gone.
  • New icm42670p part in parts.kdl and a symbol in SnipsControllers_Custom.
  • Footprint: KiCad's stock LGA-14_3x2.5mm_P0.5mm_LayoutBorder3x4y. It matches the datasheet's package drawing: pad centres ±1.1625 / ±0.9125 mm, 0.5 mm pitch, pin 1 top-left. Pad-to-net map checked against Table 9.
  • The IO46 strap is safe: INT1 resets to open-drain, active-low, and IO46 has an internal pull-down, so nothing drives the pin high at boot.

Firmware

  • Accelerometer probes for the ICM-42670-P first and falls back to the QMA6100P, so V1.2 and earlier boards keep working.
  • ICM setup: soft reset, then the wake-on-motion thresholds (MREG1, about 31 mg, matching the QMA tuning), accelerometer in low-power mode at 50 Hz, and WoM triggering on the 2nd over-threshold sample, comparing each sample to the previous one. INT1 is latched, push-pull, active-high.
  • The reset-done interrupt is routed to INT1 by default. With INT1 latched it would read as constant motion, so setup turns that routing off.
  • motionDetected() checks the INT_STATUS2 bits rather than the pin alone, because in low-power mode the pin can take one sample period to clear after a read.
  • New icm42670p_registers.h with native tests against the datasheet's bit layout.

Layout and production files

  • The IMU and its caps are routed on B.Cu where the QMA6100P was. A new rule in snips_controller.kicad_dru allows 0.15 mm between the IMU's own pads. TDK's 0.5 mm pin pitch makes that gap unavoidable, and it's within standard fab capability. Traces near the IMU still have to keep the normal 0.2 mm.
  • This goes into V1.2, which hasn't been ordered yet, so the silkscreen stays V1.2 and the files are regenerated under Snips_1_2: gerbers, drills, placement, PCB BOM and the JLCPCB bundle.
  • Compared with the previous V1.2 files: the BOMs and placement differ only by U_IMU1 and C_IMU_1–3 (in place of U_ACCEL1 and C_ACCEL_1–3), the board outline and NPTH drill only by timestamp, and the JLCPCB zip has the same 30-file layout.

Still to do

  • In JLCPCB's assembly preview, check that U_IMU1's pin 1 sits where the silkscreen marks it. This is a new package for this board.
  • Bring-up: check the I2C probe finds 0x68, check wake-on-motion fires and stays quiet at rest (tune kWomThreshold with the "active:" log), and measure low-power idle current.

Test plan

  • stackup check --locked: 0 errors, 0 warnings
  • stackup bom --locked: every line has an MPN (bom_check: 0 problems)
  • ci/check_pcb_sync.py: the PCB is in sync
  • pio test -e native: 391/391 pass
  • pio run -e esp32s3: builds
  • KiCad DRC with zones refilled: 0 violations, 0 unconnected items

🤖 Generated with Claude Code

Swap U_ACCEL1 (QST QMA6100P) for U_IMU1, a TDK ICM-42670-P gyroscope +
accelerometer in LGA-14 2.5x3mm, wired per DS-000451 Rev 1.1 Figure 5:
I2C at 0x68 (AP_AD0 low), AP_CS to 3V3, FSYNC and RESV to GND, INT1 on
GPIO46 as before. Decoupling follows Table 10 (100nF + 2.2uF on VDD, 10nF
on VDDIO). The footprint is KiCad's stock LGA-14 3x2.5mm, checked
against the package drawing.

Firmware probes for the ICM-42670-P first and falls back to the
QMA6100P, so V1.2 and earlier boards keep working. The ICM path sets up
wake-on-motion on INT1 (latched, push-pull, active-high, ~31mg) and
turns off the default reset-done routing to INT1, which would otherwise
latch high after every reset.

The PCB is synced from Stackup and the new parts sit at the old spot on
B.Cu, but the area still needs re-routing (DRC is not clean yet).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The IMU swap lands in V1.2, which hasn't been ordered yet, so the
production files are regenerated in place under the Snips_1_2 name:
gerbers, drills, placement, the PCB BOM and the JLCPCB bundle. Against
the previous V1.2 files, the BOMs and placement differ only by the IMU
and its caps, and the outline and NPTH drill only by timestamp.

Also corrects the firmware and GPIO table wording: the ICM-42670-P is on
V1.2 itself, and the QMA6100P on V1.1 and earlier.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thePunderWoman
thePunderWoman marked this pull request as ready for review October 26, 2026 04:35
@thePunderWoman
thePunderWoman merged commit a85f71f into main Oct 26, 2026
5 of 6 checks passed
@thePunderWoman
thePunderWoman deleted the icm42670-imu branch October 26, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant