NMEA Depth Sensor Help?
Matt LeBlanc
Posts: 9
Hi all,
There are a few of us at my school currently attempting to make a summer project - a boat which will navigate down a canal on its own, using a depth sensor to keep it in the middle (deepest) part of the channel. We're having an incredibly difficult time getting any kind of sensible output from the depth sensor itself; however, so hopefully someone will be able to help us out with that...
This is what we know so far: the device is a garmin intelliducer nmea0183 depth sensor, and we're using an OWL datalogger which runs on a BS2pe. Apparently, the sensor should output some sort of string along the lines of this:
$SDDBT,x.x,f,x.x,M
We're using a SERIN command on the stamp to get this data in, but unfortunately all that we're able to get is the same repeating string of nonsensical numbers. We've tried using a WAIT("DBT,") command, but every time we put that in the program never collects anything. Right now, we've been using the SPSTR command to read the entire string to scratchpad RAM, but when we print that out to debug we still get the same sequence of repeating numbers, which as far as we can tell doesn't correspond to the above in any straightforward (hex, ascii codes, etc) fashion. The numbers don't even change if we move the depth sensor!
Any help you can give us would be greatly appriciated, no one here is a real stamp wizard but we've used it for a couple of small projects in the past. Thanks again!
There are a few of us at my school currently attempting to make a summer project - a boat which will navigate down a canal on its own, using a depth sensor to keep it in the middle (deepest) part of the channel. We're having an incredibly difficult time getting any kind of sensible output from the depth sensor itself; however, so hopefully someone will be able to help us out with that...
This is what we know so far: the device is a garmin intelliducer nmea0183 depth sensor, and we're using an OWL datalogger which runs on a BS2pe. Apparently, the sensor should output some sort of string along the lines of this:
$SDDBT,x.x,f,x.x,M
We're using a SERIN command on the stamp to get this data in, but unfortunately all that we're able to get is the same repeating string of nonsensical numbers. We've tried using a WAIT("DBT,") command, but every time we put that in the program never collects anything. Right now, we've been using the SPSTR command to read the entire string to scratchpad RAM, but when we print that out to debug we still get the same sequence of repeating numbers, which as far as we can tell doesn't correspond to the above in any straightforward (hex, ascii codes, etc) fashion. The numbers don't even change if we move the depth sensor!
Any help you can give us would be greatly appriciated, no one here is a real stamp wizard but we've used it for a couple of small projects in the past. Thanks again!
Comments
-Phil
Polarity?
To make sure the Garmin is putting out something useful, feed the serial line into a PC running Hyperterminal, or even open a DEBUG screen and watch the data. This will confirm your baudrate, etc.
A minor point, the transducer may not give you a good number if the face of the transducer is not immersed in the water.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
2531452092411761452092162162521452412412452081771532551452092411761452092162162521452410
2092411761452092162162521452412412452081771532551452092411761452092162162521452412412450
2092411761452092162162521452412412452081771532551452092411761452092162162521452412412450
What other things should we be using in the serin command? Right now it's just SERIN rx_a, baud,[noparse][[/noparse]SPSTR 30]. This is all we've read to do so far...
Thank you for the prompt replies. We're hoping it's just something minor we've missed.
I see from a glance at the manual that there are two versions of this device, the NMEA 0183 and NMEA 2000. You have the NMEA 0183 version, right? Does this sensor transmit repeatedly at a fixed interval? If these are meant to be part of a network, the network master needs some means to coordinate access. The NMEA 2000 standard is considerably more sophisticated, multiple master, carrier detect, collision avoidance. In NMEA 0183 I think networking is more of a hack, ascii command to individually addressed devices, or via a universal command and time slots assigned to individual devices.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
And yes, we're using the 0183.
The suggestion to feed the data directly from the depth sensor into a PC program like hyperterminal is a good one. Just to see what is going on. Use the tx- signal to pin 2 of a DB9 into the PC.
I don't see anything in the manual I downloaded from Garmin about the nmea sentence format. Did you find this documented somewhere?
$SDDBT,x.x,f,x.x,M
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
good luck
Chet
-Phil
Phil - whenever we use a WAIT command, or a DEC modifier, or both, nothing ever happens. The only time we can even get the nonsense is by using neither.
Can you post the simple program you are using? How about the hardare? Which wires are connected to the OWL2pe?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Please show us the exact SERIN statement you used that includes both the WAIT and DEC modifiers, along with the DEBUG statement that produced those numbers.
-Phil
This is a picture of the oscilloscope while that's going:
This is a picture of the oscilloscope with the same program working, but with the redwhite wire connected instead of the gray one:
For Phil, now, these are some of the SERIN commands we've tried which haven't given us anything...
Post Edited (Matt LeBlanc) : 5/21/2009 12:55:38 PM GMT
· The baud value is NOT 4800 for 4800 baud.
· For the BS2pe it needs to be either 188 (for TRUE) or 16572 (for INVERTED).
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...
·
That's giving us our output... thanks so much!
One thing we're all wondering... why is it 188 instead of 4800? 4800 is the only number we could find in the manual.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com