Enabling and using analog inputs

Hey all,

I've been a follower of the community for a while but have just now found an opportunity to post something. Forgive me in advance for the newbie question as I'm a ecologist/remote sensing guru first who also happens to operate a few drones for my work.

I am interested in hooking up additional sensors to the analog pins on an APM 2.5 and having them be displayed in Mission Planner. Namely, I would like to add one of these as a fuel level sensor in a large mapping plane:

http://www.sensortechnics.com/en/products/liquid-level-sensors-and-switches/capacitive-level-sensors/clc/

It seems to be perfect, as it will provide a 0-5V signal. The only problem is that I can't figure out how to enable analog inputs in the code to get them to show up in MP. What I think I'm seeing is that I need to enable the sensor in one spot, maybe in the 1 second loop, and then have it sent over MAVLink using that routine.

Is that basically what I need to do? If so, any advice on how to go about it? I have to say I'm pretty wary of modifying firmware and compiling it myself, considering how important its job is.

Thanks,

Max

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Larry, are you still around?  It looks like you were able to add some analog channels by changing the AP code but what about Mission Planner?  Didn't you have to change it too to tell it where and how to display the data?  Is this info documented anywhere on this site?

    Thanks,

    Dan



    Larry Grater said:

    Max,

    I was hoping someone else would respond since I'm not sure I did things right.  But, it worked.  In v 2.65 I followed suit in sensors.pde, modeled after the way the voltage pins are handled.  Then I had to extend the max_pin_sources in AP_AnalogSource_Arduino.cpp.  You might try this and see where it goes.  My application was to read an internal and external thermistor voltage and convert into temps.

    Just in case the HAB guys are following the result was to do preferential venting of the airframe and move as far as possible from the electronics.  I achieved a min temp of 40F at APM on the last flight to 101k ft.  The board temp has a bunch of lag and some internal heat generation.

    Regards,

    Larry Grater

  • Max,

    I was hoping someone else would respond since I'm not sure I did things right.  But, it worked.  In v 2.65 I followed suit in sensors.pde, modeled after the way the voltage pins are handled.  Then I had to extend the max_pin_sources in AP_AnalogSource_Arduino.cpp.  You might try this and see where it goes.  My application was to read an internal and external thermistor voltage and convert into temps.

    Just in case the HAB guys are following the result was to do preferential venting of the airframe and move as far as possible from the electronics.  I achieved a min temp of 40F at APM on the last flight to 101k ft.  The board temp has a bunch of lag and some internal heat generation.

    Regards,

    Larry Grater

This reply was deleted.

Activity