Help with RS232 to TTL conversion for NMEA0183

They are $1.84 @1k at Maxim, so don't get your hopes up. I'm not sure, but it looks like this type doesn't need charge pump capacitors, so there are some advantages.

TIA422/485 line drivers usually don't need charge pump capacitors as the mark/space voltage levels are 5V/0V and 0V/5V. That's taken from Vcc. I use a similar one way TIA422 driver and that runs of Vcc without capacitors. It costs about 50p.
 
slightly off-topic (not much though...)

could you please comment on the following:

pressure sensor that Vin is 12V and Vout is 1V for 1m head, 2V for 2m head etc (up to 12m I think!). My diesel tank which I'm going to try and use with this thing is 1.2m high, so safe to use it as is. However I'm afraid that at some point someone is going to try and blow through the tiny tube and burn the arduino pin...

So Q:
is there a way to plain CLIP current over 3.3V without messing with the analogue values up to that point?
if you can answer in plain english with minimal electronics jargon and/or plain el. diagrams a novice could use, it would be much appreciated :D

cheers

V.
 
Makes sense.

For short range, and non-differential, would you consider output direct from the uC?

sure, that works fine in some/most cases....the OP was using a 3.3v input, so that is more likely to have problems.
for 66p (or lets say even £2) is it worth adding, then it is done properly, protects the uC, you can short it out (accidents happen) and you can drive many inputs over a long distance, why would you
not add one?
 
slightly off-topic (not much though...)

could you please comment on the following:

pressure sensor that Vin is 12V and Vout is 1V for 1m head, 2V for 2m head etc (up to 12m I think!). My diesel tank which I'm going to try and use with this thing is 1.2m high, so safe to use it as is. However I'm afraid that at some point someone is going to try and blow through the tiny tube and burn the arduino pin...

So Q:
is there a way to plain CLIP current over 3.3V without messing with the analogue values up to that point?
if you can answer in plain english with minimal electronics jargon and/or plain el. diagrams a novice could use, it would be much appreciated :D

cheers

V.

Diode clamp will do that. This circuit gives the rough idea...

jyZvD.gif
 
What about logic level shifters? Cheap and easy.

there is cheap and easy and wrong :-)
then cheap and easy and the correct way...

why would you pick the first cheap and easy option? the boys at NMEA write a spec for a reason, although it works with may other home brew methods, for the sake of <£1...why not have the uC outputting the correct thing as per the spec/standard?

its cheap and easy to do it correctly.
 
slightly off-topic (not much though...)

could you please comment on the following:

pressure sensor that Vin is 12V and Vout is 1V for 1m head, 2V for 2m head etc (up to 12m I think!). My diesel tank which I'm going to try and use with this thing is 1.2m high, so safe to use it as is. However I'm afraid that at some point someone is going to try and blow through the tiny tube and burn the arduino pin...

So Q:
is there a way to plain CLIP current over 3.3V without messing with the analogue values up to that point?
if you can answer in plain english with minimal electronics jargon and/or plain el. diagrams a novice could use, it would be much appreciated :D

cheers

V.

I wondered what pressure sensor you are using?
 
Diode clamp will do that. This circuit gives the rough idea...

jyZvD.gif

thanks Angus, I'll try to understand that in the evening when I have time :)

I wondered what pressure sensor you are using?

didn't say it works, it has worked in a BMS system a friend is putting together so I got one to test it. I'll let you know if it does works for sure.
It's a MPX5050GP and he uses them with a circuit board (that I think he designed) to be fed with 12V, stabilised to 5V and output 1V for each metre of head. So need to clip the output to save the arduino Due and test it. Then simply use Timo's NMEA2000 libraries to pump the values to the N2K bus.

cheers

V.
 
