PixHawk3 and echosounder with NMEA output

I am trying to connect an echosounder with NMEA format to PixHawk3 to transmit the data together with GPS data to a PC in the land via Telemetry.

I am using mission planner to control the boat.

  1. I am starting ok to make a bathymetric map.
  2. How do I set things up to get the depth&gps data on the PC in the land. Is mission planner able to view and record the data in real time? If so please let me know how to do it in detail.
  3. Many people use reefmaster for the similar jobs. Does the reefmaster generate the map in realtime on the mission planner?
2 Likes

Kookdae,

I think we would need to add a new driver in ArduPilot to support consuming the data as a range finder.

Although itā€™s very unlikely, itā€™s possible that simply connecting it as a NMEA GPS may work. Our GPS Blending wiki page is here but maybe this would work:

  • connect the echo sounder to one of the Pixhawk3ā€™s serial port 4
  • set SERIAL4_PROTOCOL = 5 (for GPS)
  • set SERIAL4_BAUD to the baud rate of the echo sounderā€™s serial output rate (i.e. 9600 or whatever it is).
  • set GPS_TYPE2 = 5 (for NMEA)
  • set GPS_AUTO_SWITCH = 0 to disable switching between GPSs (because this 2nd one isnā€™t really a GPS)
  • reboot the flight controller

To see if it works open the Mission Plannerā€™s Flight Data screen and go to the ā€œStatusā€ tab on the bottom left, check the ā€œaltasl2ā€, ā€œgpsstatus2ā€, gpshdop2", ā€œsatcount2ā€ to see if any non-zero numbers appear.

Like i said, itā€™s unlikely trying to use it as a GPS will work but you can try.

What echo sounder are you using? I could possibly write a driver if we find a reasonably cheap device that many people would be happy with.

Hi rmackay9,

Thank you for this. I will let you know how it worked.

We are using ultra light echosounders from ECHOLOGGER dot com. These are scientific level devices but so light(200g or less). Output format are versatile, so that simple altitude, NMEA and full backscatter data are available to choose. They have both USB interface and RS232 interface.
Simple altitude and NMEA formats are just ok for mapping and survey, but obviously full backscatter data can give more abundant information along the water columns. Sometimes we need these backscatter data for floating sediments. I am not sure normal telemetry via ardupilot can cope with full backscatter data as the data is big.
Anyway, I think having a driver for ECHOLOGGER devices is a good idea, as these are very suitable for SUV or even for drones. I found the devices are so compact and handy to install on the vehicles, and prices are favorable.

Kookdae,

OK, I think I will ask echologger if they can send me one so I can work on the driver. Which model do you think would be best? I think I should start with the most common one, preferrably with a serial interface and cheaper is better. The ECT400? If you have any contact with them, that might also be helpful 'cuz itā€™s sometimes hard to get the request for free samples to the right person within the company.

ECT400 is a good start, I think.
I would contact a managing director, Dr. Choi (info@echolgger.com) for support. I think they should lend a device for your work because they have been very supportive to me as well.

Kookdae,

Thanks! Actually theyā€™ve just gotten back to me and, as you say, they seem very supportive!

Kookdae,

I got a little carried away and Iā€™ve written a Range Finder driver that should consume NMEA data.

If you want to give it a try, you can do this:

  • download this binary meant for a Pixhawk/Cube and load it onto your vehicle
  • set RNGFND_TYPE = 17
  • set SERIALx_PROTOCOL = 9 (Lidar) Note the ā€œxā€ should be 1,2,3 or 4 depending upon which serial port is connected to the sensor
  • set SERIALx_BAUD = baud rate of the sensor (note x should be 1,2,3 or 4)

No pressure to try this of course. The driver is mostly untested though so I certainly wouldnā€™t try to drive this vehicle around much in the water. Perhaps just load up the firmware and place the vehicle in the water and check if the range finder is working as shown here on the wiki.

Re how to connect the sensor to a pixhawk, this will require a RS232 to TTL converterā€¦

Amazing support Randy !
Adding external NMEA device and inject in telemetry string is very useful in marine environment.

2 Likes

Hi Randy,

Iā€™ve not tried this yet.
Actually I borrowed a boat and pixhawk integrated electronics for autopilot. The boat is working ok with autopilot. Although I am really wanting to try your driver for echosounder data, I am hesitating because the new driver may making the working autopilot unstable. I asked the supplier to provide the original firmware so that I can go back to the original if the new driver causes any problem. But the supplier did not respond.
What do you think?

By the way, are you talking with Echologger ok?

Kookdae,

No problem about not wanting to mess with the firmware thatā€™s on there. Itā€™s completely understandable.
Because itā€™s a loaner, itā€™s probably best not to mess with it too much. Maybe tell the supplier whatā€™s going on 'cuz all this is going to improve their product (assuming itā€™s ArduPilot on there at the moment).

By the way, if you connect with the mission planner you should be able to see what firmware is on there by looking at the top left corner.

