A magnetometer measures magnetic field strength, typically of the Earth’s magnetic field, using the Hall Effect. The data from this sensor can be combined with the BMI160 data to provide 9 degrees of freedom for a Sensor Fusion algorithm.

A few select boards, namely the CPro and MetaMotion boards, have the BMM150 geomagnetic sensor, represented by the MagnetometerBmm150 interface.

import com.mbientlab.metawear.module.MagnetometerBmm150;

final MagnetometerBmm150 magnetometer = board.getModule(MagnetometerBmm150.class);


Bosch provides 4 recommended configurations for the BMM150 chip that control the data rate, current, and noise. Preset configurations are set by calling usePreset

Preset ODR Average Current Noise
LOW_POWER 10Hz 170µA 1.0µT (xy axis), 1.4µT (z axis)
REGULAR 10Hz 0.5mA 0.6µT
HIGH_ACCURACY 20Hz 4.9mA 0.3µT
import com.mbientlab.metawear.module.MagnetometerBmm150.Preset;

// use the regular preset configuration

Advanced users can manually configure the device using the BMM150’s ConfigEditor though it is highly recommended that one of the preset modes be used.

Magnetic Field Data

The BMM150 measures magnetic field strength in Tesla (T) and its data is represented by the MagneticField class.

magnetometer.magneticField().addRouteAsync(new RouteBuilder() {
    public void configure(RouteComponent source) { Subscriber() {
            public void apply(Data data, Object ... env) {
                Log.i("MainActivity", data.value(MagneticField.class).toString());
}).continueWith(new Continuation<Route, Void>() {
    public Void then(Task<Route> task) throws Exception {
        return null;