Sonar for Navio+?

Hello,

I am currently using Navio+ with Reach (connected through UART) in an octocopter and I want to add a sonar. I read in the forum that there could be some problems regarding the I2C speed (in case the sonar is connected through I2C) but I still have several doubts.

Any help, suggestion or experience using sonar with Navio+ would be really appreciated.

Thank you! :slight_smile:

Hello there!

The easiest solution might be using an analog one. This should work straight out of the box

This is not supported ATM.

Hello!

Thank you for the answer :slight_smile:

In http://ardupilot.org/copter/docs/sonar.html it says that [HRLV-EZ4] (http://www.maxbotix.com/Ultrasonic_Sensors/MB1043.htm) is also supported in ArduCopter 3.1 Does it work in newer versions (ArduCopter 3.4-rc5 for instance)?

How can I know if a specific sensor is supported (rather than bothering you again)? It is enough it has analog output just like the [XL-EZ4] (http://www.maxbotix.com/Ultrasonic_Sensors/MB1240.htm) you suggested?

Please, anyone could help?

Thank you in advance!

A bunch of hardware is not supported natively, try to make a search on that particular item and see if anybody had any luck with it.

Corrado

Hi,

Analog ones should work fine.

staroselskiy answered it before

maxbotix, for example, describes their sensors quite precisely:
for example:
the HRLV-MaxSonar-EZ series has three outputs: analog, pulse width and ttl (or rs232) – that means you have an analog voltage output (yes!!!) and you can pick a sensor with the beam pattern that suits your needs: wide or narrow (usually u get better results with a narrow beam, but if you have a very large copter maybe a wide beam suits better!)
XL-MaxSonar-EZ Series the data sheet shows the following for pin 3:

Pin 3-AN– For the 7.6 meter sensors (all sensors except for MB1260, MB1261, MB1360, and MB1361), this pin outputs
analog voltage with a scaling factor of (Vcc/1024) per cm. A supply of 5V yields ~4.9mV/cm., and 3.3V yields ~3.2mV/
cm. Hardware limits the maximum reported range on this output to ~700cm at 5V and ~600cm at 3.3V. The output is
buffered and corresponds to the most recent range data.
For the 10 meter sensors (MB1260, MB1261, MB1360, MB1361), this pin outputs analog voltage with a scaling factor of
(Vcc/1024) per 2 cm. A supply of 5V yields ~4.9mV/2cm., and 3.3V yields ~3.2mV/2cm. The output is buffered and
corresponds to the most recent range data

so yeah! - analog voltage - that should work!
give it a try and report back (it will very likely work out of the box!)
so if you get an analog voltage scaling, your sensor will work ( as staroselskiy already said) - but I don’t think (actually don’t know) if the usb sensors work - so stick to the ones without the usb plug and check data sheet for analog output!

Thank you very much!

I asked the question because I was not sure if there was something else to take into account rather than just having analog output. I will buy the HRLV-EZ4 and I will report back the results (hopefully good!)

Thank you again :slight_smile:

Hi again!

I tried HRLV-MaxSonar-EZ4 (MB1043) and XL-MaxSonar-EZ4 (MB1240) with Raspberry Pi 2 B and Navio+ and they worked perfectly. If someone else wants to use them, you just have to follow the instructions (setting RNGFND_TYPE = 1 and proper values for RNGFND_MAX_CM, RNGFND_MIN_CM, RNGFND_SCALING, RNGFND_PIN = 4 or 5).

Does someone know how to take the sonar range or sonar voltage out of ArduCopter? I could not find any mavlink message that I could read with these values (it seems that the altitude message is not used in ArduCopter).

Thank you again!