ST LIS3MDL Triaxial Magnetic Sensor: a lot of data, for such a small VFLGA package

For some project to be discussed later, a magnetic sensor will be an essential ingredient. Time for some preliminary tests, using ST Microelectronics LIS3MDL sensor.

lis3mdl package

Just 2x2x1 mm, and 12 contacts! Not an easy tasks, but as you can see, wires can be soldered to all these contacts. Will be covering this with a bit of expoxy glue soon.

lis3mdl closeup

The “schematic”, it is rather simple. All is connected to a small ATmega32L board, running at 16 MHz, and handling the USB interface used to get the data out.

lis3mdl schematic

The board, mounted to a box, showing the XYZ coordinates.

lis3mdl box

After some configuration and programming, believe it or not, there is actually a signal on the DRDY (data ready) line – this is set high, whenever data is available. The AVR uses the configuration register to query data acquisition status. But DRDY could be used as well. For best noise performance, the LIS3MDL is run at its fastest and most precise setting, getting 1 sample every 6.5 ms – about 155 Hz data rate. Date is then decimated to 1 point per second, transferred to a PC via USB, and further decimated to 1 point per minute.

lis3mdl drdy signal 155 hz 2 ms xdiv

Some calculations later – the total field (data points: one per minute, ticks show 6 hour intervals):

lis3mdl total field 1 point per minute

Inclination – New York (actual, correct data: -13 deg Declination, 67 deg Inclination, total field: 52 Microtesla, about 0.52 Gauss).

lis3mdl inclination

Declination (absolute value – acutual declination would be negative).

lis3mdl declination

… well, not quite accurate yet, but close enough! Some variations seem to be due to temperature, others, not so sure, living next to a train line here, and a lot of magnets around, including, strong magnets. And the cardboard box, it is not really square and rectangular, nor is the alignment perfect.

For those interested, the AVR code snippet used to get the data from the mm-size “brick”: lis3mdl_avr

2 thoughts on “ST LIS3MDL Triaxial Magnetic Sensor: a lot of data, for such a small VFLGA package”

  1. 16bit resolution looked promising, so I quickly looked at the datasheet. 16bit at +/-4 Gauss, with a 3 mGauss resolution isn’t much better than the 12bit at +/- 0.88 Gauss and a 1.5 mGauss resolution of the HMC5583 I use in a project. This chip also already has averaging functions on board.

    1. Hi, You are absolutely right, the 12 vs. 16 bit will not make a significant different, the noise levels of the two devices are very similar (although in my tests so far both devices seem to pick up more noise from the surroundings, then they produce themselves…). The fact that triggered the investigating of the LIS3MDL is the cost, because this device is less than half price vs the HMS5883L, almost US$ 1 savings on the BOM. The LIS3MDL also appears to have better temperature stability, where the HMS5883L required regular re-calibration using the build-in coils (which leads to sensor dead time). I think I need to set up better shielding and record the field with a fluxgate while doing more tests (objective is to get somewhat comprehensive data on the thermal performance – zero drift, scale drift and hysteresis, if any).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.