OpenMarine
Pypilot with ST4000 autohelm - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: Pypilot (https://forum.openmarine.net/forumdisplay.php?fid=17)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=18)
+--- Thread: Pypilot with ST4000 autohelm (/showthread.php?tid=3111)

Pages: 1 2 3 4 5


Pypilot with ST4000 autohelm - Peter— - 2020-11-26

Hi all

I'm using a ST4000 on my sailboat and it works acceptable. However, I would love to be able to use the features of track following and wind vane control.

The ST4000 has an NMEA+ and NMEA- input to receive data to make the above features work.

Questions:
How do I hook up my Raspberry Pi (or ESP32) to the NMEA input on the Raymarine controller? Do I just use the tx and rx pins? And how do I make Openplotter recognize the pilot? Also, is it possible to use an ESP32 as I would avoid all the wirering..?

Kind Regards,
Peter


RE: Pypilot with ST4000 autohelm - ironman - 2020-11-26

(2020-11-26, 12:39 PM)Peter— Wrote: Questions:
How do I hook up my Raspberry Pi (or ESP32) to the NMEA input on the Raymarine controller? Do I just use the tx and rx pins? And how do I make Openplotter recognize the pilot? Also, is it possible to use an ESP32 as I would avoid all the wirering..?

If you have an openplotter pi hooked up to your gps and windvane already, you would not need another autopilot. Just hook up the pi where openplotter runs on to the nmea wires of your ST4000 using a nmea 0183 to usb adaptor. Configure the connection in opencpn to forward the right nmea messages (APB, RMB, MWV?) to the usb interface. Then, when you activate a route ('track') in opencpn, the autopilot will follow that track if instructed.

Building a pypilot is for those who do not find raymarine 'acceptable' ;-) it really is quite a bit more work, you know.

Cheers,

-


RE: Pypilot with ST4000 autohelm - Peter— - 2020-11-26

Thanks Ironman - That is exactly what I want to do - but why do I need an adapter when I have Txd and rxd pins? 

There must be a way to use that instead + that would enable me to use an esp32 which I would really prefer to avoid pulling wire. I just pick up the nmea on udp from the pi and transfer it over txd to the nmea- port would be my guess. Am I right? Or is there a voltage problem or something? Would do I ground it?

Br, Peter


RE: Pypilot with ST4000 autohelm - ironman - 2020-11-26

(2020-11-26, 03:53 PM)Peter— Wrote: Thanks Ironman - That is exactly what I want to do - but why do I need an adapter when I have Txd and rxd pins? 

There must be a way to use that instead + that would enable me to use an esp32 which I would really prefer to avoid pulling wire. I just pick up the nmea on udp from the pi and transfer it over txd to the nmea- port would be my guess. Am I right? Or is there a voltage problem or something? Would do I ground it?

Br, Peter

Well, nmea0183 is rs422 - that is, a balanced version of rs232. The TxD on the pi (or the ESP32?) is 3.3V TTL. So you won't get away without some form of electrical level adaptor. Besides, you'd probably want to have galvanic isolation to prevent ground loops. 

For only sending data off to the raymarine, which is what you would do, you could get away with a much cheaper RS232 USB adapter - the raymarines seem to have optical isolation on their nmea input (see below - from the ST2000 service manual).

But trying to interpret your remark about avoiding pulling wire - if your plan is to stick an ESP32 to the raymarine and transmit the data by air to it, then you probably know how to figure out a signal adaptor.


RE: Pypilot with ST4000 autohelm - Peter— - 2020-11-26

Thanks Ironman

So the difference between pulling wires from the rs232 Tx and rx pins vs using the gpio rxd and txd pins is 3.3v vs 5v... lame

What about getting a rs232 to microusb and working that with the ESP32 - I guess that would work using the serial print command - or will I still need some sort galvanic isolation?

By the way - I assume Tx goes to NMEA- correct?

Br, Peter


RE: Pypilot with ST4000 autohelm - seandepagnier - 2020-11-26

rs232 does not specify the voltage as 3 or 5 volts it can be much higher
rs422 uses lower voltages usually but there are differential signals

I make and offer isolate nmea adaptors that work with usb as well as ttl signals:
https://pypilot.org/store/index.php?rt=product/product&path=74&product_id=133


RE: Pypilot with ST4000 autohelm - Peter— - 2020-11-26

Would this solve the job?
https://www.amazon.com/Channel-Logic-Converter-Bidirectional-Module/dp/B07GRL18G9

(2020-11-26, 08:09 PM)seandepagnier Wrote: rs232 does not specify the voltage as 3 or 5 volts it can be much higher
rs422 uses lower voltages usually but there are differential signals

I make and offer isolate nmea adaptors that work with usb as well as ttl signals:
https://pypilot.org/store/index.php?rt=product/product&path=74&product_id=133

Ok, so with this device I can connect my esp32 to it using a usb to micro cable and forward udp nmea signals to serial print sentences into my raymarine and problem solved?

Do you send this to Norway?

Br, Peter


RE: Pypilot with ST4000 autohelm - ironman - 2020-11-26

(2020-11-26, 08:02 PM)Peter— Wrote: So the difference between pulling wires from the rs232 Tx and rx pins vs using the gpio rxd and txd pins is 3.3v vs 5v... lame

Not that lame, in fact: 
  • RS232 '1' is negative voltage, TTL '1' is positive. 
  • RS232 '0' is positive voltage, TTL '0' is zero volt.
So you could say it's inverted.


RE: Pypilot with ST4000 autohelm - Peter— - 2020-11-26

i just checked my arduino inventory and I have a handful of bidirectional logic level converters. Maybe I should try one of those I know they are quite genius using a smart layout of mosfets.

I assume that the raymarine nmea doesn’t need power and it’s all just a question of wirering the 5V side of the logic converter to nmea and the 3.3V side to rxd and txd of my esp32 or RPI depending  on the setup - simple as that.

Br, Peter

(2020-11-26, 09:08 PM)ironman Wrote:
(2020-11-26, 08:02 PM)Peter— Wrote: So the difference between pulling wires from the rs232 Tx and rx pins vs using the gpio rxd and txd pins is 3.3v vs 5v... lame

Not that lame, in fact: 
  • RS232 '1' is negative voltage, TTL '1' is positive. 
  • RS232 '0' is positive voltage, TTL '0' is zero volt.
So you could say it's inverted.

Ok, so TX goes to NMEA+ then (with the logic level converter in-between)


RE: Pypilot with ST4000 autohelm - ironman - 2020-11-26

Well if you can post a little more details on that genius mosfet layout I'll give it a glance.