Circuit review & bench-test guide
AXS-019 — LIS3MDL 3-axis magnetometer PMOD module
Document purpose#
This document explains the axs-019-lis3mdl prototype at component level and turns the design evidence into a practical manual-review and bench-test plan. It is based on the generated schematic (generate_design.py, rev 0.1-schematic), the module README, and the manufacturer documents cited in Section 6.
The board is schematic-only: ERC is clean, but no PCB has been laid out and no board has been fabricated or assembled. There is no bench result of any kind. Every numeric value in this guide is a verification target taken from the design files or the manufacturer datasheets, not a measured result.
1. What the board does#
The board puts an STMicroelectronics LIS3MDL 3-axis magnetometer on the AruviX I2C PMOD template. A 3.3 V PMOD host talks I2C (address 0x1C by default, 0x1E via solder jumper JP3) to read X/Y/Z magnetic field at ±4/8/12/ 16 gauss full scale, for compass-heading and hard/soft-iron-calibration lessons. The sensor's INT and DRDY outputs are wired to the two spare PMOD top-row pins through 100 Ω series resistors. The I2C bus is repeated on PMOD pins 9/10 so modules can be daisy-chained; the on-module 4.7 kΩ pull-ups sit behind solder jumpers JP1/JP2 so exactly one module in a chain provides them.
SPI is not reachable: the LIS3MDL ~CS pin is hard-wired to 3V3, which per the datasheet selects and locks I2C mode.
Functional block diagram#
PMOD host (3.3 V)
│
v
J1 PMOD plug (2x06)
1 MAG_INT <── R3 100R ── LIS_INT ──┐
2 MAG_DRDY <── R4 100R ── LIS_DRDY ──┤
3/9 SCL <──── JP2 ─── R2 4.7k ── 3V3 (SCL pull-up)
4/10 SDA <──── JP1 ─── R1 4.7k ── 3V3 (SDA pull-up)
5/11 GND, 6/12 3V3 │
│ │
v │
U1 LIS3MDL (LGA-12) ────────────────┘
Vdd, Vdd_IO = 3V3 (C2 100n, C3 1u)
~CS = 3V3 (I2C mode locked)
SDO/SA1 = ADDR ── JP3: 1-2 GND = 0x1C (default), 2-3 3V3 = 0x1E
C1 pin ── C1 100n ── GND (internal regulator cap, NOT decoupling)
2. Safety and scope boundaries#
- 3.3 V logic only. Power from a PMOD host or a current-limited bench supply set to 3.3 V; a 50 mA current limit is far above the sensor's worst-case draw and still protects a miswired prototype.
- Absolute maximums (datasheet Table 8): Vdd and Vdd_IO −0.3 to +4.8 V; any control pin −0.3 to Vdd_IO + 0.3 V. Never drive SDA/SCL/INT/DRDY from a 5 V host.
- The part is magnetically fragile in a way most parts are not: a magnetic disturbance field above 50 gauss starts to degrade the zero-gauss offset and the maximum exposed field is 1000 gauss. Keep strong magnets (and magnetized tools/tweezers) away except for the deliberate, brief proximity test in Section 9.F.
- Compass accuracy is corrupted by nearby current loops: ST recommends keeping traces carrying more than 10 mA a few millimeters away from the sensor. Route bench wiring accordingly and keep the module away from the supply leads during field tests.
- This guide validates a prototype schematic. Passing it is not EMC, safety, or environmental qualification, and no PCB-dependent behavior (layout coupling, thermal, soldering) can be checked before layout exists.
3. Power and control sequence#
- 3V3 is applied on J1 pin 6/12. C3 (1 µF bulk) and C2 (100 nF) charge; the LIS3MDL internal regulator starts against C1 (100 nF on the C1 pin).
- Per AN4602 Section 3.1, after power-on reset the device loads factory trim from internal flash, performs one measurement, and enters idle (power-down) in about 3.2 ms. DRDY is low during startup.
- Default register state: CTRL_REG1 = 0x10, CTRL_REG3 = 0x03 (power-down). Idle current is about 1 µA, so the module at rest should draw only microamps plus pull-up leakage.
- The host configures full scale (CTRL_REG2, 0x21), operating mode/ODR (CTRL_REG1, 0x20; CTRL_REG4, 0x23 for Z), and conversion mode (CTRL_REG3, 0x22). Turn-on time from wakeup command to data (AN4602 Table 8): 1.2 ms (LP) to 6.65 ms (UHP).
- Each conversion sets ZYXDA in STATUS_REG (0x27) and raises DRDY (PMOD pin 2 via R4). Reading the output registers clears DRDY. The programmable threshold interrupt appears on INT (PMOD pin 1 via R3) when enabled via INT_CFG (0x30).
There is no power switch, regulator, or level shifter on the module; the PMOD 3V3 rail powers U1 directly, and #FLG01/#FLG02 in the schematic are ERC-only power-flag artifacts with no physical part.
4. Interfaces#
PMOD pin map (Type 6 extended, J1 = 2x06 right-angle header)#
| PMOD pin | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Net | MAG_INT | MAG_DRDY | SCL | SDA | GND | 3V3 | NC | NC | SCL | SDA | GND | 3V3 |
Pins 9/10 repeat the bus for daisy-chaining; 11/12 repeat GND/3V3.
Jumpers#
| Ref. | Type | Default | Meaning |
|---|---|---|---|
| JP1 | 2-pad solder jumper, bridged | bridged | Connects R1 (4.7 kΩ) pull-up to SDA. Cut when another chained module provides the pull-ups |
| JP2 | 2-pad solder jumper, bridged | bridged | Connects R2 (4.7 kΩ) pull-up to SCL. Cut with JP1 |
| JP3 | 3-pad solder jumper, 1-2 bridged | 1-2 | SDO/SA1 address strap. 1-2 = GND = I2C address 0x1C; 2-3 = 3V3 = 0x1E |
Test points#
None are defined in the schematic. Probe at the J1 pins and, after layout, at component pads. Adding TPs for SDA, SCL, 3V3, and DRDY is a reasonable layout-stage improvement.
5. Component-by-component review#
Every reference designator in generate_design.py is covered.
| Ref. | Part / value | Function and why needed | If absent/open | If shorted, wrong, or misassembled |
|---|---|---|---|---|
| J1 | 2x06 right-angle PMOD header | Host connection: power, I2C, INT/DRDY, chain | No module function | Reversed/offset insertion can put 3V3 on signal pins; inspect before power |
| U1 | ST LIS3MDLTR, LGA-12 2x2 mm | The magnetometer itself | Nothing to test | Wrong orientation on LGA is hard to see and breaks everything; a solder bridge on the 0.5 mm-pitch pads can short the bus or the rail |
| C1 | 100 nF 16 V X7R (Murata GRM188R71C104KA01D) | Internal-regulator capacitor on the C1 pin (pin 4), required by datasheet Section 4.1 — not decoupling | Internal regulator may be unstable: erratic readings, resets, or no function | Short on C1 pin kills the internal rail; a wrong (much larger/smaller) value violates the datasheet requirement of C1 = 100 nF |
| C2 | 100 nF 16 V X7R | Vdd/Vdd_IO high-frequency decoupling (datasheet C3 role) | Supply bounce during conversions; noisier readings, possible I2C errors | Short is a 3V3-GND short: supply current-limits, module dead |
| C3 | 1 µF 10 V X7R (GRM188R71A105KA61D) | Module bulk decoupling (datasheet C2 role, 1 µF low-frequency) | Larger supply droop on attach and mode changes | Short is a 3V3-GND short |
| R1 | 4.7 kΩ (Yageo RC0603FR-074K7L) | SDA pull-up (behind JP1) | With JP1 cut or R1 open and no other pull-up on the chain, SDA floats: no I2C at all | Too-low value overloads open-drain drivers; short to 3V3 makes SDA stuck high (writes fail, reads impossible) |
| R2 | 4.7 kΩ | SCL pull-up (behind JP2) | Same as R1 but on SCL: clock never rises, bus dead | Same as R1 |
| R3 | 100 Ω | Series protection on sensor-driven INT to PMOD 1 | INT never reaches host (interrupt lessons fail); sensor still works polled | Wrong high value plus pin capacitance slows edges; short removes protection only |
| R4 | 100 Ω | Series protection on sensor-driven DRDY to PMOD 2 | DRDY handshake lessons fail; polling STATUS_REG still works | Same as R3 |
| JP1 | Solder jumper, bridged | SDA pull-up disconnect for chaining | Open (cut) on a single-module bench = floating SDA | Re-bridged with a blob while another module also pulls up: parallel pull-ups, stronger than intended (2.35 kΩ for two) — usually still legal but verify |
| JP2 | Solder jumper, bridged | SCL pull-up disconnect | As JP1, on SCL | As JP1 |
| JP3 | 3-pad solder jumper, 1-2 bridged | SDO/SA1 address strap (0x1C/0x1E) | SA1 floating: address undefined/unstable — scan may show intermittent 0x1C/0x1E | Bridging 1-2-3 together shorts 3V3 to GND through the jumper: rail short |
| #FLG01, #FLG02 | Power flags (3V3, GND) | ERC-only artifacts so KiCad sees driven power nets | No physical effect | No physical part exists; nothing to assemble |
Key U1 datasheet parameters (LIS3MDL, DocID024204 Rev 4)#
| Parameter | Value |
|---|---|
| Vdd | 1.9–3.6 V (3.3 V here is in range) |
| Vdd_IO | 1.71 V to Vdd + 0.1 V (tied to 3V3 here) |
| Idd, UHP mode @ 20 Hz | 270 µA typ |
| Idd, LP mode @ 20 Hz | 40 µA typ |
| Idd, power-down/idle | ~1 µA typ |
| Full scales / sensitivity | ±4/8/12/16 gauss = 6842/3421/2281/1711 LSB/gauss |
| RMS noise (UHP, FS ±12) | 3.2/3.2/4.1 mgauss (X/Y/Z) |
| Self-test output change, FS ±12 gauss | X, Y: 1.0–3.0 gauss; Z: 0.1–1.0 gauss (absolute values) |
| WHO_AM_I (0x0F) | 0x3D (0b00111101) |
| I2C | standard + fast mode (100/400 kHz); SAD 00111x0b, x = SA1 |
| Turn-on time (AN4602) | LP 1.2 ms, MP 1.91 ms, HP 3.48 ms, UHP 6.65 ms |
| Abs max | Vdd/Vdd_IO 4.8 V; pins Vdd_IO + 0.3 V; exposed field 1000 gauss; offset degrades above 50 gauss |
6. Datasheet summary and design interpretation#
| Device | Key manufacturer facts used here | Board-specific interpretation |
|---|---|---|
| LIS3MDL | I2C/SPI 3-axis magnetometer; requires external 100 nF on the C1 pin and 100 nF + 1 µF supply capacitors; SDO/SA1 must be tied to Vdd_IO or GND in I2C mode; ~CS high = I2C | The board follows the datasheet's Figure 5 connection scheme exactly: C1 = C1 pin cap, C2/C3 = supply caps, JP3 defines SA1, ~CS hard high. SPI lessons are deliberately impossible |
| AN4602 (app note) | Startup ~3.2 ms; wakeup sequence; DRDY/STATUS_REG read flows; self-test procedure with limits at FS ±12 gauss; offset registers 0x05–0x0A for hard-iron | Section 9's bring-up and self-test procedures are the AN4602 flows translated to this board's address and pins |
| Yageo RC series | General-purpose thick-film chip resistors | 4.7 kΩ pull-up value is a common 3.3 V/400 kHz choice; verify rise time after layout when chain length is known |
| Murata GRM caps | X7R 100 nF / 1 µF ceramics | Standard; C1's value (100 nF) is a datasheet requirement, not a free choice |
Official references: LIS3MDL datasheet (ST) (Pololu-hosted copy, DocID024204 Rev 4), AN4602 application note, DocID027014 (Pololu-hosted copy), Yageo RC thick-film resistors, LIS3MDL product page. Check the latest revision before procurement.
7. Expected values before bench testing#
All values are targets derived from the schematic and the datasheets above; none has been measured on hardware.
| Quantity | Target | How to check |
|---|---|---|
| 3V3-to-GND resistance, unpowered | no hard short; typically ≥100 kΩ once caps settle | DMM at J1 pin 6 vs 5 |
| SDA to 3V3 (JP1 bridged) | ≈ 4.7 kΩ (R1) | DMM at J1 pin 4 vs pin 6 |
| SCL to 3V3 (JP2 bridged) | ≈ 4.7 kΩ (R2) | DMM at J1 pin 3 vs pin 6 |
| SDA/SCL to 3V3, jumpers cut | open (>1 MΩ, only leakage) | Same, after cutting |
| ADDR node (JP3 1-2) | ≈ 0 Ω to GND | DMM at JP3 center pad |
| Bus idle levels, powered | SDA = SCL = 3.3 V | Scope/DMM on J1 pins 3/4 |
| Supply current, idle after boot | ~1 µA + margin (µA range) | µA meter in 3V3 lead |
| Supply current, UHP 20 Hz continuous | ~270 µA typ | Same |
| Address-ACK scan | ACK at 0x1C only (JP3 1-2); at 0x1E only if 2-3 | I2C scan |
| WHO_AM_I (0x0F) | 0x3D | First read transaction |
| Self-test delta, FS ±12 G | X/Y: 1.0–3.0 G (2281–6843 LSB); Z: 0.1–1.0 G (228–2281 LSB) | Section 9.E |
| Earth-field magnitude | ~0.25–0.65 gauss, location-dependent | Section 9.F |
| DRDY (PMOD 2) | toggles at ODR when converting | Scope |
8. Manual schematic and assembly review checklist#
- Confirm U1 orientation (pin-1 dot) against the LGA-12 footprint; the package is 2 × 2 mm and unforgiving.
- Verify ~CS is tied to 3V3 (nets
u1/cs), not left floating: floating ~CS can drop into SPI mode and hang the bus. - Verify C1 is on the C1 pin (pin 4) net
C1_REG, and C2/C3 are on 3V3. Swapping C1 and C2 nets is the classic error on this part. - Confirm JP3 default bridge is 1-2 (SA1 to GND, address 0x1C) and matches the README/host software.
- Confirm JP1/JP2 are bridged for a single-module bench.
- Check R3/R4 orient sensor → host only (they carry sensor-driven signals to PMOD pins 1/2; PMOD host must configure those pins as inputs).
- Check PMOD pin numbering against the Digilent spec: top row 1–6, bottom row 7–12, with the zigzag mapping the library applies to the 2x06 header.
- Confirm no part is fitted for #FLG01/#FLG02 (schematic artifacts only).
- After layout (future): sensor away from the header current loop, >10 mA traces a few millimeters from U1, C1/C2 close to U1.
9. Ordered bench-test procedure#
Stop at the first abnormal result. Record everything against board serial, equipment, and date (Section 11). PMOD host at 3.3 V or a current-limited 3.3 V bench supply wired to J1 pins 6/12 (3V3) and 5/11 (GND).
A. Unpowered inspection and resistance tests#
- Complete the Section 8 checklist under magnification.
- Measure 3V3-to-GND in both polarities; investigate any hard short.
- Pull-up jumper verification (fitted default): measure SDA (J1 pin 4) to 3V3 (pin 6): expect ≈4.7 kΩ. Measure SCL (pin 3) to 3V3: ≈4.7 kΩ.
- If this module will join a chain that already has pull-ups, cut JP1/JP2 and re-measure: both readings must go open (only leakage). Re-verify the remaining chain still shows one 4.7 kΩ pull-up per line.
- Verify JP3 center (ADDR) reads ≈0 Ω to GND (default) or ≈0 Ω to 3V3 if deliberately restrapped — never both.
B. First power, idle current, bus idle levels#
- Apply 3.3 V with a 50 mA limit. Expect a brief charging blip, then microamp-range idle current (device boots to power-down in ~3.2 ms).
- Probe SDA and SCL: both must sit at 3.3 V through the pull-ups with the bus idle. A line stuck low means a solder bridge, damaged U1, or a host pin driving low.
- Probe MAG_INT and MAG_DRDY: defined CMOS levels, DRDY low after startup.
C. Address-ACK scan#
- Run an I2C scan at 100 kHz. Expect an ACK at exactly 0x1C (7-bit) with JP3 in 1-2, and nothing else from this module.
- If JP3 is restrapped 2-3, rescan: ACK at 0x1E only.
- Ghost ACKs at both addresses suggest a floating SA1 (bad JP3 joint).
D. First transaction: WHO_AM_I#
- Write: START, 0x38 (SAD+W for 0x1C), SUB 0x0F; repeated START, 0x39 (SAD+R), read 1 byte, NACK, STOP.
- Expected response byte: 0x3D. (With JP3 2-3 the bytes are 0x3C/0x3D for SAD+W/R.)
- Read CTRL_REG1 (0x20) and CTRL_REG3 (0x22): expect the reset defaults 0x10 and 0x03.
E. Built-in self-test (AN4602 Section 5, Figure 6)#
Keep the module still and away from magnets for the whole test.
- Initialize: write 0x1C → CTRL_REG1 (0x20) (ODR 80 Hz), 0x40 → CTRL_REG2 (0x21) (FS ±12 gauss), 0x00 → CTRL_REG3 (0x22) (continuous). Wait 20 ms.
- Wait for ZYXDA in STATUS_REG (0x27), read OUT_X/Y/Z (0x28–0x2D, multi-byte read with SUB MSB set: SUB = 0xA8) and discard the first sample. Then collect 5 samples and average per axis → OUT_NOST.
- Enable self-test: write 0x1D → CTRL_REG1 (ST bit set). Wait 60 ms.
- Again discard the first sample, average 5 samples → OUT_ST.
- Pass bands (datasheet Table 3 / AN4602 Table 17, FS ±12 G, absolute values, sensitivity 2281 LSB/gauss):
- X: 1.0 G ≤ |ST−NOST| ≤ 3.0 G (2281–6843 LSB)
- Y: 1.0 G ≤ |ST−NOST| ≤ 3.0 G (2281–6843 LSB)
- Z: 0.1 G ≤ |ST−NOST| ≤ 1.0 G (228–2281 LSB)
- Disable: write 0x1C → CTRL_REG1, then 0x03 → CTRL_REG3 (power-down).
F. Field sanity checks#
- Configure FS ±4 G, UHP, 20 Hz continuous (AN4602 wakeup: 0x40 → 0x21 for FS ±12 is the app-note default; for this check use FS ±4, CTRL_REG2 = 0x00). Compute magnitude sqrt(X²+Y²+Z²) scaled by 6842 LSB/gauss.
- With the module still and away from steel/magnets, expect a stable magnitude of roughly 0.25–0.65 gauss (Earth's field; value depends on location). A magnitude near zero or near full scale indicates a stuck axis, wrong scaling, or magnetized surroundings.
- Rotate the module slowly through 360°: X/Y should trace approximately a circle (before calibration, an offset circle); heading atan2(Y, X) should sweep monotonically.
- Bring a small magnet within a few centimeters briefly: readings must respond strongly and, close in, MROI (INT_SRC overflow bit) may set. Remove it and confirm readings return to the Earth-field baseline (an offset shift after this test means the 50 gauss disturbance limit was exceeded — keep the magnet farther away).
G. DRDY and interrupt path#
- In continuous mode, scope MAG_DRDY (PMOD 2): expect toggling at the ODR; confirm it clears when the output registers are read.
- Program INT_THS (0x32/0x33) below the ambient field, enable XIEN/IEN in INT_CFG (0x30), and confirm MAG_INT (PMOD 1) asserts and INT_SRC (0x31) reports the axis; with LIR latched, confirm reading INT_SRC releases it.
10. Troubleshooting map#
| Symptom | First measurements | Likely areas |
|---|---|---|
| SDA or SCL not at 3.3 V idle | resistance line-to-3V3 and line-to-GND | JP1/JP2 cut, R1/R2 open, solder bridge, U1 damaged |
| No ACK at any address | bus levels, JP3 continuity, U1 supply pins | U1 not powered/soldered, ~CS floating, wrong footprint orientation |
| ACK at 0x1E instead of 0x1C | JP3 strap | JP3 bridged 2-3 or pad 1 joint open |
| Intermittent ACK 0x1C/0x1E | ADDR node voltage | SA1 floating (JP3 open) |
| WHO_AM_I wrong value | repeat at 100 kHz; check SUB byte | Read protocol error (missing repeated START), counterfeit/wrong part |
| Self-test delta out of band | ambient field stability, FS setting | Test run near magnets/steel, wrong FS (must be ±12 G), damaged sensor |
| Earth-field magnitude far off | per-axis raw values | Stuck axis (solder), wrong sensitivity constant, magnetized bench |
| DRDY never toggles | STATUS_REG polling | Power-down mode still set (CTRL_REG3), R4 open |
| INT never asserts | INT_SRC, INT_CFG readback | IEN not set, threshold too high, R3 open, IEA polarity |
| Supply current mA-range at idle | thermal check, resistance | Solder bridge, C1/C2/C3 short, damaged U1 |
11. Bench record template#
| Field | Record |
|---|---|
| Board revision / serial | |
| JP1/JP2 state and measured pull-up resistance | |
| JP3 strap and address-scan result | |
| Equipment (host/adapter, DMM, scope) and calibration | |
| Idle bus levels (SDA/SCL) | |
| Idle / active supply current | |
| WHO_AM_I result | |
| Self-test averages (NOST, ST) and deltas per axis | |
| Earth-field magnitude and rotation-test note | |
| Magnet response / recovery | |
| DRDY / INT observations | |
| Deviations, raw-file paths | |
| Reviewer / date / disposition |
12. Review conclusion#
The schematic follows the LIS3MDL datasheet connection scheme closely: the internal-regulator capacitor is present on the C1 pin, both supplies are decoupled, ~CS locks I2C mode, and SA1 is strapped by JP3 rather than left floating. The chaining scheme (bus repeated on pins 9/10, pull-ups behind JP1/JP2) is coherent, provided exactly one module per chain keeps its jumpers bridged. The principal open risks are the unbuilt PCB (layout must keep current loops away from the sensor and get the LGA-12 footprint right), the unverified interaction of 100 Ω series resistors with the host's input thresholds, and the fact that every number above — including the self-test pass bands and Earth-field expectation — is a datasheet target that no physical board has yet met.