WIZM-3DMAG

3DMAG

WIZM-3DMAG is a 3D Hall Magnetometer sensor module powered by the TMAG5273A2 IC (Rev 1.0). Utilizing an I2C digital interface at default address 0x35 with dedicated 3.3V, GND, SDA, SCL, and INT pins, it features dual breakout connection options (5-pin 2.54mm through-holes and a 5-pin horizontal keyed connector) for magnetic position sensing, rotary/linear tracking, and embedded prototypes.

ADK-Buy Buy now

The WIZM-3DMAG (Rev 1.0) is an integrated magnetic sensing module featuring the TMAG5273A2 linear 3D Hall-effect magnetometer IC. It measures 3-axis magnetic flux density (X, Y, and Z axes marked on the silkscreen) and communicates over a 2-wire I2C interface (SDA and SCL) at default address 0x35, alongside an INT interrupt/trigger line. Dual 5-pin breakout options—a standard 2.54mm pitch through-hole header (P1) and a horizontal keyed connector (J1)—plus mounting holes make it well suited for breadboard prototyping, application kits, and robotics builds.


Features

  • TMAG5273A2 Sensor IC: Linear 3D Hall-effect magnetometer measuring X, Y, and Z magnetic field axes with silkscreened X/Y axis reference markings.

  • I2C Communication: Standard 2-wire serial interface operating at fixed/default 7-bit I2C address 0x35 (labeled on the board).

  • Selectable Measurement Range: Supports ±133 mT (default) and ±266 mT full-scale ranges across X/Y and Z axes.

  • Integrated Signal Processing: Includes 12-bit ADC conversion, configurable averaging, temperature sensing, on-chip CORDIC angle calculation, and an INT pin.

  • Dual Connection Options: Features a 5-pin 2.54mm pitch through-hole header (P1) alongside a 5-pin horizontal keyed connector (J1).

  • Mounting Holes: Four corner mounting holes plus a center pass-through hole for mechanical mounting.


Specifications

Parameter

Value

Model / P/N

WIZM-3DMAG

Function

3D Hall Magnetometer

IC

TMAG5273A2

Interface (I/F)

I2C (0x35)

Operating Voltage (3.3V)

3.3V DC (TMAG5273A2 rated 1.7V – 3.6V DC; I2C/INT pins up to 5.5V/7V max per datasheet)

Magnetic Field Range

±133 mT (default) / ±266 mT (configurable via SENSOR_CONFIG_2 0x03)

Connector Pitch

Standard 2.54mm (P1) / Keyed Horizontal (J1)

Pin Count

5 Pins (INT, SDA, SCL, GND, 3.3V)


Pinout & Hardware Overview

The module provides two parallel 5-pin interfaces: a 5-pin 2.54mm pitch through-hole breakout (P1) and a 5-pin horizontal keyed connector (J1).

Pin

Type

Description

INT

Input/Output

Interrupt / conversion trigger signal

SDA

Input/Output

I2C Serial Data Line

SCL

Input

I2C Serial Clock Line

GND

Power

Ground supply reference

3.3V

Power

3.3V DC Power Supply

Top View & Bottom View

topandbottom


Platforms Supported

MicroPython

Micropython Logo


Getting Started

Materials Required (excluding 3DMAG module)

  • W55MH32L-ADK

  • 5-pin female-female JST PH-Style Cable

  • USB Type-C Cable

Application Board

Hardware Connection

Connect the WIZM-3DMAG to the W55MH32L-ADK with the JST PH-Style Cable:

Hardware Connection

Then use a USB Type‑C cable to connect the WIZ‑LINK Port on the W55MH32L-ADK board to your PC.


Sample Code Demo

Software

We will be using Thonny IDE to run the code.

  1. Open Thonny IDE on your PC.

  2. Select the correct COM port for your board.

  3. Set the interpreter to MicroPython (generic).

Refer to the WIZnet documentation page for detailed instructions under the “Basic Setup” section.

MicroPython

import math
import time
from machine import I2C, Pin

ADDR = 0x35

# Key TMAG5273 registers
REG_DEVICE_CONFIG_1 = 0x00
REG_DEVICE_CONFIG_2 = 0x01
REG_SENSOR_CONFIG_1 = 0x02
REG_SENSOR_CONFIG_2 = 0x03
REG_X_MSB_RESULT = 0x12  # 0x12..0x17 = X, Y, Z MSB/LSB

# TMAG5273A2 default full-scale range (mT) when range bits are 0
RANGE_MT_XY = 133.0
RANGE_MT_Z = 133.0


def to_int16(msb: int, lsb: int) -> int:
    val = (msb << 8) | lsb
    return val - 65536 if val & 0x8000 else val


def write_reg(i2c: I2C, reg: int, value: int) -> None:
    i2c.writeto_mem(ADDR, reg, bytes([value & 0xFF]))


def read_regs(i2c: I2C, reg: int, length: int) -> bytes:
    return i2c.readfrom_mem(ADDR, reg, length)


def init_sensor(i2c: I2C) -> None:
    # Optional: 1x averaging, default I2C read mode
    write_reg(i2c, REG_DEVICE_CONFIG_1, 0x00)
    # Enable X, Y, Z channels: MAG_CH_EN = 0b0111 (bits [6:4]) -> 0x70
    write_reg(i2c, REG_SENSOR_CONFIG_1, 0x70)
    # Continuous measure mode: OPERATING_MODE = 0b10 (bits [1:0]) -> 0x02
    write_reg(i2c, REG_DEVICE_CONFIG_2, 0x02)
    time.sleep_ms(10)


def read_mag_mt(i2c: I2C) -> tuple[float, float, float]:
    buf = read_regs(i2c, REG_X_MSB_RESULT, 6)
    rx = to_int16(buf[0], buf[1])
    ry = to_int16(buf[2], buf[3])
    rz = to_int16(buf[4], buf[5])

    # 12-bit ADC output is left-aligned in the 16-bit result registers
    bx = (rx / 32768.0) * RANGE_MT_XY
    by = (ry / 32768.0) * RANGE_MT_XY
    bz = (rz / 32768.0) * RANGE_MT_Z
    return bx, by, bz


def main() -> None:
    # Adjust bus ID and SDA/SCL pins for your board
    i2c = I2C(1, scl=Pin("PB6"), sda=Pin("PB7"), freq=400_000)

    devices = i2c.scan()
    print("I2C scan:", [hex(d) for d in devices])
    if ADDR not in devices:
        raise RuntimeError(f"TMAG5273A2 not found at {hex(ADDR)}")

    init_sensor(i2c)
    print("Reading 3D magnetic field (mT)...")

    while True:
        bx, by, bz = read_mag_mt(i2c)
        mag = math.sqrt(bx * bx + by * by + bz * bz)
        print(f"X: {bx:+7.2f} mT | Y: {by:+7.2f} mT | Z: {bz:+7.2f} mT | |B|: {mag:6.2f} mT")
        time.sleep_ms(200)


if __name__ == "__main__":
    main()

Sensor Demo Note: A magnetic ring attached to a phone case is used for this demo. Any magnetic object can be used to observe changes in measurements.

Schematic

Download: WIZM-3DMAG Schematics