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 @_JonMyer: 🚨Attention DeepRacer's including #UndergroundDeepRacer🚨 Check our our LIVE stream that including @IAM_dbro Take a few moments…
19 hours ago
DIY Drones via Twitter
RT @MarvelmindMaxim: Extreme precision for 60 swarming robots. #marvelmind #autonomousrobotics #robotics #swarmrobotics #rtls #ips #indoor…
Monday
DIY Drones via Twitter
RT @MarvelmindMaxim: Precise (±2cm) tracking for racing boats and autonomous boats. Works outdoor and indoor. #autonomous #AutonomousVehic…
Monday
DIY Drones via Twitter
RT @MarvelmindMaxim: Helping PixHawk folks to fly autonomous quadcopters using PX4 and ArduPilot. https://marvelmind.com/drones/ Equally suitab…
Monday
DIY Robocars via Twitter
RT @chr1sa: The @DIYRobocars @donkey_car virtual AI car race is starting in 15 minutes! Watch it live on Twitch https://www.twitch.tv/mossmann3333 htt…
Saturday
DIY Robocars via Twitter
RT @chr1sa: Don't miss our monthly @DIYRobocars @donkey_car virtual AI car race tomorrow at 10:00am PT live on Twitch. Head-to-head racing…
Jul 31
DIY Robocars via Twitter
RT @sparkfun: Our completed tutorial on building an @NVIDIA Jetson Nano-powered @Sphero RVR gets your bot up and running via teleoperation…
Jul 30
DIY Robocars via Twitter
RT @SmallpixelCar: Freeway test https://t.co/4V5tV9lhIP
Jul 29
DIY Robocars via Twitter
Very small autonomous cars racing, thanks to an overhead camera: https://control.ee.ethz.ch/research/team-projects/autonomous-rc-car-racing.html
Jul 29
DIY Robocars via Twitter
Jul 29
DIY Robocars via Twitter
Jul 29
DIY Robocars via Twitter
RT @chr1sa: Don't miss our virtual AI car race this Saturday! Real developers + virtual cars =🏎️🏎️🏎️ Head-to-head battles with thrills, sp…
Jul 28
DIY Robocars via Twitter
Jul 27
DIY Robocars via Twitter
RT @usashirou1: Jetson nano by Isaac Kaya #jetson https://t.co/Mu1N0CyQkN
Jul 23
DIY Robocars via Twitter
RT @GPUsolution: JetRacer mady by Iflytek company #JetsonNANO #Nvidia https://t.co/MimTymIwge
Jul 23
DIY Robocars via Twitter
RT @openmvcam: I love this: Mega or Mini? Image Classification on the 1MB OpenMV Cam H7 by Ish Ot Jr. in OpenMV, Edge Impulse, Internet of…
Jul 23
More…