Custom I2C Magnetic Encoder Module

Published on March 23, 2026

This was a bit of a simple project, but the first step in making the next prototype for the LinkLite. Using a TMAG5273A1QDBVR IC from Texas Instruments, I designed and manufactured a very simple breakout PCB that was ordered from OSH Park.

The reason this is a significant step for LinkLite 2.0 is that by using this specific sensor, we can eliminate the need for a button on the next prototype for the pressing of the cap. This sensor can measure rotation using the Hall effect, but it also reports the raw magnetic flux value to its I2C registers that can be processed through a digital Schmitt trigger and detect if the magnetic has moved close enough to be a "press".

Read about the Hall Effect and the I2C Communication Protocol

I designed it using KiCAD, here's what the board looks like rendered in OnShape:

The CAD Render of the Magnetic Encoder PCB.

Again, the board is extremely simple, but this demonstration of the sensor will completely change how we physically design the rotation mechanism for the next version of the LinkLite. Using OnShape and my Bambu P1S, I designed and printed a simple encoder for the board that would allow a knob to spin freely, but also move vertically along tracks to detect that artificial button press.

Below is the 3D model and its exploded views. The small gray cylinder is a magnet thats press-fit into the dark blue part and there are 2 other printed parts in a lighter blue. They are connected to the board via M3 nuts and bolts.

The fully assembled CAD knob bracket for the PCB. The exploded view of the CAD knob bracket for the PCB.

The angle and the magnetic flux value are independent of one another, meaning if the magnet were pressed much closer to the sensor, it would not effect its angle readings while being able to detect that artificial "press".

Below are two Arduino IDE serial plots of this behavior where the orange curve is the magnetic flux value (the artificial press) can be seen going between two distinct values when the magnet is up or it is down. The other plot shows a sinusoidal in blue curve which is the reported angle going between 0 and 360 degrees.

A serial plot displaying the effect of moving the magnet along the Z-Axis. A serial plot displaying the effect of rotating the knob along the Z-Axis.

All in all, this project demonstrated some promising results and a strong first step in redesigning the LinkLite to be a much improved version of itself. I currently am designing a double-sided 4-layer PCB to replace all of the electronics of the first LinkLite and plan to incorporate this sensor after its successful results.