Help with RS232 to TTL conversion for NMEA0183

skyflyer

Well-Known Member
Joined
26 Jan 2011
Messages
1,433
Location
Worcester, UK
Visit site
I have a project using an Arduino that outputs NMEA0183 sentences through it's serial port. This, if i understand correctly, uses the RS232 protocol whereas NMEA0183 equipment does not and it needs to be converted to what I believe is the TTL protocol.

I have ben advised that the us elf this chip http://www.farnell.com/datasheets/76791.pdf will do the job, but being a complete electronic novice I cannot make head nor tail of that data sheet to work out war I have to wire to which pin etc.

The chip I have been told to get is a MAX232EPE.

Can anyone help or suggest an alternative method?

At the moment the arduino is writing perfect NMEA0183 sentences and sending then down the wire, but the instrumentation is not able to read it and I am assuming that this is the reason - something to do with inverting the signal?

Thanks in anticipation as always!
 
I have a project using an Arduino that outputs NMEA0183 sentences through it's serial port. This, if i understand correctly, uses the RS232 protocol whereas NMEA0183 equipment does not and it needs to be converted to what I believe is the TTL protocol.
Other way round , NMEA is (not really but that's another story..) RS232 and the Arduino works on 5v TTL.

These work...They sort out the levels and do the inverting.

http://www.ebay.co.uk/itm/RS232-To-...660163?hash=item339fc28f83:g:lAEAAOxymnFSC-l0

This I know as I've only just a moment ago connected pin 3 (TX) of a nasa AIS engine to pin 3 of a converter, in turn the RX pin on the TTL side of the converter to RX1 of an Arduino Mega. Serial1 on the mega is set to 38400 baud & serial (the usb) to 9600. Then a tiny bit of code to echo serial1 through serial and opencpn is seeing the AIS data.

So the converters work fine, and a Mega should be OK to act as a NMEA multiplexer.

When you say "Arduino that outputs NMEA0183 sentences through it's serial port.", where actual pins are you using?

Good luck & enjoy :)
 
I have a project using an Arduino that outputs NMEA0183 sentences through it's serial port. This, if i understand correctly, uses the RS232 protocol whereas NMEA0183 equipment does not and it needs to be converted to what I believe is the TTL protocol.

I have ben advised that the us elf this chip http://www.farnell.com/datasheets/76791.pdf will do the job, but being a complete electronic novice I cannot make head nor tail of that data sheet to work out war I have to wire to which pin etc.

The chip I have been told to get is a MAX232EPE.

Can anyone help or suggest an alternative method?

At the moment the arduino is writing perfect NMEA0183 sentences and sending then down the wire, but the instrumentation is not able to read it and I am assuming that this is the reason - something to do with inverting the signal?

Thanks in anticipation as always!

They both use the same protocol, it's the hardware layer that differs. Most specifically the voltage levels that define marks and spaces. The arduino is putting out serial data at ttl levels if it's a 5v arduino or at 3v level on some other arduino boards. RS 232 uses plus and minus 12v rails but tolerances are high enough that you'll see all sorts of signals varying down to as low as +- 5v. NMEA 0180/0182/0183 is actually a current driven bus. 0180and 0182 specify that the driver can be RS232 but 0183 specifies that the driver should be EIA-422 compatible. HOWEVER driving an nmea device with a rs 232 driver like the max 232 chip works 99 times out of 100.

You could just invert the signal with a transistor and chances are it'll probably work.

Easier still is to use a differential bus chip like a 75176 EIA-422 driver with it wired to permanent Tx.

The advantages of the interface chips is that they deliver a modicum of resilience to dirty signal environments, earthloops and unbalanced power supplies that invariably exist in the field.
 
Last edited:
I'm using a Due which has multiple RX/TX pins, and am using one of those;(using Serial1.print command) The data to the serial monitor comes via the USB connection.(using Serial.println command)

Thanks for the link. Cheers!
 
