The MLX90393, manufactured by Melexis, is a highly versatile 3D magnetic sensor capable of measuring magnetic fields in three dimensions (X, Y, Z). It is designed for applications requiring precise position sensing, navigation, and robotics. With its high accuracy, low power consumption, and I²C/SPI communication interface, the MLX90393 is ideal for use in portable devices, industrial automation, and automotive systems.
Parameter | Value |
---|---|
Supply Voltage (VDD) | 2.2V to 3.6V |
Operating Current | 5 µA (low-power mode), 1.8 mA (active) |
Magnetic Field Range | ±50 mT to ±200 mT (configurable) |
Communication Interface | I²C or SPI |
Resolution | 16-bit |
Operating Temperature | -40°C to +85°C |
Package | 3x3 mm QFN-16 |
Pin Number | Pin Name | Description |
---|---|---|
1 | VDD | Power supply (2.2V to 3.6V) |
2 | GND | Ground |
3 | SCL/SPC | I²C clock line / SPI clock |
4 | SDA/SDI | I²C data line / SPI data input |
5 | SDO | SPI data output (leave unconnected for I²C) |
6 | CS | Chip select for SPI (tie to VDD for I²C) |
7-16 | NC | Not connected (leave floating) |
0x0C
. Ensure no address conflicts if multiple devices are on the same bus.#include <Wire.h>
// MLX90393 I²C address
#define MLX90393_ADDR 0x0C
void setup() {
Wire.begin(); // Initialize I²C communication
Serial.begin(9600); // Initialize serial communication for debugging
// Send a reset command to the MLX90393
Wire.beginTransmission(MLX90393_ADDR);
Wire.write(0x80); // Command to reset the sensor
Wire.endTransmission();
delay(10); // Wait for the sensor to reset
Serial.println("MLX90393 initialized.");
}
void loop() {
// Request magnetic field data from the sensor
Wire.beginTransmission(MLX90393_ADDR);
Wire.write(0x3E); // Command to read measurement data
Wire.endTransmission();
// Read the response (6 bytes: X, Y, Z data)
Wire.requestFrom(MLX90393_ADDR, 6);
if (Wire.available() == 6) {
int16_t x = (Wire.read() << 8) | Wire.read(); // Combine MSB and LSB for X
int16_t y = (Wire.read() << 8) | Wire.read(); // Combine MSB and LSB for Y
int16_t z = (Wire.read() << 8) | Wire.read(); // Combine MSB and LSB for Z
// Print the magnetic field data
Serial.print("X: "); Serial.print(x);
Serial.print(" Y: "); Serial.print(y);
Serial.print(" Z: "); Serial.println(z);
}
delay(500); // Wait before the next reading
}
No Response from the Sensor:
0x0C
) is used.Incorrect Magnetic Field Readings:
Communication Errors:
Can the MLX90393 measure static magnetic fields? Yes, the sensor can measure both static and dynamic magnetic fields.
What is the maximum distance for accurate magnetic field sensing? The effective sensing range depends on the strength of the magnetic source and the sensor's configuration. For weak fields, the sensor should be placed closer to the source.
Can I use multiple MLX90393 sensors on the same I²C bus? Yes, but each sensor must have a unique I²C address. This can be configured using the ADDR pin or software commands.
Is the MLX90393 suitable for outdoor use? The sensor operates within a temperature range of -40°C to +85°C, making it suitable for many outdoor applications. However, additional protection may be required against moisture and dust.