How do I add external ADCs and sensors? I2c, spi, UART

Hi! My name is Clive, and I am new to the community. Phil at AUAV told me about the developer forum, and here I am, with my questions!
I am using a Pixracer on an unorthodox drone. The application is similar to the a drone with constant speed props and servo-collectives. In order to make this all work, I need to add some sensors and telemetry to the pixracer.

At first, I was going to outboard all telemetry with a dedicated micro controller and wifi link. I am still considering doing that, but the timing of the telemetry from the pixracer will be better.

Basically, I want to add a 12 or 16 channel ADC , and poll it at 50~200hz. This ADC will be monitoring about 9 sensors on the vehicle.

I would love to send all this data down the Mavlink pipe.

From my understanding, I must:

  1. Write an i2c driver that talks to my sensors
  2. Write a topic about these sensors, make an object that holds the sensor data
  3. Publish to that
  4. get MAVlink to pay attention to that thread and stuff it down the pipe

VS:
-Get a teensy and a cheap wifi board
-Wire all my sensors to the ADCs on the teensy
-Manually time all the PWM outputs from the pixracer to get commanded actuator position
-Send all that down via a separate link

I know I can do the second route, but it is an ugly hack. My concern is that my programming skills have not been developed enough to fully comprehend a project as large and as complicated as the PX4 firmware stack. I am concerned that the number of hours I need to spend to master this would exceed the number of hours needed to hack the solution.

A request to the really smart people on this forum, if someone were to say, write a driver for this chip:
http://www.linear.com/product/LTC2497
and hook it up to some mavlink parms,
And drop it in the main repo, you would probably make a lot of people very very very very happy :smiley:

And trick question at the end: I want to code in throttle curves. My actuators are non-linear, and have little effect on the thrust at low PWM settings. I would like to give the pixracer a remap curve to apply to the throttles so it does not expect much out of them at the low range.

Have there been no replies because this is too obvious, or because this is too hard?

I just realized this might read as “Do my work for me”

What I am really looking for is a good place to start to figure out how to integrate external hardware into the px4 stack. I have not had much luck figuring this out thusfar. Is there any example code out there?

I’ve been working on a similar topic myself. The system I have only has three ADC ports with eight ADC channels overall. If the firmware can tell its ADC however, you should be able to use my code to log the information from the ADC ports.

pero no colocaste tu código amigo, también estoy interesado en el tema.