anchor chain counter to NMEA0183 Garmin proprietary sentences via arduino?

skyflyer

Active member
Joined
26 Jan 2011
Messages
1,433
Location
Worcester, UK
Visit site
Software serial allows you to invert the signal logic, which cannot be done with hardware serial ports - you would need a separate inverter.

NMEA0183 requires the signal from an Arduino to be inverted in order to read it

Sketch i use to get GPS data to plotter via Arduino, includes following lines (not the whole sketch, which would confuse, just the relevant lines)

SoftwareSerial mySerial(10, 9, 1);// Rx, TX, mySerial is now name of the soft serial port, effectively - the final 1 inverts the signal

mySerial.begin(38400); // set data rate for SoftwareSerial

mySerial.println(GPGGAString); /sends the string GPGGAString down pin 9

Does this help?
 

vas

Well-known member
Joined
21 Jun 2011
Messages
8,084
Location
Volos-Athens
Visit site
didn't have enough time to test, but had no luck

I think since I do own this expensive TTL->RS232 converter (was a euro or something...) let's try to keep it simple. I am right in thinking that I could achieve the same result without this converter if I use the softwareserial lib with the right parameter to invert the output, correct?

So forget the software serial, just using the inbuilt stuff, I have the following:

Uno wired properly to this TTL->RS232 thing.
serial port of the thing goes to GMI10 NMEA0183 cable and I think I got the pins right:
  • Serial port Pin 2 goes to NMEA RX (input)
  • Serial port Pin 3 goes to NMEA TX (out)
  • Serial port Pin 5 goes to ground.


Just to be safe, I've also tried with 2 and 3 reversed :D same result

Using pin 0 and 1 on the Uno for RX and TX respectively.
Also tried pin 11 (and declared it on the setup() ) and even pin 13 for TX

All attempts are unsuccessful.
Yes, if I'm using pin 0 1 then the serial monitor rightly shows the line sent every 2 or 1 sec (2000 or 1000 delay used in the sketch)

minimal code that should work is:

void setup() {
Serial.begin(4800);
}

