I have read the arducopter manual and also reviewed some of the earlier forum posts and initially moved my sonar sensor (recommended Maxbotix) 3" away from the main electronics but still see too much noise for the sonar to work in Alt Hold properly,  So I did some more research and think the following may be of interest to the group. I certainly hope it allows me to keep the sonar closer to the centre of my copter rather than out on an extended arm and nearer to the motors and props.


I found a simple solution from Maxbotix, that should eliminate the effects of excessive supply noise which can impact the Sonar sensor operation.  Placing a 100 Ohm resistor in series with the V+ line along with a 100uF Electrolytic capacitor (6.3V +/- 20% tolerance) to ground, you create an effective filter for the sensor.  This ensures that almost any noise introduced onto the line is captured and only clean stable power is supplied to the sensor.  See the photo schematic below:



This combined with perhaps a shielded cable as described here may eliminate the need to place the sensor out on a long plastic arm as I have seen mentioned in another forum post and in the Arducopter manual.


The only concern I have is extending the ground plane to the sensor board and whether this may introduce other issues.   For example, normally the signal receiving end ground plane would  be tied to earth,  But in the arducopter this is not possible being a flying platform. 


Anyone care to discuss / comment  the possible side effects of a floating ground between the APM and sensor acting as an antenna of some sorts if both ends are connected? In other words would connecting the signal wire shield to the GND on both the APM and Sonar (As described in the Maxbotics article)  be ok? Note the postive, negative and Analogue signal would be inside the shield. 


I plan to do some experimenting over the next few days and report back my findings.


One other quick question.  How many people run with sensor filters enabled on the  IMU shield (3 in total)? What are the cons if you use the filters?  e.g some sensitivity loss in the detector / sensor?

Views: 15467


Reply to This

Replies to This Discussion

This is my sonar graph hand holding the quad.. I really don't have a reference but looks like a lot of noise to me..

Sorry for the small pic.. I am not sure how to bring pics to the forum..


for some reason, i'm unable to see that pic.   you can add a pic right into the forum by clicking on the button just to the right of the link button.  Here's a picture of this discussion on how to add a pic.

Here it is.. I was hand holding and seeing a lot of clothing tables and carpet etc..

If you were holding it still for that whole time then I'd say it's not looking very good.  The time period is quite long though and if you were moving it around a lot then it's possible that it's ok.


What i often do to test is I hold my copter in my hand and lift it up and down from about 30cm at it's lowest point to about shoulder level at it's highest point.  I do this 3 times.  The sonar has a wide beam so i hold it as far away from me as possible and try not to have any obstructions in the way.


When I graph it out I get a nice pretty graph.  Below is a pic of a reasonbly good signal but still not perfect.  These little spikes would cause problems with alt hold.

I was holding at arms length high and jerking the roll stick bait always thinking of tuning. I will try a better environment for testing the sonar tomorrow now that I can use the graphing logs. I also can also isolate the vibs better..

You have been a great help. Thanks again.

Good to see I am not the only one with erratic climb rate data....I assume this is giving cm/s or something similar. Do you happen to to know why this moves os much?

Chaps I think I should mention just so you are aware, the original diagram from Maxbotix in the post I started a while ago is for LV series not XL.  A correction to the resistor value was posted. Here is the correct diagram:

The 10 Ohm provides the correct passive filter response for application with APM.  This is not a contradiction to using an RF choke Just wanted to update the diagram.  Another thing to note is out of the XL range the XL-MaxSonar-EZ0 is one of the most sensitive devices Maxbotix's makes.  It is very prone to interference so it takes some experimentation to get a clean signal.

I also fashioned a quick connect version for testing here Sonar Connector

Edward I agree with Randy this looks too much noise for the type of testing you were doing.  I have used a combination of capturing sonar logs with just the electronics on but no motors to running motors with and without blades to get different sonar range measurement graphs.  

