Help with RS232 to TTL conversion for NMEA0183

1) Any old cheapy 100nF electrolytlic capacitor ...

3) Yes, or a single bi-directional TIA232 channel with the hardware flow control lines (RTS, CTS) used as well. You don't need those, so you have 2 channels available.

Why not ceramic?

I confess to being a bit confused by the diagram. Surely there is one output, with two legs; one from each pin? And do the inputs for these (T1IN, T2IN) have to be driven in antiphase?
 
Why not ceramic?

Ceramic capacitors are more prevalent in smaller capacitance than 100nF. You can get them, but they are unusual and therefore more expensive. Also the tolerance of ceramics is often huge: +80% not being unusual.

I confess to being a bit confused by the diagram. Surely there is one output, with two legs; one from each pin? And do the inputs for these (T1IN, T2IN) have to be driven in antiphase?

The device is designed for a bi-directional hardware flow control comms link, so the connections would be...
Processor to MAX3232
TxD to T1IN
RTS to T2IN
RxD to R1OUT
CTS to R2OUT

However, if hardware flow control is not used then 2 bi-directional channels can be used.
 
Sorry to disagree, but ...

0.1uF search on CPC
Aluminium Electrolytic - Leaded (5) all ± 20%, from 5p each
Aluminium Electrolytic - SMD (1)
Ceramic Disc & Plate (1)
Ceramic Multilayer MLCC Capacitors- Leaded (8) most ± 10%, from 5p each
Ceramic Multilayer MLCC Capacitors- SMD (49) one of these would be my choice, from 0.5p each

So the MAX3232 doesn't give a balanced output?
 
Last edited:
-----Might be just as cheap and a lot less messing about to get premade ones off ebay..

http://www.ebay.co.uk/sch/i.html?_f...0.H0.TRS0&_nkw=Max3232+5V/3.3V+RS232&_sacat=0

I've got two of these already and its a lot MORE messing about! (I've fried one already!)

Two problems with them:

Although they use the 3232 chip it only utilises one of the two pairs of channels - a bit wasteful!

They are also a pain to install! The +/- contacts (only) have holes drilled so threading and soldering those wires is easy enough. However the signal contacts are just pads. So making a decent physical connection that won't break off and finding somewhere to mount the tiny board (no mounting holes) isn't easy!

The stand alone chip with pins will fit boards with standard holes, is easy to connect to, and one chip will do all my work - 2 RS232 channels (NMEA0183 GPS and Depth) to convert to TTL and one multiplexed TTL to go back the other way to RS232 to feed my plotter.

Thanks to others above for answering my questions, also!
 
Last edited:
No. It's a TIA232 spec driver. Way back in the thread the OP said he wanted a single ended comms link.

I may have done, indeed, but now that I have abandoned the opto-isolators and looked at this chip instead, I am hoping the one chip will do all i need, as per above post

GPS feed (NMEA0183) to be inverted and made TTL for 3.3v Due
Depth feed (NMEA0183) to be inverted and made TTL for 3.3v Due
Multiplexed signal on Due as TTL to be inverted and made RS232 to feed plotter

(Due also produced N2K for a/pilot but thats as separate issue to this one!)

I'm assuming that if you power the 3232 with 3,3v then you get a TTL signal limited to 3.3v? If not then i guess I must add a voltage divider?
 
Have a look at Absolute Maximum Ratings on page 2 here...

https://datasheets.maximintegrated.com/en/ds/MAX3222-MAX3241.pdf

I can't cut and paste the table easily as the format goes haywire.

Not sure that helps - i want to know what it will output if i power it with 3.3v, not the maximum it can output if powered with a higher voltage.

My question is akin to asking, "how fast will the car go with the throttle half open", not "what is the absolute top speed of the car"
 
Not sure that helps - i want to know what it will output if i power it with 3.3v, not the maximum it can output if powered with a higher voltage.

My question is akin to asking, "how fast will the car go with the throttle half open", not "what is the absolute top speed of the car"
Is that it? 0.1v under what you power it with?

amvMesG.png
 
Not sure that helps - i want to know what it will output if i power it with 3.3v, not the maximum it can output if powered with a higher voltage.