void loop() {
Serial.print("$SDDBS,2348.56,f,715.78,M,391.43,F*4;
delay(1000);
}

Need to setup a way of testing the output of the TTL thingy. Got to wire it on the terminal of another computer preferably and see what's going on. Any other ideas I could try?

cheers

V.
 

skyflyer

Active member
Joined
26 Jan 2011
Messages
1,433
Location
Worcester, UK
Visit site
does this help?
arduino_rs232.png
 

vas

Well-known member
Joined
21 Jun 2011
Messages
8,084
Location
Volos-Athens
Visit site
does this help?
arduino_rs232.png

:D
that's the exact image I had printed on my desk when I was soldering them together. So yes, it should help, but it doesn't.

Just checked which sentences the GMI understands, and they are only:
BOD, BWC, DBT, DPT, GGA, GLL, GSA, GSV, HDG, HDM, MDA, MTW, MWD, MWV, RMB, RMC, VHW, WPL and XTE.
Surpisingly the half a dozen sentences I've tried are NOT among them!
Nice.

So, tried three definitely supported ones (one at a time and all three together):

Serial.println("$SDDBT,6.56,f,2.00,M,1.09,F*39"); //should be supported by GMI10
delay(1000);
Serial.println("$SDDPT,2.00,0.80,*71");
delay(1000);
Serial.println("$GPGSV,4,1,13,02,02,213,,03,-3,000,,11,00,121,,14,13,172,05*67"); //also supported by GMI10

and I still get nothing. GPS skyview gets nothing at all, so does various depth screens I've tried. It's fairly conclusive that my GMI doesn't get the data that the arduino is supposedly sending.
One last issue I need to investigate is how often are NMEA sentences running in the bus, is the one or two seconds delay too much or too little? Will the device report a sentence even if it's only broadcasted once?

Next step is debugging, as I do have somewhere a Digital Yacht USB-NMEA serial adaptor, once I find it I'll try with that first to establish connection and transmission.
Only thing is finding the damn cable!
Will keep you posted.

cheers

V.
 
Last edited:

GHA

Well-known member
Joined
26 Jun 2013
Messages
12,517
Location
Hopefully somewhere warm
Visit site
Well, that works fine here. Arduino uno with digital pin 1 (TX) attached to the TX pin on the rs232/TTL converter, in turn going through a serial/usb converter (ended up as com9) and just using OpenCPN as a monitor to view the data coming in.
Half second delay between each sentence being sent.

NMEA_TEST_ARDUINO_zpsuj6yxkhw.jpg
 

vas

Well-known member
Joined
21 Jun 2011
Messages
8,084
Location
Volos-Athens
Visit site
Well, that works fine here. Arduino uno with digital pin 1 (TX) attached to the TX pin on the rs232/TTL converter, in turn going through a serial/usb converter (ended up as com9) and just using OpenCPN as a monitor to view the data coming in.
Half second delay between each sentence being sent.

nice to know!

however Arduino uno digital pin 1 (TX) is attached to TX pin on the rs232-TTL or the RX pin????
i thought the logic is that i-o is relative to each component board, no?
anyway, hooked them up the other way round and still the same.

still not much progress unless I get another female 9pin serial to test the routing from the rs232-TTL to the usb serial I have lying around.

cheers

V.
 

GHA

Well-known member
Joined
26 Jun 2013
Messages
12,517
Location
Hopefully somewhere warm
Visit site

vas

Well-known member
Joined
21 Jun 2011
Messages
8,084
Location
Volos-Athens
Visit site
Just had a quick glance at the manual - are you wiring the neg (bottom left) to green and the rs232 TX pin ( top left) to brown?


http://static.garmin.com/pumac/GMI10_InstallationInstructions-S_N19wxxxxxx.pdf

nope!
:D
I was wiring them completely wrong as although I had the GMI10 manual printed (for other reasons) I used another pinout doc which was horribly wrong :(

wired them right, depth works straight away!
off to celebrate the new year thing, so happy that it works and is wired right now.

cheers

V.
 

GHA

Well-known member
Joined
26 Jun 2013
Messages
12,517
Location
Hopefully somewhere warm
Visit site
nope!
:D
I was wiring them completely wrong as although I had the GMI10 manual printed (for other reasons) I used another pinout doc which was horribly wrong :(

wired them right, depth works straight away!
off to celebrate the new year thing, so happy that it works and is wired right now.

cheers

V.
YAY!!!
 

vas

Well-known member
Joined
21 Jun 2011
Messages
8,084
Location
Volos-Athens
Visit site
short update...

got the following sentences supported by the GMI10 (and guess 20 as well)

BOD BWC DBT DPT GGA GLL GSA GSV HDG HDM -HDT- MDA MTW MWD MWV RMB RMC -THS- VHW -VMG- WPL XTE

Out of which I've managed to pass data to most of them
depth: SDDBT, SDDPT
heading: HCHDG, HCHDM, HCHDT
temp: IIMTW
wind IIMWV, IIVHW

Had serious problems getting GPS sentences to work. Mind, some record data that are not presentable on the GMI, but eventually got there...

Observations:

if I have the RX pin 0 connected to the TTL->RS232 thingy connected I cannot upload ANYFCKINGTHING on the uno. Spend a couple of frustrating hours last night trying to figure that. By 3AM I pulled the pin out of the RX and magically everything worked! Anyone care to explain why???

don't run the TTL->RS232 board at 5V it heats up and stops working, changed back to 3.3V and all's fine

Too knackered to work on the AutoAnchor output sentences:
PAAN,STAT
PAAN,VERSION
PAAN,CONFIG

will try tomorrow.

cheers

V.
 

vas

Well-known member
Joined
21 Jun 2011
Messages
8,084
Location
Volos-Athens
Visit site
Tiny gps++ now supports custom sentences, makes it easy to read anything, format it and send on.

thanks, had come across the non Plus version at some point in the past, but missed this one. Downloaded and will test tomorrow

ah, btw, managed to get the PAAN.* sentences to work (mostly) so now GMI setup comes up with AutoAnchor under the NMEA0183 setup page, some info are parsed properly, was able to configure a screen with rode deployed and windlass speed (don't know how it's calculated, hope it's by rotations and circumference and not a set value I gave on the config file...) but still haven't managed to parse the value for the rode deployed.
Slowly getting there!

cheers

V.
 

Beyondhelp

Member
Joined
1 May 2011
Messages
719
Location
Surrey
www.aboardmyboat.com
if I have the RX pin 0 connected to the TTL->RS232 thingy connected I cannot upload ANYFCKINGTHING on the uno. Spend a couple of frustrating hours last night trying to figure that. By 3AM I pulled the pin out of the RX and magically everything worked! Anyone care to explain why???

Yes, the UNO is programmed by its serial interface. You cannot have to devices attached to one serial bus. You could perhaps try an ICSP programmer (google) instead.
 

vas

Well-known member
Joined
21 Jun 2011
Messages
8,084
Location
Volos-Athens
Visit site
Yes, the UNO is programmed by its serial interface. You cannot have to devices attached to one serial bus. You could perhaps try an ICSP programmer (google) instead.

Doh, of course!
Since I'm not going to be using it for anything else, I can live with that for the time being. Else I guess I could also get a MEGA that has 4 I/O iirc.

Happy to report that everything works on the Arduino -> NMEA0183 -> GMI10/20 front.
Page configured, data sent, page displays them:

NMEA_AA_1.jpg


NMEA_AA_2.jpg


data are bogus of course so now the next part needs to be done:

  • setup the hall sensor working (and sort out what happens if it gypsy rests smack in the front of the sensor, or in the edgy distance that flickers - not even sure it does...)
  • intercept current to up or down solenoid so that program knows if it should subtract or add length...

The reason it didn't work yesterday was that the PAAN,STAT sentence that does all the work is actually PAAN,AASTAT, :eek:

cheers

V.
 

vas

Well-known member
Joined
21 Jun 2011
Messages
8,084
Location
Volos-Athens
Visit site
Sweet, this forum is proving to be a hotbed of anorakky Arduino enthusiasts :)

:D
not even an Arduino noob down here... After all it's my first ever Arduino project.

however an extra hour got my reed switch working counting rotations of the gypsy by moving a magnet in front of it and the GMI display updates the values. Well impressed with myself! Now thinking how to establish a method to get a realtime windlass speed (since I've got it displayed it might as well be helpful/real)

Also realised that resetting the rode deployed value is done from the GMI obviously by sending the appropriate sentence to the AutoAnchor 601 thingy which the arduino is simulating, so I have to get into the READING of NMEA sentences as well, that'll be fun or shift everything on tiny gps++ once all testing is over.

btw, SS, since I see you bought a largish screen for your Uno, care to point which one it was and whether it actually works OK?
I'm after a 2.8in or so touch screen for possibly another project but since they seem to be all from China and take over a month to arrive, I want to order now. Not planning to have serious graphics on it, mainly a few values and maybe a couple of images for buttons or such.

cheers

V.
 
Last edited:

vas

Well-known member
Joined
21 Jun 2011
Messages
8,084
Location
Volos-Athens
Visit site
quick question as I think I'm stuck!

I have a couple of these optoisolators http://www.ebay.co.uk/itm/371296480644?_trksid=p2057872.m2749.l2649&ssPageName=STRK:MEBIDX:IT

However, it seems I've got them the wrong way around, as I only want to "purify" the signal I get from the 24V triggers to the UP or DOWN solenoid on the windlass.
So, I want the 24V occurring to either UP or DOWN to wake and send the right signal to the arduino, and NOT to operate via the digital pinouts of the arduino the higher current sent to the windlass solenoid.
So only passive triggering to the arduino so that I know when the reed switch counting if I should be ADDING or REMOVING chain deployed!

Can I do it with what I have? It looks like I got the wrong piece of kit. At least it didn't break the bank at 1.5euro...

Is it simply a case of connecting a resistor or something to "drop" the current or are there other types of isolators I could use?

cheers

V.

Edit to say that maybe this is what I want:

http://www.ebay.co.uk/itm/5-12-24V-...965771?hash=item3d03ee7b0b:g:eLwAAOSwKIpV~9We

am I right?
 
Last edited:

GHA

Well-known member
Joined
26 Jun 2013
Messages
12,517
Location
Hopefully somewhere warm
Visit site
quick question as I think I'm stuck!

I have a couple of these optoisolators http://www.ebay.co.uk/itm/371296480644?_trksid=p2057872.m2749.l2649&ssPageName=STRK:MEBIDX:IT

However, it seems I've got them the wrong way around, as I only want to "purify" the signal I get from the 24V triggers to the UP or DOWN solenoid on the windlass.
So, I want the 24V occurring to either UP or DOWN to wake and send the right signal to the arduino, and NOT to operate via the digital pinouts of the arduino the higher current sent to the windlass solenoid.
So only passive triggering to the arduino so that I know when the reed switch counting if I should be ADDING or REMOVING chain deployed!

Can I do it with what I have? It looks like I got the wrong piece of kit. At least it didn't break the bank at 1.5euro...

Is it simply a case of connecting a resistor or something to "drop" the current or are there other types of isolators I could use?

cheers

V.

Edit to say that maybe this is what I want:

http://www.ebay.co.uk/itm/5-12-24V-...965771?hash=item3d03ee7b0b:g:eLwAAOSwKIpV~9We

am I right?

I think your right on both counts, first one is wrong, second one, though way over the top, should work. 5v into one side of the output, the other into a pin set as an input.
Ebays great :)
 
Top