Go Down

Topic: Magnetormeter Adafruit MLX90393 setting up sampling rate (Read 59 times) previous topic - next topic

tomi12345

Hello,

soon I'm going to get Adafruit magnetometer mentioned in the title and I want to set up sampling rate.
I've downloaded MLX90393 library and opened the demo.

In the datasheet - (https://learn.adafruit.com/mlx90393-wide-range-3-axis-magnetometer) - it says on page 28 I can set up sampling rate 171.5Hz (Based on OSR=2, DIG_FILT=2, HALLCONF=2x2).
I dont understand where should I put these parameters in the coding.

Also I want to use a high-pass filter using a 2nd order Butterworth filter (cut-off frequency: 1.5 Hz) but that means putting 3 filters on each axes and due to magnetometer there are no 3 pins coming from magnetometer (axes) and connecting to Arduino. I'm looking at this toturial - (https://learn.adafruit.com/mlx90393-wide-range-3-axis-magnetometer/arduino) - the only pins coming out of magnetometer to Arduino are SCL and SDA. So 1.5Hz cut off is probably not doable.

jremington

Quote
I dont understand where should I put these parameters in the coding.
You need to go through the library documentation and/or code, to find a function that sets those parameters. Adafruit's documentation is often pretty good. If there isn't one, you need to use the Wire (I2C) library to write the desired values directly to the device registers.

If you wish to apply a custom filter to the data, that can be done only on the Arduino, after the data have been read. There are on line calculators to give you coefficients or C code for just about any type of filter.

tomi12345

You need to go through the library documentation and/or code, to find a function that sets those parameters.
Found it, thanks.

Go Up