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

DIY Robocars via Twitter
RT @a1k0n: @SmallpixelCar @diyrobocars It's just something that's easy to track with chroma keying. I ended up using different colors on th…
Monday
DIY Robocars via Twitter
Monday
DIY Robocars via Twitter
RT @TinkerGen_: "The Tinkergen MARK ($199) is my new favorite starter robocar. It’s got everything — computer vision, deep learning, sensor…
Nov 23
DIY Robocars via Twitter
Nov 23
DIY Robocars via Twitter
RT @roboton_io: Join our FREE Sumo Competition 🤖🏆 👉 https://roboton.io/ranking/vsc2020 #sumo #robot #edtech #competition #games4ed https://t.co/WOx…
Nov 16
DIY Drones via Twitter
First impressions of Tinkergen MARK robocar https://ift.tt/36IeZHc
Nov 16
DIY Robocars via Twitter
Our review of the @TinkerGen_ MARK robocar, which is the best on the market right now https://diyrobocars.com/2020/11/15/first-impressions-of-tinkergen-mark-robocar/ https://t.co/ENIlU5SfZ2
Nov 15
DIY Robocars via Twitter
RT @Ingmar_Stapel: I have now explained the OpenBot project in great detail on my blog with 12 articles step by step. I hope you enjoy read…
Nov 15
DIY Robocars via Twitter
RT @DAVGtech: This is a must attend. Click the link, follow link to read the story, sign up. #chaos2020 #digitalconnection #digitalworld ht…
Nov 15
DIY Robocars via Twitter
RT @a1k0n: Got a new chassis for outdoor races (hobbyking Quantum Vandal) but I totally didn't expect that it might cause problems for my g…
Nov 11
DIY Drones via Twitter
First impressions of the Intel OpenBot https://ift.tt/36qkVV4
Nov 10
DIY Robocars via Twitter
Nov 9
DIY Robocars via Twitter
Excellent use of cardboard instead of 3D printing! https://twitter.com/Ingmar_Stapel/status/1324960595318333441
Nov 7
DIY Robocars via Twitter
RT @chr1sa: We've got a record 50 teams competing in this month's @DIYRobocars @donkey_car virtual AI car race. Starting today at 10:00am…
Nov 7
DIY Robocars via Twitter
Nov 6
DIY Robocars via Twitter
RT @a1k0n: Car's view, using a fisheye camera. The ceiling light tracking algorithm gave me some ideas to improve ConeSLAM, and having grou…
Nov 5
More…