arducopter sonar setup

Hey guys, a couple questions for you.

I am running the 3M Pilot board with megapirateng 2.8 r3 (I know its not arducopter, but it is basically the same thing.) That all seems fine, I have everything up and working as far as I can tell. I want to add sonar to it since I have a LV-MaxSonar-EZ0 just sitting here from an old robot project.

I have been all over the schematics for the APM2.5 and it appears from instructions and everything that you just plug the analog line of the sonar to A0. Doing a trace on the schematic for APM2.5, A0 is pin 97 PF0 (ADC0) on the atmega2560 chip.

The problem comes in that on the 3M Pilot board, only a couple analog lines are broken out, and that one (as far as I can tell, I cant find a schematic for this board) is not. So, I went as far as desoldering that one pin and pulling it up to get access to it (crazy I know). I connect the sonars AN line to that pin, go to mission planner, turn on sonar and set it to the appropriate model of sonar. I then go to test it in CLI and I get 0 CM as the distance. I then test the AN line on the sonar and see about .7v at a distance of about 5 feet or 6 feet (which by its schematic seems correct.)

Ok, so I guess my questions are:

1. Is that the correct pin to attach to?

2. Where can I edit the code to change the pin to one of the few analog pins that is broken out on the 3M Pilot board?

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

Join diydrones

Email me when people reply –


  • Oh man, I just realized, in my APM_config.h, its set to PIRATES_FREEIMU_4, so that probably means a different pinout and I ripped up that pin for nothing.. right?


This reply was deleted.


Shivchand Jaysaval liked Shivchand Jaysaval's profile
Aug 25