- All products
- Sensors & Modules
- Distance + Light
- Distance dToF Imager - TMF8821(SparkFun Qwiic)
- Distance + Light
Features
- Long-Range Distance Measurement: Measures distances from 10mm up to 5000mm with high accuracy.
- Direct Time-of-Flight Technology: Uses photon flight-time measurement for precise ranging.
- SPAD Sensor Array: Provides high sensitivity and reliable detection in different lighting conditions.
- Integrated 940nm VCSEL: Provides a safe Class 1 laser source for distance measurement.
- Multi-Zone Detection: Supports 3×3, 4×4, and 3×6 detection zone configurations.
- Adjustable Field of View: Supports up to 63° diagonal FoV using an integrated multi-lens array.
- Ambient Light Rejection: Maintains stable performance under bright sunlight and indoor lighting.
- On-Chip Processing: Performs histogram analysis and provides processed distance and confidence data.
- Qwiic I2C Interface: Enables quick plug-and-play connection without soldering.
- Low Power Operation: Suitable for portable and battery-powered applications.
- Multiple Interface Options: Supports both Qwiic connectors and standard breakout pins.
Principle of Work
The TMF8821 operates using direct Time-of-Flight (dToF) technology. The onboard VCSEL emits short pulses of infrared light toward the target object. When the light reflects back, the SPAD detector measures the arrival time of individual photons with extremely high precision.
The internal Time-to-Digital Converter (TDC) calculates the exact flight time of the photons. Since the speed of light is constant, the sensor determines the distance by calculating the time difference between transmission and reception.
The multi-zone SPAD array divides the measurement area into multiple regions, allowing the sensor to identify objects across different positions. The onboard processor performs histogram analysis, ambient light compensation, and confidence calculations before sending the final measurement data through the I2C interface.
Pinout

| Pin | Description | Direction |
|---|---|---|
| GND | Ground connection | Power |
| 3.3V | Power supply input | Power |
| SDA | I2C data line | Input/Output |
| SCL | I2C clock line | Input/Output |
| INT | Interrupt output, goes low when new data is available | Output |
| GP0/SYNC | General purpose I/O or synchronization signal | Input/Output |
| GP1 | General purpose I/O | Input/Output |
| EN | Enable input (active high) | Input |
Wiring Example
Arduino / ESP32 / Raspberry Pi Connection:
| TMF8821 | Controller |
|---|---|
| 3.3V | 3.3V Power |
| GND | GND |
| SDA | I2C SDA |
| SCL | I2C SCL |
| INT | Optional GPIO Interrupt |
Applications
- Camera Laser Detect Autofocus (LDAF) systems.
- Smart device presence detection.
- Robotic object detection and collision avoidance.
- Industrial safety light curtains.
- Human presence monitoring systems.
- Smart home automation devices.
- Interactive displays and gesture-based interfaces.
- Distance measurement and object tracking systems.
Technical Details
- Sensor: AMS TMF8821 Multi-Zone dToF Sensor
- Technology: Direct Time-of-Flight (dToF)
- Measurement Range: 10mm to 5000mm
- Detection Zones: 3×3, 4×4, 3×6
- Light Source: Class 1 940nm VCSEL
- Operating Voltage: 2.7V to 3.6V (3.3V recommended)
- Active Current: Approximately 57mA
- Standby Current: Approximately 8µA
- Maximum Read Rate: 30Hz
- Field of View: Up to 63° diagonal
- Communication Interface: I2C
- I2C Address: 0x41
- Operating Temperature: -30°C to +70°C
- Board Dimensions: 1.0 × 1.0 inch (25.4 × 25.4 mm)
Resources
- SparkFun Qwiic TMF882X Arduino Library
- SparkFun Qwiic dToF TMF8821 Product Page
- AMS TMF8821 Sensor Documentation
- SparkFun Qwiic Interface Documentation
Comparison
- TMF8821 vs TMF8820: TMF8821 provides additional multi-zone configurations and improved object tracking flexibility.
- dToF vs Traditional IR Sensors: dToF technology provides better accuracy and stronger resistance to ambient light interference.
- I2C vs Analog Distance Sensors: Digital I2C communication provides more reliable measurements and easier integration.
Features
- Long-Range Distance Measurement: Measures distances from 10mm up to 5000mm with high accuracy.
- Direct Time-of-Flight Technology: Uses photon flight-time measurement for precise ranging.
- SPAD Sensor Array: Provides high sensitivity and reliable detection in different lighting conditions.
- Integrated 940nm VCSEL: Provides a safe Class 1 laser source for distance measurement.
- Multi-Zone Detection: Supports 3×3, 4×4, and 3×6 detection zone configurations.
- Adjustable Field of View: Supports up to 63° diagonal FoV using an integrated multi-lens array.
- Ambient Light Rejection: Maintains stable performance under bright sunlight and indoor lighting.
- On-Chip Processing: Performs histogram analysis and provides processed distance and confidence data.
- Qwiic I2C Interface: Enables quick plug-and-play connection without soldering.
- Low Power Operation: Suitable for portable and battery-powered applications.
- Multiple Interface Options: Supports both Qwiic connectors and standard breakout pins.
Principle of Work
The TMF8821 operates using direct Time-of-Flight (dToF) technology. The onboard VCSEL emits short pulses of infrared light toward the target object. When the light reflects back, the SPAD detector measures the arrival time of individual photons with extremely high precision.
The internal Time-to-Digital Converter (TDC) calculates the exact flight time of the photons. Since the speed of light is constant, the sensor determines the distance by calculating the time difference between transmission and reception.
The multi-zone SPAD array divides the measurement area into multiple regions, allowing the sensor to identify objects across different positions. The onboard processor performs histogram analysis, ambient light compensation, and confidence calculations before sending the final measurement data through the I2C interface.
Pinout

