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.
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.
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.
The board, mounted to a box, showing the XYZ coordinates.
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.
Some calculations later – the total field (data points: one per minute, ticks show 6 hour intervals):
Inclination – New York (actual, correct data: -13 deg Declination, 67 deg Inclination, total field: 52 Microtesla, about 0.52 Gauss).
Declination (absolute value – acutual declination would be negative).
… 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