Homemade NMEA multiplexer

AngusMcDoon,

I have read your posts with interest and admiration and would like to suggest another useful project to keep you busy this winter...

I have been researching simple timer circuits on the net to see if I could make a circuit to operate with a conventional bilge pump switch to control how long the pump stays on for.

This would enable the bilge to be emptied completely, reduce "cycling" as water in the pipe drains back and should help conserve battery charge.

It would enable the automatic bilge switch to be mounted higher. I'm looking for a circuit that is not "always on" and not gradually draining the batteryi.e the bilge switch turns on and then latches on for a certain time.

I'm sure there are commercial options but I'd like to take the "practical Electronics" approach.

Hope that makes sense.

Graham

An alternative approach is to mount a solar panel (?1A-2A charge capacity) on the coach roof to keep batteries topped up when you're not on board?

How much water gets into the bilge? ?Rain leakage ?condensation ?sea water
Tackle the source of leakage?

Graeme
 
I have been researching simple timer circuits on the net to see if I could make a circuit to operate with a conventional bilge pump switch to control how long the pump stays on for.

It would enable the automatic bilge switch to be mounted higher. I'm looking for a circuit that is not "always on" and not gradually draining the batteryi.e the bilge switch turns on and then latches on for a certain time.

I'm sure there are commercial options but I'd like to take the "practical Electronics" approach.

This could be done with the cheapest simplest PIC, a 5V voltage regulator to power it from the boat's 12V supply, and a 50p 10A relay. Would also need about 5 lines of C code to run on the PIC, compiled using a free compiler.
 
Graham - use a delay relay from a car (interior light relay) available from any auto shop.
Allows the pump to run for 20 seconds or so after the auto switch has reverted to 'empty', and doesn't draw any current when not in use.
 
Last edited:
I already did that years ago. But it is a rather sleeping project... Don't fill in that order form, if you are interested I could look if I still have parts.

http://www.ridax.se/mikael/seatalk.htm

If you could have a look that would be great.:)

What I want to do is to convert the Seatalk coming out of my C80 plotter to generate the wind sentences that arent is the NMEA that the plotter will output. I also wonder if the sentences need to be the versions used in the early 90s when the Roberston AP 3000 autopilot was built.
 
Last edited:
rs232 = not(ttl)

This output works fine to input into most modern RS232 receivers as well as you just take one of the data lines and put it in relation to ground to make it RS232 (with +5V voltage level instead of +/-12V which is not necessary for 99% of the modern rs232 receivers).
If you're going to use a single ttl level rather than rs232 (from the max232) to drive the output wouldn't you need to invert it? rs232 specifies -3 to -25 for logic 1 and +3 to +25 for logic 0.
 
If you're going to use a single ttl level rather than rs232 (from the max232) to drive the output wouldn't you need to invert it? rs232 specifies -3 to -25 for logic 1 and +3 to +25 for logic 0.
As you might have noticed, the balanced NMEA output signal is 2 data lines, that are their XOR signals (when one is high the other is low and vice versa). So if you want to connect it to RS232 with a ground level reference, you just pick the "right" data line (and it is OK with trial and error in this case).
 
If you're going to use a single ttl level rather than rs232 (from the max232) to drive the output wouldn't you need to invert it? rs232 specifies -3 to -25 for logic 1 and +3 to +25 for logic 0.

I agree. Here is RS232 driven from a PIC's TTL outputs with extra circuitry to get the signal levels right...

http://www.coolcomponents.co.uk/resources/PICPG4/pic-pg4d-sch.gif

By the time you've added 2 transistors, cap, diode and 5 resistors might as well just use a MAX232 and 4 caps for 60p.

However, I understand Ridax's point about driving RS422 from 2 PIC outputs, although whether the low output from a PIC chip would drive a long line or multiple listeners, I would not be so sure.
 
By the time you've added 2 transistors, cap, diode and 5 resistors might as well just use a MAX232 and 4 caps for 60p.
You don't NEED those resistors, diodes and transistors. Just use your PIC to its full potential. As I pointed out, you just feed the USART Tx output into one of the I/O interrupt pins and then on each change of that pin, you put its inverted value out on another pin and voila, you have the balanced signal and have used a very small portion of the PIC to act as an inverter for you. You have 16 I/O pins on that pic... Why add transistors and resistors when you already have the capability in the pic?

However, I understand Ridax's point about driving RS422 from 2 PIC outputs, although whether the low output from a PIC chip would drive a long line or multiple listeners, I would not be so sure.
What "low" output? Do you mean V or A? For V, you get +5V difference and that's what NMEA specify as the wanted value. For A you get 25mA and that is sufficient for a lot of NMEA devices and is not less than the max232.

The very point with having a balanced signal as NMEA specifies, is that you don't NEED a large voltage difference in the signal, if the signal is balanced. An external signal disturbance will disturb BOTH signals about the same and the voltage difference will be kept intact. THIS is why NMEA/RS422 is much less sensitive for rough environments and why RS422 is used in industrial use instead of RS232 there external noise will affect the absolute levels that it is working with.
 
