cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3MDLTR

adelmo
Associate
Posted on March 28, 2014 at 14:02

Hi,

I received a couple of LIS3 samples last week and I'm using them in order to gain a little experience in the field of magnetometers.

I managed to install the chip on top of a plastic pen in order to use it as a magnetic ''probe''. As i get near a magnet, I see a component of magnetic field rising to full scale. That's great but I noticed that the value remains in a sort of memory even if I reset o power cycle the device. Is this correct?

Configuration for ctrl_registers:

1-0x5c

2-0x40

3-0x00

4-0x08

5-0x00

Reading data is done by:

outXL=i2c_smbus_read_byte_data(fh,OUTXL);

usleep(50000);

outXH=i2c_smbus_read_byte_data(fh,OUTXH);

usleep(50000);

outX=(outXH<<8)|outXL;

Output:

47

Status ff

rX 0.7050

rY -12.0000

rZ -0.1743

48

Status ff

rX 0.6984

rY -12.0000

rZ -0.1761

As you can see, Y components remains ''high'' after getting close to a magnet, even if I put the sensor far from it.

Thank you in advance.

Best regards.
0 REPLIES 0