system
April 12, 2012, 5:55pm
1
Hello,
I am connecting a Garmin Depth Sounder NMEA 0813 to an Arduino Uno and attempting to get the NMEA data to show on the serial output screen.
I tried following some of the many GPS examples out there(since it too is NMEA)
but to no avail, i have been unsuccessful
This is just one of the many codes that I have attempted at getting the NMEA data
#include <SoftwareSerial.h>
SoftwareSerial depthSerial(9,4); //pin 9 is the pin in which the depth sensor is connected
void setup()
{
Serial.begin(9600);
Serial.println("Depth");
depthSerial.begin(4800);
}
void loop()
{
if(Serial.available() > 0) {
Serial.write(depth.read());
}
}
Shouldn't you be checking the depth serial port for availability:
if(depth.available() > 0) {
Serial.write(depth.read());
system
April 12, 2012, 6:10pm
3
Ah I see where I went wrong,
so it should be as follows?
void loop()
{
if(depthSerial.available() > 0) {
Serial.write(depthSerial.read());
}
}
Looks like - does it work?
system
April 12, 2012, 6:26pm
5
Well I am awaiting my partners to come with the equipment.
I am just inquiring on a variety of tips that can be used.
Parsing the data is not a problem, its just getting it that was.
Thanks alot for pointing that out. Really helped me out.
system
April 12, 2012, 7:58pm
6
unforunately it did not work
im getting some strange characters
dont think its ascii
system
April 12, 2012, 8:02pm
7
Is the device outputting RS232, and if so, how are you doing the inversion and level conversion?
system
April 12, 2012, 8:10pm
8
well I cant honestly say for sure, I am relatively new to arduino
im getting output that looks like this now
218
89
108
109
118
150
173
125
187
149
235
0
shouldnt getting NMEA values for a depth sensor be similar to GPS?
system
April 12, 2012, 8:13pm
9
I cant honestly say for sure, I am
Suggest you find out before you damage something.
system
April 12, 2012, 8:31pm
10
Well we just ran it through an oscilloscope and we are only values of -1 or 3 volts.
The depth sensor in question is a Garmin Intelliducer Thru Hull NMEA 0183.
We were able to get the GPS information earlier. but thats because of the many guides online.
Unfortunately the Depth sounder is not working in our favor.
We are powering it using a DC power supply.
The only pins connecting to the arduino is the ground and the signal pin
system
April 12, 2012, 8:35pm
11
Well we just ran it through an oscilloscope and we are only values of -1 or 3 volts.
Was that with or without a load on the line?
system
April 12, 2012, 8:42pm
13
What does the documentation say the interface standard is?
system
April 12, 2012, 8:47pm
14
all the documentation says is to connect to an nmea 0183 compliant device it does not go into further details.
system
April 12, 2012, 8:49pm
15
And is your Arduino an NMEA 0183 device?
system
April 12, 2012, 8:52pm
16
we found a source that says the sounder communicates using EIA RS-422.
system
April 12, 2012, 9:01pm
17
So, how are you handling the differential signaling?
system
April 12, 2012, 9:10pm
18
we are using the positive signal as a single ended with reference to the ground.
system
April 12, 2012, 9:11pm
19
So how are you getting -1 volts?
Have you tried the invert option on the software serial object?
system
April 12, 2012, 9:23pm
20
So inverting the signal worked perfectly. You sir, are a genius.
This is our current output which is what we were looking for. We will begin taking out some chunks of code just to get the SDDBT section.
Thanks for all the help. Really, thanks.
read: $SDMTW,24.0,C*02
read:
$SDDBT,1.5,f,0.4,M,0.2,F*04
read:
$SDDPT,0.4,*7D
read:
$SDMTW,24.0,C*02
read:
$SDDBT,1.5,f,0.4,M,0.2,F*04
read:
$SDDPT,,*57
read:
$SDMTW,24.0,C*02
read:
$SDDBT,,f,,M,,F*28