| Pin | Description | Direction |
|---|---|---|
| GND | Ground connection | Power |
| 3.3V | Power supply input | Power |
| SDA | I2C data line | Input/Output |
| SCL | I2C clock line | Input/Output |
| INT | Interrupt output, goes low when new data is available | Output |
| GP0/SYNC | General purpose I/O or synchronization signal | Input/Output |
| GP1 | General purpose I/O | Input/Output |
| EN | Enable input (active high) | Input |
Wiring Example
Arduino / ESP32 / Raspberry Pi Connection:
| TMF8821 | Controller |
|---|---|
| 3.3V | 3.3V Power |
| GND | GND |
| SDA | I2C SDA |
| SCL | I2C SCL |
| INT | Optional GPIO Interrupt |
Applications
- Camera Laser Detect Autofocus (LDAF) systems.
- Smart device presence detection.
- Robotic object detection and collision avoidance.
- Industrial safety light curtains.
- Human presence monitoring systems.
- Smart home automation devices.
- Interactive displays and gesture-based interfaces.
- Distance measurement and object tracking systems.
Technical Details
- Sensor: AMS TMF8821 Multi-Zone dToF Sensor
- Technology: Direct Time-of-Flight (dToF)
- Measurement Range: 10mm to 5000mm
- Detection Zones: 3×3, 4×4, 3×6
- Light Source: Class 1 940nm VCSEL
- Operating Voltage: 2.7V to 3.6V (3.3V recommended)
- Active Current: Approximately 57mA
- Standby Current: Approximately 8µA
- Maximum Read Rate: 30Hz
- Field of View: Up to 63° diagonal
- Communication Interface: I2C
- I2C Address: 0x41
- Operating Temperature: -30°C to +70°C
- Board Dimensions: 1.0 × 1.0 inch (25.4 × 25.4 mm)
Resources
- SparkFun Qwiic TMF882X Arduino Library
- SparkFun Qwiic dToF TMF8821 Product Page
- AMS TMF8821 Sensor Documentation
- SparkFun Qwiic Interface Documentation
Comparison
- TMF8821 vs TMF8820: TMF8821 provides additional multi-zone configurations and improved object tracking flexibility.
- dToF vs Traditional IR Sensors: dToF technology provides better accuracy and stronger resistance to ambient light interference.
- I2C vs Analog Distance Sensors: Digital I2C communication provides more reliable measurements and easier integration.

