MLX90393引脚
时间: 2025-01-08 19:31:45 浏览: 7
### MLX90393 Sensor Pinout and Configuration
The MLX90393 is a three-axis magnetic sensor that provides high-resolution measurement of the ambient magnetic field. The specific pin configuration for this sensor includes several key pins necessary for operation with an ESP8266 or Arduino board.
#### Pin Description
| Pin Number | Name | Function |
|------------|---------|-----------------------------------------------|
| 1 | VDD | Supply voltage (typically 3.3V) |
| 2 | GND | Ground |
| 3 | SDA | Serial Data Line for I²C communication |
| 4 | SCL | Serial Clock Line for I²C communication |
For interfacing the MLX90393 with an ESP8266 NodeMCU, connections are made as follows:
- **VDD** connects to the 3.3V power supply on the NodeMCU.
- **GND** connects to any ground pin on the NodeMCU.
- **SDA** connects to GPIO 4 (D2) which serves as the data line for I²C communication[^1].
- **SCL** connects to GPIO 5 (D1), serving as the clock line for I²C communication.
Additionally, when using libraries such as those provided by Adafruit, ensure pull-up resistors are connected between both SDA and SCL lines and VCC since these sensors typically require them for stable I²C bus operations[^2].
```cpp
#include <Wire.h>
#include "Adafruit_MLX90393.h"
// Create instance of MLX90393 object
Adafruit_MLX90393 mlx = Adafruit_MLX90393();
```
This code snippet initializes the Wire library required for I²C communications and creates an instance of the `Adafruit_MLX90393` class used to interact with the sensor.
阅读全文