

The Matek Optical Flow & LIDAR Sensor is a versatile and compact module that combines optical flow technology with LIDAR-based distance measurement. This dual-functionality sensor is designed to provide precise motion tracking and accurate distance measurements, making it an ideal choice for applications in drones, robotics, and autonomous navigation systems. By integrating optical flow for horizontal motion detection and LIDAR for vertical distance sensing, this sensor ensures reliable performance in dynamic environments.








The following table outlines the key technical specifications of the Matek Optical Flow & LIDAR Sensor:
| Parameter | Specification |
|---|---|
| Manufacturer Part ID | Optical Flow & LIDAR Sensor |
| Operating Voltage | 4.5V to 5.5V |
| Current Consumption | 100mA (typical) |
| Communication Interface | I2C, UART |
| Optical Flow Resolution | 30 x 30 pixels |
| LIDAR Measurement Range | 0.1m to 4m |
| LIDAR Accuracy | ±2% |
| Operating Temperature Range | -10°C to 60°C |
| Dimensions | 25mm x 25mm x 10mm |
| Weight | 5g |
The Matek Optical Flow & LIDAR Sensor features a 6-pin connector. The pinout is described in the table below:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (4.5V to 5.5V) |
| 2 | GND | Ground connection |
| 3 | SDA | I2C data line |
| 4 | SCL | I2C clock line |
| 5 | TX | UART transmit line |
| 6 | RX | UART receive line |
#include <Wire.h>
// I2C address of the Matek Optical Flow & LIDAR Sensor
#define SENSOR_I2C_ADDRESS 0x42
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Initialize serial communication for debugging
// Send initialization command to the sensor
Wire.beginTransmission(SENSOR_I2C_ADDRESS);
Wire.write(0x00); // Example command to initialize the sensor
Wire.endTransmission();
Serial.println("Sensor initialized.");
}
void loop() {
Wire.beginTransmission(SENSOR_I2C_ADDRESS);
Wire.write(0x01); // Example command to request data
Wire.endTransmission();
Wire.requestFrom(SENSOR_I2C_ADDRESS, 4); // Request 4 bytes of data
if (Wire.available() == 4) {
int16_t flowX = Wire.read() << 8 | Wire.read(); // Optical flow X-axis
int16_t flowY = Wire.read() << 8 | Wire.read(); // Optical flow Y-axis
Serial.print("Flow X: ");
Serial.print(flowX);
Serial.print(", Flow Y: ");
Serial.println(flowY);
}
delay(100); // Delay for stability
}
Sensor Not Responding
Inaccurate Distance Measurements
Optical Flow Data is Unstable
I2C Communication Fails
Q: Can the sensor be used outdoors?
A: Yes, but avoid direct sunlight and reflective surfaces, as they can interfere with the sensor's performance.
Q: What is the maximum range of the LIDAR sensor?
A: The LIDAR sensor has a maximum range of 4 meters with an accuracy of ±2%.
Q: Can I use both I2C and UART simultaneously?
A: No, you must choose one communication protocol at a time.
Q: Is the sensor compatible with 3.3V microcontrollers?
A: The sensor requires a 5V power supply, but its I2C and UART lines are 3.3V logic compatible.