The very point with having a balanced signal as NMEA specifies, is that you don't NEED a large voltage difference in the signal, if the signal is balanced. An external signal disturbance will disturb BOTH signals about the same and the voltage difference will be kept intact. THIS is why NMEA/RS422 is much less sensitive for rough environments and why RS422 is used in industrial use instead of RS232 there external noise will affect the absolute levels that it is working with.
Absolutely agree that rs422 is less prone to noise assuming a balanced, twisted pair, current loop type of setup. But if rs422 is used in an unbalanced interface then it becomes, if anything, more noise sensitive than rs232.

I guess it depends what one is going to hang on the output. If it's going to be a "proper" NMEA device with a floating, opto-isolator type of input then I reckon your solution is best but if there's going to be an unbalanced serial port (PC) attached then probably the max232 is best. whadya think?
 
You don't NEED those resistors, diodes and transistors. As I pointed out, you just feed the USART Tx output into one of the I/O interrupt pins..

It's frigged RS232 though. Not guaranteed to work if the receiving end is expecting conforming RS232 voltage levels.

What "low" output? For A you get 25mA and that is sufficient for a lot of NMEA devices...

It's a common problem that some NMEA sources can have difficulties when connected to multiple listeners. I would not be surprised if a PIC output driving 3 or 4 listeners also struggled in this case.

Anyway, we're probably losing perspective here for a boating forum. I'm not an electronics engineer, just an amateur fiddling in a shed. My with-line-driver design works, so that's good enough for me.
 
It's frigged RS232 though. Not guaranteed to work if the receiving end is expecting conforming RS232 voltage levels.
But *NMEA* is not RS232. NMEA is RS422 but they ACCEPT RS232, but don't recommend it. Why don't you use what is recommended, when it is both easier, cheaper and more reliable in the environment it is designed for?

If you manage to find a single RS232 input that can't take that RS422 arrangement I suggested, then that device would have problem with most manufacturer's NMEA-ports as well, so I really don't see why this would be a problem. I don't think most manufacturers are implementing NMEA the way you do, but they go the easier, cheaper and more reliable way, which is also the way recommended by the NMEA standard.

It's a common problem that some NMEA sources can have difficulties when connected to multiple listeners. I would not be surprised if a PIC output driving 3 or 4 listeners also struggled in this case.
But in that case your max232 would struggle just the same. It is not stronger in any sense. Rather the opposite. It has a tiny charge pump to supply the power to the pins.

Anyway, we're probably losing perspective here for a boating forum. I'm not an electronics engineer, just an amateur fiddling in a shed. My with-line-driver design works, so that's good enough for me.
It is just that you stressed the fact that you were trying hard to save pennies by changing pic, but still spent a lot of those pennies on a completely unneeded max232 (which also draws extra power BTW, as you stressed the fact that your pic was sleeping).

I am an electronics engineerer and of course I have another perspective on this. For me, every penny saved or spent counts, because if you multiple it with an entire product run, it becomes money. So, adding completely unnecessary components when it can be solved much more elegantly within the PIC itself would not be popular. Also, adding more components adds to the complexity of the solution and increase the number of components that can fail and the number of components that you need to diagnose when something doesn't work.

Actually, 2 NMEA inputs and 1 NMEA output would just require 1 PIC and a 5V power supply. Nothing more (unless you want to opto-isolate the NMEA inputs, but I don't see that you did that in your design anyhow).
 
Last edited:
But *NMEA* is not RS232. NMEA is RS422 but they ACCEPT RS232, but don't recommend it. Why don't you use what is recommended...

Because (although I didn't initially mention it) I also want to feed the signal into a computer's serial port. That's RS232. NMEA0183 standard also says RS232 is ok. MAX232 has got 232 in its part number, so that all seemed like good Feng Shui.

It is just that you stressed the fact that you were trying hard to save pennies by changing pic, but still spent a lot of those pennies on a completely unneeded max232

Ok. I'll put my hands up. I made a 58p mistake in my one off shed fiddling exercise. With my track record I'd better not apply to be the next Irish finance minister, who made a €62 billion mistake.

I am an electronics engineerer...

I'll admit defeat at this point and go back to my area of expertise...Cumberland sausages and being ridiculous.
 
Because (although I didn't initially mention it) I also want to feed the signal into a computer's serial port. That's RS232. NMEA0183 standard also says RS232 is ok.
And you won't have any problem feeding the signal into your computer's serial port, even if you follow the recommendation to make it RS422. I bet you haven't tried it...
 
A nice little project.
I would personally consider opto isolating both sides, unless I knew there were isolators at the other end of the line.
Differential data is far better for EMC purposes, although 4800 baud should not be too troublesome.
It might be worth checking that nothing untoward happens with any combination of devices powered/not powered. Sometimes odd behaviour is possible as the bus tries to power one end via the clamp diodes. (Don't ask!)
 
Anyway, we're probably losing perspective here for a boating forum. I'm not an electronics engineer, just an amateur fiddling in a shed. My with-line-driver design works, so that's good enough for me.

Have you thought of cobbling together small two stroke generator to power it with ???:p


(Impressed, really.)

Andy
 
I would personally consider opto isolating both sides, unless I knew there were isolators at the other end of the line.
Usually you only isolate on the receiver side (because it is easy). As this little project has two inputs (without isolation afaik) those two devices will for sure be "connected" even if the final receiver (that connects to this nmea multiplexer's output) is isolated.
 
Top