As GHA says, buying a ready made TTL-RS323 converter is possibly your most convenient option. If you do want to wire up a max232 you'll additionally need 5x 1uf capacitors. There's plenty of descriptions to google on how to wire these up (straight forward enough even for me) although I note that a few of the top hits seem to ignore the apparently-not-strictly-necessary bypass capacitor between vcc and ground. Google "max3232 pi" and you'll get equally useful descriptions of doing the same thing with a raspberry pi where the task is the same but using the 3.3v version of the max232.

...but listen to anyone who actually knows something about electronics before me :-)
 
I'm using a Due which has multiple RX/TX pins, and am using one of those;(using Serial1.print command) The data to the serial monitor comes via the USB connection.(using Serial.println command)

Thanks for the link. Cheers!

The Due is 3.3v isn't it? Should be OK using the max232epe chip powered at 3.3v, maybe someone who knows the chip better could confirm...
 
The Due is 3.3v isn't it? Should be OK using the max232epe chip powered at 3.3v, maybe someone who knows the chip better could confirm...

Aren't the 232 series 5v and the 3232s 3.3v? Not that I know anything, especially not my uno from my due from my tre from my quattro (except that Noel Edmunds used to drive the latter)
 
I'm missing something here - the 'flow' is from Due to Maxchip to boat instrumentation. Due outputs 3.3v so presumably even if the voltage pump does its job then the voltage to instrumentation is 5v which is fine? There is no 'flow' from chip to Due so 3.3v limitation on Due doesn't matter?
 
I'm missing something here - the 'flow' is from Due to Maxchip to boat instrumentation. Due outputs 3.3v so presumably even if the voltage pump does its job then the voltage to instrumentation is 5v which is fine? There is no 'flow' from chip to Due so 3.3v limitation on Due doesn't matter?

Your probably right, the TTL side between the MAx chip and the Arduino sits high when nothing is happening, but as you're only sending out of an arduino TX pin it shouldn't really matter. As long as you don't forget and want to receive as well....

But even then it looks like the MAX232ipe chip should be OK if powered by an Arduino 3.3v source.

I just metered one, running on 5v the MAX RX will sit about 4.82v, if powered by 3.3v the it sits at 3.32v. So all *should* be well anyway.

Scope shots of the output below, 5v power on the left, 3.3v on the right. . Also, an arduino mega seemed happy enough to receive at 3.3v

IMAGE009_zps1vydzfsd.png
IMAGE008_zpsmmlbzedp.png
 
supplementary question - will an opto-isolator do the same job. It inverts the signal (which I need to do) and i can (within limits) use whatever voltage I want to on the output side, so i can go from (say) a signal that varies between +3V (logic 0) and 0v (logic 1) to one that varies between +5v (logic 1) and 0v (logic0) etc?
 
supplementary question - will an opto-isolator do the same job. It inverts the signal (which I need to do) and i can (within limits) use whatever voltage I want to on the output side, so i can go from (say) a signal that varies between +3V (logic 0) and 0v (logic 1) to one that varies between +5v (logic 1) and 0v (logic0) etc?

you mean a standalone opto-isolator chip right?
Cause the ones I bought (admittedly small boards with pinouts) had some leds on them to invert again to what it was pumped into them...

Sorry cannot really answer the main Q although I doubt it will work, didn't you succeed in NMEA0183 testing already, or you never bought the TTL-232 converter?

cheers

V.
 
0180and 0182 specify that the driver can be RS232 but 0183 specifies that the driver should be EIA-422 compatible. HOWEVER driving an nmea device with a rs 232 driver like the max 232 chip works 99 times out of 100.
Easier still is to use a differential bus chip like a 75176 EIA-422 driver with it wired to permanent Tx.

NMEA0183 started off in its early versions as single ended talker similar to RS232. It changed somewhere about version 2 or 3 to differential similar to RS422. However, a proper NMEA0183 listener circuit as specified in the standard will accept either. The standard still says that a listener must accept a RS232 like input.
 
Top