# Adafruit TMF8806 Time of Flight Distance Sensor

## Overview

Danger: Please note: The TMF8806 datasheet/firmware implies it can do 10 meter ranging but we weren't able to get results past 5 meter even after the firmware upload step, and there may be an undocumented calibration step required. Either way, we would call this a 5m distance sensor and not a 10m.

![](https://cdn-learn.adafruit.com/assets/assets/000/146/018/medium800thumb/adafruit_products_6501-06.jpg?1788446161)

The **Adafruit TMF8806 Time of Flight Sensor** is a great _Time of Flight_ distance sensor from ams Osram in the TMF series of chips. The TMF8806 in particular can do 20mm to 5 meters at up to 30 Hz update rate, and a dedicated low-power 200mm mode. It also has a wider field-of-view.

The sensor contains a very tiny invisible laser source and a matching sensor. The TMF8806 can detect the "time of flight", or how long the light has taken to bounce back to the sensor. Since it uses a narrow light source, it is good for determining distance of only the surface directly in front of it. Unlike sonars that bounce ultrasonic waves, the 'cone' of sensing is narrower, in this case about 30° short range (under 200mm) and 21° above. Unlike IR distance sensors that try to measure the amount of light bounced, the TMF is much more precise and doesn't have linearity problems or 'double imaging' where you can't tell if an object is very far or very close.

![](https://cdn-learn.adafruit.com/assets/assets/000/146/019/medium800/adafruit_products_6501-04.jpg?1788446208)

One nice thing about this sensor is that while it does not require a firmware 'patch' on boot for 5 meter mode and the SRAM usage is also much lighter, so it fits easily in small memory boards like the ATmega328. You can use it on many 8-bit microcontroller devices. There is a 10 meter mode that does require a firmware patch but its only 3K and will also fit if you want it!

**Please note:** The TMF8806 datasheet/firmware implies it can do 10 meter ranging but we weren't able to get results past 5 meter even after the firmware upload step, and there may be an undocumented calibration step required. Either way, we would call this a 5m distance sensor and not a 10m.

![](https://cdn-learn.adafruit.com/assets/assets/000/146/020/medium800/adafruit_products_6501-02.jpg?1788446249)

The sensor is small and easy to use in any robotics or interactive project. Since it needs 3.3V power and logic we put the little fellow on a breakout board with a regulator and level shifting. You can use it with any 3-5V power or logic microcontroller with no worries. Works great with the **3.3V logic level of a Feather, or the 5V level of a ATmega** , this breakout is ready to work with most common microcontrollers or SBCs. and since it speaks I2C, you can easily connect it up with two data wires plus power and ground.

![](https://cdn-learn.adafruit.com/assets/assets/000/146/021/medium800/adafruit_products_6501-03.jpg?1788446267)

As if that weren't enough, we've also added [SparkFun qwiic](https://www.sparkfun.com/qwiic) compatible **[STEMMA QT](https://learn.adafruit.com/introducing-adafruit-stemma-qt)** connectors for the I2C bus **so you don't even need to solder.** Just wire up to your favorite micro with a plug-and-play cable to get ToF data ASAP. For a no-solder experience, just wire up to your favorite micro using a [STEMMA QT adapter cable](https://www.adafruit.com/?q=stemma%20qt%20cable). The Stemma QT connectors also mean the TMF8806&nbsp;can be used with our [various associated accessories](https://www.adafruit.com/?q=JST%20SH%204). [QT Cable is not included, but we have a variety in the shop](https://www.adafruit.com/?q=stemma+qt+cable&sort=BestMatch)

Communicating to the sensor is done over I2C, [check out our Arduino and CircuitPython/Python code](https://github.com/adafruit?q=TMF8806&type=all&language=&sort=) to get started fast and read data over I2C in a jiffy.

# Adafruit TMF8806 Time of Flight Distance Sensor

## Pinouts

Danger: Please note: The TMF8806 datasheet/firmware implies it can do 10 meter ranging but we weren't able to get results past 5 meter even after the firmware upload step, and there may be an undocumented calibration step required. Either way, we would call this a 5m distance sensor and not a 10m.

![](https://cdn-learn.adafruit.com/assets/assets/000/146/022/medium800/adafruit_products_double.jpg?1788446495)

The default I2C address is **0x29**.

## Power Pins

- **VIN** - This is the power pin. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V micro like Arduino, use 5V.
- **GND** - This is common ground for power and logic.

## I2C Logic Pins

- **SCL** - I2C clock pin, connect to your microcontroller's I2C clock line. This pin can use 3-5V logic, and there's a **10K pullup** on this pin.
- **SDA** - I2C data pin, connect to your microcontroller's I2C data line. This pin can use 3-5V logic, and there's a **10K pullup** on this pin.
- **[STEMMA QT](https://learn.adafruit.com/introducing-adafruit-stemma-qt) -** These connectors allow you to connectors to dev boards with **STEMMA QT** connectors or to other things with [various associated accessories](https://www.adafruit.com/?q=JST%20SH%204)

## Other Pins

- **INT** - the interrupt pin. It is an open-drain interrupt.
- **EN** - the enable pin. The pin is active high. If you pull the pin low, it turns off the TMF8806 and all memory content is lost
- **IO0** and **IO1** - these are general purpose input and output pins. They default to output low. They are 3V tolerant only!

Warning: IO0 and IO1 are 3V only!

## Power LED and LED Jumper

- **Power LED -** In the upper left corner, above the STEMMA connector, on the front of the board, is the power LED, labeled **on**. It is a green LED.
- **LED jumper** - This jumper is located on the front of the board, the the right of the LED. Cut the trace on this jumper to cut power to the "on" LED.

# Adafruit TMF8806 Time of Flight Distance Sensor

## CircuitPython and Python

Danger: Please note: The TMF8806 datasheet/firmware implies it can do 10 meter ranging but we weren't able to get results past 5 meter even after the firmware upload step, and there may be an undocumented calibration step required. Either way, we would call this a 5m distance sensor and not a 10m.

It's easy to use the **TMF8806** &nbsp;with Python or CircuitPython, and the [Adafruit\_CircuitPython\_TMF8806](https://github.com/adafruit/Adafruit_CircuitPython_TMF8806) module. This module allows you to easily write Python code to interface with the sensor.

You can use this driver with any CircuitPython microcontroller board or with a computer that has GPIO and Python [thanks to Adafruit\_Blinka, our CircuitPython-for-Python compatibility library](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

## CircuitPython Microcontroller Wiring

First wire up the breakout to your board exactly as follows. The following is the breakout wired to a Feather RP2040 using the STEMMA connector:

- **Board STEMMA 3V** to **breakout STEMMA&nbsp;**** VIN (red wire)**  
- **Board STEMMA GND** to **breakout**  **STEMMA** **GND (black wire)**  
- **Board STEMMA SCL** to **breakout**  **STEMMA** **SCL (yellow wire)**  
- **Board STEMMA SDA** to **breakout**  **STEMMA** **SDA (blue wire)**

![](https://cdn-learn.adafruit.com/assets/assets/000/146/258/medium640/adafruit_products_feather_stemma_bb.jpg?1788979483)

The following is the breakout wired to a Feather RP2040 using a solderless breadboard:

- **Board 3V** to **breakout** **VIN (red wire)**  
- **Board GND** to **breakout** &nbsp;**GND (black wire)**  
- **Board SCL** to **breakout** **SCL (yellow wire)**  
- **Board SDA** to **breakout** **SDA (blue wire)**

![](https://cdn-learn.adafruit.com/assets/assets/000/146/259/medium640/adafruit_products_feather_bb_bb.jpg?1788979500)

## Python Computer Wiring

Since there are _dozens_ of Linux computers/boards you can use, we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

Here's the Raspberry Pi wired with I2C using the STEMMA connector:

- **Pi 3V** to **breakout STEMMA** **VIN (red wire)**  
- **Pi GND** to **breakout**  **STEMMA** **GND (black wire)**  
- **Pi SCL** to **breakout**  **STEMMA** **SCL (yellow wire)**  
- **Pi SDA** to **breakout**  **STEMMA** **SDA (blue wire)**

![](https://cdn-learn.adafruit.com/assets/assets/000/146/260/medium640/adafruit_products_piStemma_bb.jpg?1788979516)

Here's the Raspberry Pi wired with I2C using a solderless breadboard:

- **Pi 3V** to **breakout** **VIN (red wire)**  
- **Pi GND** to **breakout** &nbsp;**GND (black wire)**  
- **Pi SCL** to **breakout** &nbsp;**SCL (yellow wire)**  
- **Pi SDA** to **breakout** &nbsp;**SDA (blue wire)**

![](https://cdn-learn.adafruit.com/assets/assets/000/146/261/medium640/adafruit_products_piBB_bb.jpg?1788979536)

## Python Installation of TMF8806 Library

You'll need to install the **Adafruit\_Blinka** library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-tmf8806`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

## CircuitPython Usage

To use with CircuitPython, you need to first install the **Adafruit\_CircuitPython\_TMF8806** &nbsp;library, and its dependencies, into the **lib** folder on your **CIRCUITPY** drive. Then you need to update **code.py** with the example script.

Thankfully, we can do this in one go. In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file, and copy the **entire**  **lib**  **folder** and the **code.py** file to your **CIRCUITPY** drive.

Your **CIRCUITPY/lib** folder should contain the following folders:

- **adafruit\_bus\_device/**
- **adafruit\_register/**
- **adafruit\_tmf8806/**

![CIRCUITPY drive](https://adafruit.github.io/Adafruit_CircuitPython_Bundle/tmf8806_tmf8806_simpletest.py.png )

## Python Usage

Once you have the library `pip3` installed on your computer, copy or download the following example to your computer, and run the following, replacing **code.py** with whatever you named the file:

`python3 code.py`

## Example Code

**If running CircuitPython:** Once everything is saved to the **CIRCUITPY** drive, [connect to the serial console](https://learn.adafruit.com/welcome-to-circuitpython/kattni-connecting-to-the-serial-console) to see the data printed out!

**If running Python:** The console output will appear wherever you are running Python.

https://github.com/adafruit/Adafruit_CircuitPython_TMF8806/blob/main/examples/tmf8806_simpletest.py

You'll see the TMF8806 recognized over I2C by printing its firmware version and serial number. Then, distance measurements will begin printing whenever data is ready from the sensor.

![](https://cdn-learn.adafruit.com/assets/assets/000/146/265/medium800/adafruit_products_Screenshot_2026-09-09_152229.png?1788981762)

# Adafruit TMF8806 Time of Flight Distance Sensor

## Python Docs

# Adafruit TMF8806 Time of Flight Distance Sensor

## Arduino

Danger: Please note: The TMF8806 datasheet/firmware implies it can do 10 meter ranging but we weren't able to get results past 5 meter even after the firmware upload step, and there may be an undocumented calibration step required. Either way, we would call this a 5m distance sensor and not a 10m.

Using the TMF8806 breakout with Arduino involves wiring up the breakout to your Arduino-compatible microcontroller, installing the [Adafruit\_TMF8806](https://github.com/adafruit/Adafruit_TMF8806) library, and running the provided example code.

## Wiring

Wire as shown for a **5V** board like an Uno. If you are using a **3V** board, like an Adafruit Feather, wire the board's 3V pin to the breakout VIN.

Here is an Adafruit Metro wired up to the breakout using the STEMMA QT connector:

- **Board 5V** to **breakout** **VIN (red wire)**  
- **Board GND** to **breakout** &nbsp;**GND (black wire)**  
- **Board SCL** to **breakout** &nbsp;**SCL (yellow wire)**  
- **Board SDA** to **breakout** &nbsp;**SDA (blue wire)**

![](https://cdn-learn.adafruit.com/assets/assets/000/146/262/medium640/adafruit_products_metro_stemma_bb.jpg?1788979562)

Here is an Adafruit Metro wired up using a solderless breadboard:

- **Board 5V** to **breakout** **VIN (red wire)**  
- **Board GND** to **breakout** &nbsp;**GND (black wire)**  
- **Board SCL** to **breakout** &nbsp;**SCL (yellow wire)**  
- **Board SDA** to **breakout** &nbsp;**SDA (blue wire)**

![](https://cdn-learn.adafruit.com/assets/assets/000/146/263/medium640/adafruit_products_metro_bb_bb.jpg?1788979582)

## Library Installation

You can install the **Adafruit\_TMF8806** &nbsp;library for Arduino using the Library Manager in the Arduino IDE.

![](https://cdn-learn.adafruit.com/assets/assets/000/146/254/medium800/adafruit_products_Arduino_Open_Library_Manager.png?1788976704)

Click the **Manage Libraries ...** menu item, search for **Adafruit\_TMF8806** , and select the **Adafruit TMF8806** &nbsp;library:

![](https://cdn-learn.adafruit.com/assets/assets/000/146/274/medium800/adafruit_products_Screenshot_2026-09-10_081808.png?1789042701)

If asked about dependencies, click "Install all".

![](https://cdn-learn.adafruit.com/assets/assets/000/146/275/medium800/adafruit_products_Screenshot_2026-09-10_081845.png?1789042737)

If the "Dependencies" window does not come up, then you already have the dependencies installed.

Warning: If the dependencies are already installed, you must make sure you update them through the Arduino Library Manager before loading the example!

## Example Code
https://github.com/adafruit/Adafruit_TMF8806/blob/main/examples/tmf8806_simpletest/tmf8806_simpletest.ino

Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. You'll see the TMF8806 recognized over I2C. Then, the distance in mm, reliability of the measurement and die temperature in Celcius will be printed whenever data is ready.

![](https://cdn-learn.adafruit.com/assets/assets/000/146/276/medium800/adafruit_products_Screenshot_2026-09-10_082328.png?1789043050)

# Adafruit TMF8806 Time of Flight Distance Sensor

## Arduino Docs

# Adafruit TMF8806 Time of Flight Distance Sensor

## Downloads

## Files

- [TMF8806 Datasheet](https://cdn-shop.adafruit.com/product-files/6501/P6501+TMF8806_DS001097_4-00.pdf)
- [EagleCAD PCB Files on GitHub](https://github.com/adafruit/Adafruit-TMF8806-Time-of-Flight-Distance-Sensor-PCB)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20TMF8806%20Time%20of%20Flight%20Sensor.fzpz)

## Schematic and Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/146/016/medium800/adafruit_products_schem.png?1788444986)

![](https://cdn-learn.adafruit.com/assets/assets/000/146/017/medium800/adafruit_products_fab.png?1788445047 dimensions are in inches)


## Primary Products

### Adafruit TMF8806 Time of Flight Distance Sensor - 10mm to 5m

[Adafruit TMF8806 Time of Flight Distance Sensor - 10mm to 5m](https://www.adafruit.com/product/6501)
The&nbsp; **Adafruit TMF8806&nbsp;Time of Flight Sensor** &nbsp;is a great&nbsp;_Time of Flight_&nbsp;distance sensor from ams Osram&nbsp;in the TMF series of chips. The TMF8806&nbsp;in particular can do 20mm to 5 meters at up to 30&nbsp;Hz update rate, and a dedicated...

In Stock
[Buy Now](https://www.adafruit.com/product/6501)
[Related Guides to the Product](https://learn.adafruit.com/products/6501/guides)

## Related Guides

- [CircuitPython Servo Tester](https://learn.adafruit.com/circuitpython-servo-tester.md)
- [Adjustable Breadboard Power Supply Kit](https://learn.adafruit.com/adjustable-breadboard-power-supply-kit.md)
- [LED Trampoline](https://learn.adafruit.com/led-trampoline.md)
- [Adafruit CAN Pal](https://learn.adafruit.com/adafruit-can-pal.md)
- [CircuitPython Libraries and Jupyter Notebook on any Computer with MCP2221](https://learn.adafruit.com/jupyter-on-any-computer-with-circuitpython-libraries-and-mcp2221.md)
- [Adafruit NeoKey 1x4 QT I2C Breakout](https://learn.adafruit.com/neokey-1x4-qt-i2c.md)
- [Adafruit ISO1540 Bidirectional I2C Isolator](https://learn.adafruit.com/adafruit-iso1540-bidirectional-i2c-isolator.md)
- [Introducing the Adafruit Bluefruit LE UART Friend](https://learn.adafruit.com/introducing-the-adafruit-bluefruit-le-uart-friend.md)
- [Adafruit RGB Matrix Bonnet for Raspberry Pi](https://learn.adafruit.com/adafruit-rgb-matrix-bonnet-for-raspberry-pi.md)
- [Mini LED Matrix Audio Visualizer](https://learn.adafruit.com/mini-led-matrix-audio-visualizer.md)
- [Adafruit FT232H With SPI & I2C Devices](https://learn.adafruit.com/adafruit-ft232h-with-spi-and-i2c-libraries.md)
- [Adafruit PCA9546 4-Channel STEMMA QT Multiplexer](https://learn.adafruit.com/adafruit-pca9546-4-channel-stemma-qt-multiplexer.md)
- [Using the Adafruit FunHouse with Home Assistant](https://learn.adafruit.com/using-the-adafruit-funhouse-with-home-assistant.md)
- [No-Code Offline Data Logger with WipperSnapper](https://learn.adafruit.com/no-code-offline-data-logging-with-wippersnapper.md)
- [Adafruit LSM6DS3TR-C + LIS3MDL - Precision 9 DoF IMU](https://learn.adafruit.com/adafruit-lsm6ds3tr-c-lis3mdl-precision-9-dof-imu.md)
