<h1>i2c</h1>
<p>Yes. This is how flight controllers talk to the already available sensors on board*. The addition of barometer and magnetometer sensors (and any other sensors that these flight control softwares support natively) is, and should be, done via the i2c bus. Save some sensors like GPS which is generally UART (though i2c/SPI GPS chips may exist).</p>
<h1>USB</h1>
<p>Short answer - no.</p>
<p>USB-otg is a complex software stack that probably wouldn't even fit on the stm32 flash. It requires pretty intensive processing and handling of a wide range of devices. While this support may be possible, it certainly isn't natively supported. Especially on chips where the USB port actually passes to a USB-&gt;serial converter to talk to the main MCU on the FC.</p>
<p>*Modern flight controllers talk to the primary MPU (motion processing unit) over SPI as opposed to i2c because it is faster, lower latency, and allows for higher frequencies. Peripheral sensors are still UART or i2c in this case.</p>

CC BY-SA 4.0
2021-08-03T14:04:24.663Z
What about Tiny USB though? I read that many M0 controllers support that. Modern FCs are generally M4 and many have USB as a hardware  peripheral inbuilt
jar
CC BY-SA 4.0
2021-08-03T17:04:38.283Z
That's something I was not aware of. AFAIK it's not present in betaflight. What sensors in particular do you want to add? It's quite likely the sensor itself outputs to a chip that converts i2c or serial to USB
Brydon Gibson
CC BY-SA 4.0
2021-08-03T18:38:23.413Z
I want to add some environmental sensors like [BME680](https://www.sparkfun.com/products/16466) or [CCS811](https://www.sparkfun.com/products/14193) which work on I2C. The USB based sensor that I want to add is a thermal camera like this one - [Pure Thermal Mini](https://groupgets.com/manufacturers/getlab/products/purethermal-mini-flir-lepton-smart-i-o-module).
jar
CC BY-SA 4.0
2021-08-03T19:21:47.920Z
There won't be native support for these in betaflight/inav. You'll have to write your own drivers in their environment to parse the data and be able to make mixer inputs. Unless you're planning on making flight path adjustments based on the input of a thermal camera (in which case this seems like a serious candidate for custom flight control), why does the flight controller care what the camera sees?
Brydon Gibson
CC BY-SA 4.0
2021-08-03T20:41:05.633Z
Yeah I mean I don't want to make flight adjustments for custom flight control....just replace a formal FPV with thermal feed. The issue is that, that thermal module acts as a usb camera. That's why I am having a hard time figuring out if it is compatible, or if it is possible at all to work with it.
jar
CC BY-SA 4.0
2021-08-04T12:19:19.713Z
Any flight controller that does OSD will only support composite/analog video, and will not be able to overlay an OSD on a digital feed. Digital video transmitters might be able to transmit this video, but that is completely unrelated to flight control
Brydon Gibson
CC BY-SA 4.0
2021-08-03T13:51:40.737Z
2021-08-03T13:51:40.737Z
Brydon Gibson
<p>Readily available flight controllers have pins/pads available usually for UART ports where you can attach various modules like ESC, RX, VTX, OSD etc.</p>
<p>I wanted to know if it is similarly possible to attach I2C as well as USB based sensors to the flight controller? For I2C sensor (like a I2C temperature sensor) I'd like to have it relay back its reading in the OSD telemetry.</p>
<p>For the USB sensor, since OTG USB is not present on any FC that I know of, can I attach the D+ and D- lines to UART/USB bus on the FC and also receive that data via OSD telemetry or from the analog VTX back to me?</p>
<p>The most important part of this inquiry is that, is it readily configurable in the configuration softwares to attach external modules like this and have them working? Are there any examples of this in action on the popular projects like Ardupilot, iNAV, Betaflight, Emuflight etc?</p>

<flight-controller><sensor><telemetry>
Is it possible to attach I2C and USB based sensors to the flight controller and receive some outputs via telemetry?
jar
# Is it possible to attach I2C and USB based sensors to the flight controller and receive some outputs via telemetry?

(Asked by: username_0 on 2021-08-02)

Readily available flight controllers have pins/pads available usually for UART ports where you can attach various modules like ESC, RX, VTX, OSD etc.

I wanted to know if it is similarly possible to attach I2C as well as USB based sensors to the flight controller? For I2C sensor (like a I2C temperature sensor) I'd like to have it relay back its reading in the OSD telemetry.

For the USB sensor, since OTG USB is not present on any FC that I know of, can I attach the D+ and D- lines to UART/USB bus on the FC and also receive that data via OSD telemetry or from the analog VTX back to me?

The most important part of this inquiry is that, is it readily configurable in the configuration softwares to attach external modules like this and have them working? Are there any examples of this in action on the popular projects like Ardupilot, iNAV, Betaflight, Emuflight etc?

**Tags:** flight-controller, sensor, telemetry


---

## 1 answers

### Answer by username_1 on 2021-08-03. Score: 2 | Accepted answer

# i2c

Yes. This is how flight controllers talk to the already available sensors on board\*. The addition of barometer and magnetometer sensors (and any other sensors that these flight control softwares support natively) is, and should be, done via the i2c bus. Save some sensors like GPS which is generally UART (though i2c/SPI GPS chips may exist).

# USB

Short answer - no.

USB-otg is a complex software stack that probably wouldn't even fit on the stm32 flash. It requires pretty intensive processing and handling of a wide range of devices. While this support may be possible, it certainly isn't natively supported. Especially on chips where the USB port actually passes to a USB->serial converter to talk to the main MCU on the FC.

\*Modern flight controllers talk to the primary MPU (motion processing unit) over SPI as opposed to i2c because it is faster, lower latency, and allows for higher frequencies. Peripheral sensors are still UART or i2c in this case.

> **Comments:**
> **username_0**: What about Tiny USB though? I read that many M0 controllers support that. Modern FCs are generally M4 and many have USB as a hardware  peripheral inbuilt  
> **username_1**: That's something I was not aware of. AFAIK it's not present in betaflight. What sensors in particular do you want to add? It's quite likely the sensor itself outputs to a chip that converts i2c or serial to USB  
> **username_0**: I want to add some environmental sensors like [BME680](https://www.sparkfun.com/products/16466) or [CCS811](https://www.sparkfun.com/products/14193) which work on I2C. The USB based sensor that I want to add is a thermal camera like this one - [Pure Thermal Mini](https://groupgets.com/manufacturers/getlab/products/purethermal-mini-flir-lepton-smart-i-o-module).  
> **username_1**: There won't be native support for these in betaflight/inav. You'll have to write your own drivers in their environment to parse the data and be able to make mixer inputs. Unless you're planning on making flight path adjustments based on the input of a thermal camera (in which case this seems like a serious candidate for custom flight control), why does the flight controller care what the camera sees?  
> **username_0**: Yeah I mean I don't want to make flight adjustments for custom flight control....just replace a formal FPV with thermal feed. The issue is that, that thermal module acts as a usb camera. That's why I am having a hard time figuring out if it is compatible, or if it is possible at all to work with it.  
> **username_1**: Any flight controller that does OSD will only support composite/analog video, and will not be able to overlay an OSD on a digital feed. Digital video transmitters might be able to transmit this video, but that is completely unrelated to flight control  

---

