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 @Heavy02011: ⁦@diyrobocars⁩ : A Home-brew computer club* for Connected Autonomous Driving. talk at #piandmore ⁦@PiAndMore⁩ on Jan 23rd h…
yesterday
DIY Robocars via Twitter
RT @a1k0n: New blog post! Deep dive into my ceiling light based localization algorithm which runs in 1ms on a Raspberry Pi 3: https://t.co/…
yesterday
DIY Robocars via Twitter
Great new guide to using @donkey_car https://custom-build-robots.com/donkey-car-e-book-en
yesterday
DIY Robocars via Twitter
RT @chr1sa: The next @DIYRobocars virtual AI race is tomorrow morn at 9:00am PT. You can watch live on Twitch https://www.meetup.com/DIYRobocars/events/275268196/
Friday
DIY Robocars via Twitter
New version of Intel OpenBot! This resolves many of the issues with the first version, including a much smoother tr… https://twitter.com/i/web/status/1352395636369313798
Thursday
DIY Drones via Twitter
Using ArduRover with an RTK GPS https://ift.tt/2N9I3RO
Jan 18
DIY Drones via Twitter
Jan 18
DIY Robocars via Twitter
Jan 18
DIY Robocars via Twitter
Jan 15
DIY Robocars via Twitter
Jan 15
DIY Drones via Twitter
Jan 14
DIY Robocars via Twitter
RT @Heavy02011: @diyrobocars : A Home-brew computer club* for Connected Autonomous Driving on Jan 23rd, 2021 https://www.meetup.com/Connected-Autonomous-Driving/events/275728684/ #Meetu…
Jan 14
DIY Robocars via Twitter
Jan 14
David Hori liked Isabella Domi's profile
Jan 12
DIY Robocars via Twitter
RT @Heavy02011: ⁦@diyrobocars⁩ Autonomous Driving Assembly at #rC3. join us at https://rc3.world/rc3/assembly/diyrobocars-f1tenth/ ⁦@f1tenth⁩ ⁦@DAVGtech⁩ ⁦@DWalmroth⁩…
Jan 11
DIY Robocars via Twitter
RT @chr1sa: New car designs coming for our next @DIYRobocars @donkey_car virtual race on the 23rd. Choose any one you want at race time Le…
Jan 11
More…