The voltage output levels of the logic pins, i.e. the ones you connect to your processor, are specified in the Electrical Characteristics table in the row labelled 'Output Voltage High' as Vcc-0.6 to Vcc-0.1. Vcc is the supply voltage to the MAX3232 chip. So the logic high voltage level is just a bit below the voltage you power the chip at.
 
I worked out a way of doing this from outside the tank, using capacitive sensors. Initial experiments promising.

Nigel, that was rather laconic, any more info on that? Is it a 3 sensor thing so you know it's empty half or full or something more elaborate?

cheers

V.
 
Skyflyer,

I think you did mention using tinygps to extract data from NMEA0183 sentences, right? tinygps doesn't seem to support wind though...
I also see you discussed that with Timo, but I don't seem to be able to find the right code to read MWV sentences, not sure he's imported it into his 0183 project yet.
Trying to integrate my NASA wind NMEA0183 instrument to the Due.
Timo's work is invaluable indeed, but unless I do string searches and recreate the basic values out of the $WIMWV sentence I don't see any other way.

cheers

V.
 
Its TinyGPS++ you need , the new improved version of Tiny GPS!

http://arduiniana.org/libraries/tinygpsplus/

The interesting bit being:-

With TinyGPS++ it is now possible to extract just the “L” in the third field (it means “steer Left!”). It’s easy with the new TinyGPSCustom watcher object:

TinyGPSCustom steerDirection(gps, "GPRMB", 3);
...
Serial.print(steerDirection.value()); // prints "L" or "R"

so presumably you could modify that to read a different input line (for wind rather than GPS data) and then something like

TinyGPSCustom windSpeed(gps, "WIWMV", 3);
will set the variable windSpeed to the the windspeed value

Having said that my code had already been written before we discovered TinyGPS++ so didn't use it!!