Keep an eye on the physical and acoustic interference sources.  Randy makes a valid point about proximately interference to the beam.  I found the best way to test the sonar is to connect up the serial TX / Rx to a PC and monitor the sonar real time. For example I noticed interference creeping in when I got sonar to close to one of the landing legs.  Having the realtime sonar displayed also allows you to move the sonar close to potential interference sources.

Hi Greg, 

What pc software are you using, Hyperterminal, Hyper Serial Port.. You guys are reallly expanding my sphere of understanding whats going on..Thanks all..

Hey Greg,

If you are adding a filter to remove EMI (noise) then the better way is to use the chock and the guys at Maxbotix should know this......not sure when they first did the diagram but I can't imagine the tiny little chokes are a new thing but then again maybe they are or just aren’t real common.

Either way, I love the quick connector, I kinda wish I had gone to the trouble of doing the same thing, but then again I plan on soldering connections directly to the board (no plugs) once my new 3 axis camera gimbal and landing gear arrives and I may be forced to move to a unit that is less sensitive with a narrower beam.

I built up  the filter with 100mcH inductor and 100mF cap and placed the sonar closer to the main body with a Lego mount.. Other than a couple of single spikes looks much better.

@Edward I use a simple Windows program called the Sonar Acoustic Ranger.  It takes the serial (TX) output on Pin 5 (When Pin 1 is open or held high) which is  in the form of an ASCII capital “R”, followed by three ASCII character digits representing the range in centimeters up to a maximum of 765, followed by a carriage return (ASCII 13). The baud rate is 9600, 8 bits, no parity, with one stop bit. Note: Flow Rate (if available) on your UART Program should be set to None.













You can download this tool from here: Maxbotix - PC based Range Finder

You can of course just use Hyperterminal (PC) or ZTerm (OSX) These can be sourced from the Maxbotix Downloads Section. for convenience.

I prefer to display the graphical output realtime.  If you think about it you can easily isolate different components and test these until you find the primary causes of interference.  It also means for ground testing you can isolate the power supply on the sonar as well to a very clean source.

Watch out for noisy motors (previous post covers this well) and noisy ESC's.  I try to use opto isolated ESC's with no on board bec.  Switching based BEC's can also be noisy too and you can  in fact have noise on the APM from the switching power supply.  From your latest post I see your sonar looks pretty good.  If you plot throttle, you will see how much impact the remaining spikes have.

Another data point is I have noticed more noise in my case after the PWM rate was increased a while back.  You can change this but it was increased to accommodate certain types of ESC's.

The Sonar has frustrated many folk on this forum.  Whilst it can be satisfying eliminating / resolving these issues with the Sonar, I think it is about time we look at another method which does not use the Analog output.  <-- Hint HInt DEV Team :-)

The Sonar has definitive pulse width and serial outputs which do not display the fine grain interference.  The issue in using these is still on the APM processing side.  Also the serial rate is too slow and uses an inverted Vcc.  The latter can be changed fo TTL use but the rate is too slow I fear. A while back we included some notes on using I2C based sonar and to avoid blocking calls with a separate processor.  Maxbotix has some new I2C sonars and one equivalent to the EZ0. 

I am sure there is a better way just around the corner, to handling the Sonar issues than wrapping it up in foam, on gel mounts far away from the frame and shielding everything :-)  

Finally I think there are a few more Sonar choices we could evaluate.  The EZ0 is very sensitive but does not have the best Acoustic Noise Tolerance. for example the MB1200-XL-MaxSonar-EZ0 is calibrated to detect a 0.25” (6.35 mm) diameter pole target at a distance of 3.6 meters, but there is a 11 dB better noise tolerance with the XL Sonar MB1220 (EZ2) This is a reasonable difference and the MB1220 has a  similar range performance with a marginal drop in sensitivity.  I am about to test this sonar (EZ2) and compare it with the EZ0. Someone will no doubt remind me I said this a year ago :-))

Reply to Discussion


© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service