Echologger is great! I expect the ECT400 will arrive within the next few days! If all goes well, I expect a working integrated underwater sonar by next week some time.

Iā€™m attempting to connect the ECT400 to the Pixhawk using this RS232-to-Serial converter from Sparkfun. Below is an imageof how I have them wired together but itā€™s not working yet. Iā€™ve got a RS232-to-USB converter coming tomorrow so I will hopefully be able to test that the sensor at least works with my PC.

EDIT: *** old diagram removed to avoid confusion***

2 Likes

I think Iā€™ve got the echosounder working now in bench testing although Iā€™m testing it in a bucket so the distances are never longer than 17cm. Still, Iā€™m pretty sure that itā€™s working so Iā€™m pretty happy about it.

This is the correct wiring diagram when using this Sparkfun RS232-to-Serial converter.

The new NMEA driver is in my branch here and itā€™ll go through the regular code review over the next week or so.

1 Like

the driver is in master now and Iā€™ve created this wiki page detailing the setup using the echologger ECT400. Something similar should work with a Garmin DT800 or other NMEA protocol echosounders.

1 Like

Hi guys,

I have only just come across this thread. I am wanting to do something similar but I am using a SonarMite SM3 sounder that has either Bluetooth or Serial connection. It states that the serial connection supports UART already so unsure if I need the RS232 Sparkfun Adapter? I am hopefully going to give it a play this weekend.
One thing I am interested in is getting the sounding/depth readings from a stored tlog of datalash log? I have done that before with the 3DR Solo to get a GPS tag etc. and it works a treat. Will the sounding be located at a particular point in that file? Will there be a setting somewhere that I tell the unit to log at specified intervals (5 or 10 secs etc.)?? My idea is that I will have RTK Gps connected to the Rover (Boat) and want to ultimately line up the depth reading with the GPS position at particular times. This is a great addition to be able to see that the unit is logging data when its in the water.
Thanks, Scott

Hi Scott,

Iā€™ve had a quick look at the SonarMite SM3 and it looks like it can output NMEA messages so I think if it can be connected to a flight controllerā€™s serial port it will work.

A ā€œDPTHā€ message is stored to the dataflash log and this includes the vehicleā€™s lat and lon so hopefully this can be used to easily gather the required mapping data. Thereā€™s a small issue in that these DPTH messages recorded in this issue but itā€™s a fairly minor issue.

What about using a separate NMEA shield to allow creating a proper backbone and connecting multiple devices?

For the echo sounder, recently I have been using the Airmar UST800 which gives out speed, water temperature and depth data for a quite low price, ~$200.

Rene,

I think connecting multiple devices will work fine. ArduPilot will just ignore all the messages except the ones that it recognises (i.e. depth messages). I toyed with the idea of adding support for reading the speed and temperature but we didnā€™t immediately have a need for it. Now that we have the DPTH logging messages we could potentially add temperature to that.

The water speed would be very useful for sailboats but we donā€™t support those yet ā€¦ itā€™s not far off though actually.

Hi @rmackay9,

I seem to be having some issue with hooking up the SonarMite SM4/BTX to my Pixhawk2.1.
I updated the Pixhawk to the latest firmware. I purchased a RS232 to TTL Converter and wired it up as shown (I even did testing to make sure I had the correct cables from my sounder unit). Once all hooked up, I keep getting bad LiDAR Data in MP. I also notice that my unit isnā€™t logging data. I connected via bluetooth to my sonar unit with my pc and logged data in hyperterminal, which it then works. While this is logging no output goes to the RS232 port (I assume as no changes previously).

I got to a stage where the pixhawk didnt say bad lidar, only bad ahrs (not an issue) but then i switched wires while plugged in and it says bad lidar. Swap again and it goes away. All the while no data logging on the unit.

Not sure if Iā€™ve got a dud RS232 to TTL Converter or whether I would need a RS442 Convertor? I didnā€™t think so, considering the unit can work via the serial cable to a Windows CE Data Collector for survey work).

Seems that the pixhawk isnt sending a ā€˜startā€™ command to the logger to start sending the data? And I assume NMEA 0183 data is all the same? It has 2 lots being DBT and DPT. (It auto reads what data it needs to send). Sort of a bit lost for ideas, Iā€™ve checked all the serial parameters in MP and gone from 2400bps to 115kbps. It is currently plugged into TELEM2 on the pixhawk 2.1 also.

Any ideas would be greatly appreciated.
Thanks, Scott.

Scott,

From a look at the datasheet it doesnā€™t look like it supports the NMEA format. Instead it has a few other formats. So unless Iā€™m making a mistake, i think weā€™d need a new driverā€¦

Thanks for getting back to me @rmackay9. That datasheet isnā€™t for my model. This datasheet is.

The NMEA Strings are as follows:
Format 2 DBT NMEA mode (e.g. $SMDBT,5.94,f,1.81,M,67)
Format 3 DPT NMEA mode (e.g. $SMDPT,1.81,0.0
66)

I tried looking through your driver code on GitHub but I havenā€™t had alot to do with that side of things and got lost.