relevant lines in my sketch (in this case reading depth, as my wind instrument doesn't output NMEA at all so that has to be converted from analog, but the depth simply transmits an nmea sentence so more akin to what you are doing with wind, I think) are:-

Serial2.begin(4800); //Initialise Communications with Plotter ie TX2 is pin for Muxed signal from DUe
Serial3.begin(4800); //Initialise Communications with Depth Instrument - ie pin 3 is for signal from Depth/instr

....

void loop() {

//Look out for Depth messages
....



if (Serial3.available()) {
// get the new byte:
char inChar = (char)Serial3.read();

// add it to the inputString:
DepthString += inChar;
// if the incoming character is a newline, set a flag
// so the main loop can do something about it:
if (inChar == '\n'){
DepthStringComplete = true;

}
}
}
// print the string when a newline arrives:
if (DepthStringComplete) {
Serial2.print(DepthString);
// clear the string:
DepthString = "";
DepthStringComplete = false;
}

............

In plain language, it checks for a new character arriving on serial port 3, builds up the string until it sees a new-line character, which it uses t identify that the string is complete, then sends the entire string down serial port 2 (to my N0183 plotter) and re sets the string to null, starting again.

Does that help?
 
Its TinyGPS++ you need , the new improved version of Tiny GPS!

http://arduiniana.org/libraries/tinygpsplus/

The interesting bit being:-



so presumably you could modify that to read a different input line (for wind rather than GPS data) and then something like

TinyGPSCustom windSpeed(gps, "WIWMV", 3);
will set the variable windSpeed to the the windspeed value

Having said that my code had already been written before we discovered TinyGPS++ so didn't use it!!

relevant lines in my sketch (in this case reading depth, as my wind instrument doesn't output NMEA at all so that has to be converted from analog, but the depth simply transmits an nmea sentence so more akin to what you are doing with wind, I think) are:-



In plain language, it checks for a new character arriving on serial port 3, builds up the string until it sees a new-line character, which it uses t identify that the string is complete, then sends the entire string down serial port 2 (to my N0183 plotter) and re sets the string to null, starting again.

Does that help?

thanks,

I thought that tinygps+++ was already set to read MWV sentences and extract the right info with one call...
Since I've done the NMEA0183 serial message reading and storing already to get back the data sent by the GMI10 regarding the anchor windlass properties, reset rode etc, it's just an hour's work (give or take!) to debug another 10lines of code to grep the right values out of the MWV string, so yes I'll diy and forget the tinygps+++ lib.

What impresses me is that with Timo's work we get an awful lot of work done in no time. Wouldn't dare thinking of creating the N2K messages myself :eek: so top marks for Timo!
I'm done with AutoAnchor, Temp, Tank levels (pending ultrasound code), rudder, wind (finish tonight I hope).

ToDo list now only has:
  • K-type thermistors two on each engine (exhaust dry and wet)
  • gearbox oil pressure
  • diesel consumption (probably a new thread on that soon)


enough to keep me busy for some time...

cheers

V.
 
ToDo list now only has:
  • K-type thermistors two on each engine (exhaust dry and wet).
Seen these ones?
https://www.maximintegrated.com/en/products/analog/sensors-and-sensor-interface/DS18B20.html/tb_tab0

really good, very accurate, daisy chain lots together needing just 1 data pin on an arduino, gives a digital value output so no messing about reading resistance. And dirt cheap, I have 3 on the fridge and 3 on the engine, head,exhaust & alternator.
Ebay do packs of waterproof ones.
 
thanks,

I thought that tinygps+++ was already set to read MWV sentences and extract the right info with one call...
Since I've done the NMEA0183 serial message reading and storing already to get back the data sent by the GMI10 regarding the anchor windlass properties, reset rode etc, it's just an hour's work (give or take!) to debug another 10lines of code to grep the right values out of the MWV string, so yes I'll diy and forget the tinygps+++ lib.

What impresses me is that with Timo's work we get an awful lot of work done in no time. Wouldn't dare thinking of creating the N2K messages myself :eek: so top marks for Timo!
I'm done with AutoAnchor, Temp, Tank levels (pending ultrasound code), rudder, wind (finish tonight I hope).

ToDo list now only has:
  • K-type thermistors two on each engine (exhaust dry and wet)
  • gearbox oil pressure
  • diesel consumption (probably a new thread on that soon)


enough to keep me busy for some time...

cheers

V.

TBH I didn't look for a dedicated call for wind as we had DIY'd it already

Current problem I have is that some binary N2K stuff is getting sent down the TX2 line (supposedly 0183 only) to the GPS and I'm not sure why!
 
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 :)

sorry for going back in circles, but I just found out that one of my two MAX3232 converters is slightly dead. Swapped it in all possible combinations with the other, nothing.
I may have burnt it in earlier experiments when I was driving it at 5V and felt a bit warm to touch, but i'm reluctant to connect my NASA NMEA0183 Wind to test and convert to N2K.
Just to clarify:

NASA blue (TX) goes to pin3 on the TTL-232,
NASA black goes to pin5 (GND)
NASA red goes to an independant 12V power supply to do it's job.
Guess the GNDs of the DUE and the NASA must be somehow bridged.

Angus and others argue that this way NASA output will be converted and limited by the MAX3232 and do it's job, correct?
Where is the optoisolation in this setup?
I mean NASA is "outside" my DUE and paraphernalia, so in theory NASA output (ie. arduino NMEA0183 input) should be isolated, correct?

I really want to try my working 3232 with the NASA but I don't want to end up with two burnt MAX3232...
Ordered 3 plain boards with no fancy 9pin serial sockets, for 8euro delivered from Germany will hopefully have them at the w/e for more testing

BTW, can I test what's burnt in the MAX3232 board? It has 4 tiny flat resistors and the chip, that's all


cheers

V.
 
Seen these ones?
https://www.maximintegrated.com/en/products/analog/sensors-and-sensor-interface/DS18B20.html/tb_tab0

really good, very accurate, daisy chain lots together needing just 1 data pin on an arduino, gives a digital value output so no messing about reading resistance. And dirt cheap, I have 3 on the fridge and 3 on the engine, head,exhaust & alternator.
Ebay do packs of waterproof ones.

I bought something similar following your recommendation in another thread (I think at least) but still haven't arrived.
I do have some classic thermocouples but tried to check the demo code and I freaked out!

waiting delivery

cheers

V.
 
Top