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
Oct 23
DIY Robocars via Twitter
RT @_JonMyer: 🏎 We need your help in naming my #AWS DeepRacer Underground Track 🏎 @davidfsmith's track is going to be referred to as 𝗔𝗪𝗦 𝗗…
Oct 22
DIY Robocars via Twitter
RT @gclue_akira: 仕事もおわったし、電脳化にとらい #マリオカートハック https://t.co/4IU90hCLgm
Oct 22
DIY Robocars via Twitter
This is the hashtag to follow all the people in Japan who are hacking the new Nintendo Mario Kart with the real AR… https://twitter.com/i/web/status/1319281354664677376
Oct 22
DIY Robocars via Twitter
RT @gclue_akira: @chr1sa @diyrobocars jupyter mario https://t.co/P0oHdjlCRq
Oct 22
DIY Robocars via Twitter
RT @_JonMyer: 🚨Our 1st AWS DeepRacer Community Race is Underway on http://twitch.tv/aws 🚨 Join us to find out which member of your commu…
Oct 20
DIY Robocars via Twitter
Oct 19
DIY Robocars via Twitter
RT @BackyardRobotcs: After an admittedly long wait, the new Tinymovr R3.3 motor controller is now available https://tinymovr.com 🥳
Oct 19
DIY Robocars via Twitter
RT @_JonMyer: 🏎 1 hr left before the #AWS #DeepRacer Community 🏎 Top 5 Race tomorrow LIVE on Twitch 1st Place = $50 Amazon GC or AWS Credit…
Oct 19
DIY Robocars via Twitter
Oct 16
DIY Robocars via Twitter
Oct 15
DIY Robocars via Twitter
Oct 14
DIY Robocars via Twitter
RT @davidfsmith: Race virtually with The AWS DeepRacer Community Race and then join us on the track to see how your times compare on the ph…
Oct 14
DIY Robocars via Twitter
Oct 14
Hiroki Tanaka liked Hiroki Tanaka's profile
Oct 13
DIY Robocars via Twitter
RT @breadcentric: It's now!
Oct 13
More…