Looks like the MPX 5050 reads from 0 to 50kPa [that's from 0 to roughly 5m head of water]. It seems to need 5v in and gives an output from 0.2v to 4.7v over the range 0 to 50kPa. It looks like the output will not exceed the input voltage.

I guess you're using a Due operating at 3.3v.

Does this mean that if the upper clamping diode is attached to +2.6v, you can read up to 3.3v [3.5m of water or 4.2m of diesel].

Being an electronics dumbo, does the lower clamping diode get connected to ground, or does that need to be -0.7v? Does it do anything to the zero pressure voltage level at the input pin of the Due? Or as the sensor just works down towards 0v can you leave the lower clamp out?
 
Looks like the MPX 5050 reads from 0 to 50kPa [that's from 0 to roughly 5m head of water]. It seems to need 5v in and gives an output from 0.2v to 4.7v over the range 0 to 50kPa. It looks like the output will not exceed the input voltage.

I guess you're using a Due operating at 3.3v.

Does this mean that if the upper clamping diode is attached to +2.6v, you can read up to 3.3v [3.5m of water or 4.2m of diesel].

Being an electronics dumbo, does the lower clamping diode get connected to ground, or does that need to be -0.7v? Does it do anything to the zero pressure voltage level at the input pin of the Due? Or as the sensor just works down towards 0v can you leave the lower clamp out?

excellent guessing there, well done :D

tried it out blowing on the tube with the multimeter, wouldn't go over 2.2V no matter how hard I was blowing, was expecting to be an easy job to limit it up to 5V, not even close. As a result I wont bother with any protection on this input, if I'm stupid enough to connect it to a pump I should pay the price of a new Due...

fwiw, idle atmospheric is at 27-28, the better I managed was 250... got to write the rest of the code and test it in real conditions with the tank and built a translation table I guess (somehow), so project seems to be on!

I'll try the ultrasound sensors when they arrive and will see which one I'll use where (got a diesel, a fresh water and a black water tank I want to track)
Black has to be ultrasound, not messing with sh1t and pipes :disgust:

cheers

V.
 
fwiw, idle atmospheric is at 27-28, the better I managed was 250... got to write the rest of the code and test it in real conditions with the tank and built a translation table I guess (somehow), so project seems to be on!

Assuming you are using 10 bit & reference is indeed 3.3v, your atmospheric reading is right on the sensor spec minimum value, and your best effort achieved .98m diesel. Sounds like it should work fine.
 
Oh boy, Oh boy, Oh boy... totally confused now

Sorry to be the idiot electronics newbie but all this Vcc Vs UC stuff is beyond me, I'm afraid

So, I'm taking the advice and going for a Max3232 chip, and 5 x 0.1uF caps as per this diagram, is this correct?

max3232.gif


If so, then my questions - so simple for those that understand this stuff and so bloody impossible to grasp for those of us that don't - are:-

1. What type of capacitor should I use?
2. Even though powered from 3.3v, will this provide the correct RS232 voltages?
3. The chip will process two pairs of signals simultaneously, correct i.e. 2 x 232-TTL and 2 TTL-232
4. Will any damage be done if - for example - there is an input to one signal pin when Vcc is zero (switched off)

Its a funny old business this; I guess if you've ben brought up on it and work with it you get an instinctive feel for it -in the same way I can look at a bit of steel or wood and know if its going to be strong enough, or flexible enough or whatever. But I have no intuition of electronics whatsoever! DC circuits are fine but beyond that - its a nightmare. Sadly i just don't have time to start at the beginning and learn it all - it would be quicker for me to learn Chinese!
 
I can give you my answers to the first two, I will let someone who knows the IC do the others.

[1] Personally I would use ceramic (or MLCC) capacitors, but the diagram shows electrolytic (or tantalum). These are polarised so have to be connected the right way round, if you use them note that pin 6 is different. Note also the value is likely to be shown as 100nF as well as 0.1uF. Voltage wise, go for 16V for electrolytic, ceramic will probably be 50V.

[2] The capacitors form a charge pump, which creates a high voltage from a lower one. So yes!

There is a data sheet that will tell you more, but perhaps not to an electronic newbie :)
 
Last edited:
So, I'm taking the advice and going for a Max3232 chip, and 5 x 0.1uF caps as per this diagram, is this correct?

max3232.gif


If so, then my questions - so simple for those that understand this stuff and so bloody impossible to grasp for those of us that don't - are:-

1. What type of capacitor should I use?
2. Even though powered from 3.3v, will this provide the correct RS232 voltages?
3. The chip will process two pairs of signals simultaneously, correct i.e. 2 x 232-TTL and 2 TTL-232
4. Will any damage be done if - for example - there is an input to one signal pin when Vcc is zero (switched off)

1) Any old cheapy 100nF electrolytlic capacitor with sufficient voltage rating will do. This is a suitable example: http://uk.farnell.com/multicomp/mcmhr50v104m4x7/cap-alu-elec-100nf-50v-rad/dp/1871011

2) Yes. That's the primary purpose of it.

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.

4) No, as long as you don't exceed the maximum voltage allowed at any time as specified in the datasheet.

You don't need to learn it. You need to learn how to copy what someone else has done. Plagiarism rules! :)
 
Last edited:
Top