QMC5883L Magnetometer

The qmc5883l allows you to use your QMC5883L triple-axis magnetometers (datasheet) with ESPHome. This sensor is very simular to the HMC5883L sensor and is oftern found as a knock off replacement. The QMC5883L sensor performs on par to the HMC5883L sensor, though the configuration differs. The I²C Bus is required to be set up in your configuration for this sensor to work.

../../_images/qmc5883l.jpg

QMC5883L Magnetometer.

# Example configuration entry
sensor:
  - platform: qmc5883l
    address: 0x0D
    field_strength_x:
      name: "QMC5883L Field Strength X"
    field_strength_y:
      name: "QMC5883L Field Strength Y"
    field_strength_z:
      name: "QMC5883L Field Strength Z"
    heading:
      name: "QMC5883L Heading"
    temperature:
      name: "QMC5883L Temperature"
      filters:
        - offset: 34.0
    range: 200uT
    oversampling: 512x
    update_interval: 60s

Configuration variables:

  • address (Optional, int): Manually specify the I²c address of the sensor. Defaults to 0x0D.

  • field_strength_x (Optional): The field strength in microtesla along the X-Axis. All options from Sensor.

  • field_strength_y (Optional): The field strength in microtesla along the Y-Axis. All options from Sensor.

  • field_strength_z (Optional): The field strength in microtesla along the Z-Axis. All options from Sensor.

  • heading (Optional): The heading of the sensor in degrees. All options from Sensor.

  • temperature (Optional): The temperature of the sensor. Per the datasheet: “Temperature sensor gain is factory-calibrated, but its offset has not been compensated, only relative temperature value is accurate”. Above example has an offset that you need to calibrate. All options from Sensor.

  • range (Optional): The range parameter for the sensor.

  • oversampling (Optional): The oversampling parameter for the sensor.

  • update_interval (Optional, Time): The interval to check the sensor. Defaults to 60s.

  • id (Optional, ID): Manually specify the ID used for code generation.

Range Options

By default, the QMC5883L sensor measurement range is 200µT. You can, however, configure this amount. Possible values:

  • 200µT (default)

  • 800µT

Oversampling Options

By default, the QMC5883L sensor measures each value 512 times when requesting a new value. You can, however, configure this amount. The result is the sensor will take the adverage of the x samples. Possible sampling values:

  • 512x (default)

  • 256x

  • 128x

  • 64x

See Also