Glint

The IMU switcheroo

Everything Glint does comes off one motion sensor, and the one I built it on is end of life. The replacement is a quarter of the price and almost everything else about it is different: address, interrupt pin, axes, driver.

Two small sensor breakout boards held in fingers over a blue work mat, one dark blue and one magenta with its pin labels printed along the edge, both with header pins soldered on.

Everything Glint does comes off one part. Tilt it and fluid sloshes around inside. Lean it to steer through the tilt maze. Double tap it to change scenes. All of that is one motion sensor, an IMU, telling the tile which way is down and how hard it just got knocked.

I built the whole thing on an MPU-6050, which is the sensor on the little blue GY-521 board that turns up in every tutorial. It has worked the entire way through. It is also end of life at TDK, so what is actually for sale now is mostly clone modules, and when I priced the real chip onto my own board it came out at $12.43. That is the sensor costing more than the LED panel it is supposed to be reading motion for.

The replacement is an ST LSM6DS3TR-C, somewhere between $2.20 and $5.50 depending on how the assembly pricing lands. Six axes, same job, a decade younger.

What the swap costs

Past what they measure, almost everything about the two chips is different.

They sit at different I2C addresses, and you check which one you have by reading a different register. The interrupt I use to wake the tile comes out of a different pin on the new package, and the library I had been using can only reach the other one, so that wake is now a raw write to a register by number. The axes are not oriented the same way, so the gyro reading that spins the panel needs remapping. And it needs its own driver, so the firmware builds two ways now, one per board revision.

There is a version trap in it too. The plain LSM6DS3 and the TR-C are different parts with nearly the same silkscreen, and they answer that identity register differently. Fit the wrong one and you find out at bring-up, on a chip that cannot be desoldered and used again.

The new chip does tap detection in hardware

The MPU-6050 has no tap detection in it. That is an ADXL345 or LIS3DH sort of feature, and the MPU never had it. So Glint’s double tap has always been me watching the accelerometer and writing the rules for what counts as a tap, including a counter whose only job is to throw out the phantom ones.

The LSM6DS3TR-C does single and double tap in hardware. So the cheaper part does in hardware the one piece of Glint I have been approximating in software since the beginning.

The photo is the evening I soldered headers onto the candidates so I could sit one on a breadboard next to the old one. Eight joints, big pads, about the least interesting soldering there is.

The new one is a 14 pad LGA, which means the joints are underneath it where an iron cannot reach, and a desoldered one is scrap. Good argument for practising on boards I do not care about first.


all Glint updates