Arduino project for first timer

Minerva

Well-Known Member
Joined
16 Oct 2019
Messages
1,762
Visit site
I'll prefix this by saying I've never attempted ANYTHING like this before, so please bear with me and please use the language a 6yr old will understand.

With that out of the way, I am curious and impressed by the look of Arduino & Raspberry Pi capabilities yet currently the only thing I know about programming is that I know nothing about programming. I would like to rectify that over the next couple of months and learn something new.

Last winter I installed OpenCPN on a windows tablet with Antares charts and have been quite impressed with it. This is based at the chart table. I want to make this more cleverer.

With this Arduino (I think that what I want to base this project on, correct me if I'm wrong!) project I want to achieve the following;

Wants
  • Have a 'hat' receiving barometric pressure and plotting trends on OpenCPN
  • Receive in NMEA0183 data from a Nasa Wind Unit and plot this & trends on OpenCPN
  • have a 'hat' reading compass / accelerometer / gyroscope data to cover the above wind data into 'True Wind' not just apparent wind.

Optional:
  • Receive in NMEA0183 data from nasa AIS engine and display on Open CPN - I bought a Yakker NMEA to WIFI converter thingamajig so may use this so that I can get AIS data on Navionics tablet in the cockpit.

I think that's all and I have identified my project scope, but where to go from here?

Is anyone able to give me a shove in the correct direction to help me get started?

I know the easy option is to throw out my instruments, get new NMEA2000 compliant ones and a new MFD, but it's the learning a new skill I'm principally interested in here.

Thanks
 
So the Pi and the Arduino are slightly different beasts:
The Pi is a computer that runs an operating system on top of which you run programmes
The Arduino is a processor that runs a single programme on repeat

The Arduino platform is really nice to use, and you can also use arduino clones, some of which have built-in WiFi.

There are a number of basic programmes you can play with, but they all have a setup function and a loop function. The setup function runs once at power up, the loop function then loops until power down.

One way to do it, which minimises the need to deal with RS232 would be to read in your sensors, clean the data and then use signalk (a new nautical data standard) to transmit them to a signalk hub (which you can install on the raspberry pi). OpenCPN then has a SignalK module you can install which allows the data to be used.

SignalK data packets each contain a tag (like "environment.outside.pressure") and a value.

Signak K » DIY sensors with Signal K
Signak K » DIY Sensors with Signal K Part 2 - The Hardware

There's even a project looking at using ESP32 devices (Arduino clones with built in WiFi) for this very task.
GitHub - SignalK/SensESP: Universal Signal K sensor framework for ESP8266 and ESP32
 
Wants
  • Have a 'hat' receiving barometric pressure and plotting trends on OpenCPN
  • Receive in NMEA0183 data from a Nasa Wind Unit and plot this & trends on OpenCPN
  • have a 'hat' reading compass / accelerometer / gyroscope data to cover the above wind data into 'True Wind' not just apparent wind.

Optional:
  • Receive in NMEA0183 data from nasa AIS engine and display on Open CPN - I bought a Yakker NMEA to WIFI converter thingamajig so may use this so that I can get AIS data on Navionics tablet in the cockpit.
Easier still is to use open plotter on a raspberry pi, minimal coding required to achieve the above, most of it is available through config in the gui. The NMEA data can be fed in an multiplexed to the WIFI and opencpn using the built in multiplexer, and some simple Serial to USB converters. likewise the compass / accelerometer / gyro data is done with a simple connection i2c connection to a mpu9255 and using the pypilot code which is ready installed.

OpenPlotter | OpenMarine

Arduino is possibile, but there is a weath of knowledge and time that has gone into openplotter and is far more capable than starting from scratch.

D
 
Ok thanks - the difference between the Pi and the Arduino I think I
Easier still is to use open plotter on a raspberry pi, minimal coding required to achieve the above, most of it is available through config in the gui. The NMEA data can be fed in an multiplexed to the WIFI and opencpn using the built in multiplexer, and some simple Serial to USB converters. likewise the compass / accelerometer / gyro data is done with a simple connection i2c connection to a mpu9255 and using the pypilot code which is ready installed.

OpenPlotter | OpenMarine

Arduino is possibile, but there is a weath of knowledge and time that has gone into openplotter and is far more capable than starting from scratch.

D

Thank you - the OpenPlotter development does look very good, but too similar to OpenCPN I am currently running..?

My thought process was that I already have a Win10 tablet running with OpenCPN successfully running (and also SeaTTY Weatherfax software) and if I were to go RaspberryPi it would just be duplicating what I have, plus I would need to buy a new screen too.

Whereas, I could use an Arduino to compile the NMEA Wind data feed, the barograph Sensor data , and compass sensor data and feed this directly into my existing set up.

Is there a flaw in my logic?
 
I lost a month of my life (me, exaggerate?:oops:) buying pi's and 9 axis sensors trying to get d'Epagnier's Pypilot and or Openplotter
to communicate with them.
Realised I'd need to master a new language of gits tarballs repos distros isos bozos and sudo apts...
(OK I'm bitter...:p)
So please, over to you and can I have a working image?...
 
I lost a month of my life (me, exaggerate?:oops:) buying pi's and 9 axis sensors trying to get d'Epagnier's Pypilot and or Openplotter
to communicate with them.
Realised I'd need to master a new language of gits tarballs repos distros isos bozos and sudo apts...
(OK I'm bitter...:p)
So please, over to you and can I have a working image?...

He's now written some GUIs to select which modules to install.

So yes, in theory the OP could run it all on a raspberry pi, using the tablet as a remote monitor.

If the OP buys I2C barometers and a USB to RS232 dongle, that would be possible on the Pi.
 
Ok thanks - the difference between the Pi and the Arduino I think I


Thank you - the OpenPlotter development does look very good, but too similar to OpenCPN I am currently running..?

My thought process was that I already have a Win10 tablet running with OpenCPN successfully running (and also SeaTTY Weatherfax software) and if I were to go RaspberryPi it would just be duplicating what I have, plus I would need to buy a new screen too.

Whereas, I could use an Arduino to compile the NMEA Wind data feed, the barograph Sensor data , and compass sensor data and feed this directly into my existing set up.

Is there a flaw in my logic?
yes, you don't need to run open cpn on the pi, but for the other functions its far better than arduino and easier to leaverage others work. Openplotter is a ready to go image that you can load onto a sd card and run, a bit of configuring and its ready to go, You can choose which bits you want to load and run, if you are not running opencpn, then look for a raspberry pi 3 secondhand, lots of them about.

At its very simplest, the use of of an arduino to do the above is ok, but you will run into issues with multiplexing on it, while trying to read compass data. Also calibrating the MPU for the compass is a easier on the pi.

Have a read of this guys musing on arduino vs pi

A Raspberry Pi Wireless NMEA-0183 Multiplexer (USB GPS, Digital Compass, and Sailboat Instrument Input)

Take a look at Kplex for simple multiplexing on the pi, simple and easy to run and easy to spit out NMEA on your Wifi for the PC to use. (There is a gui for Kplex in openplotter)

No screen required for the pi, you can connect to it from your existing PC and simply use VNC to view the desktop on it.
 
He's now written some GUIs to select which modules to install.

So yes, in theory the OP could run it all on a raspberry pi, using the tablet as a remote monitor.

If the OP buys I2C barometers and a USB to RS232 dongle, that would be possible on the Pi.
I hate you! After a year of abstinence you've got me going back down the rabbit hole.....
 
yes, you don't need to run open cpn on the pi, but for the other functions its far better than arduino and easier to leaverage others work. Openplotter is a ready to go image that you can load onto a sd card and run, a bit of configuring and its ready to go, You can choose which bits you want to load and run, if you are not running opencpn, then look for a raspberry pi 3 secondhand, lots of them about.

At its very simplest, the use of of an arduino to do the above is ok, but you will run into issues with multiplexing on it, while trying to read compass data. Also calibrating the MPU for the compass is a easier on the pi.

Have a read of this guys musing on arduino vs pi

A Raspberry Pi Wireless NMEA-0183 Multiplexer (USB GPS, Digital Compass, and Sailboat Instrument Input)

Take a look at Kplex for simple multiplexing on the pi, simple and easy to run and easy to spit out NMEA on your Wifi for the PC to use. (There is a gui for Kplex in openplotter)

No screen required for the pi, you can connect to it from your existing PC and simply use VNC to view the desktop on it.

That blog looks just the ticket to guide me through this process. Thank you!

I’ll give it a proper read tomorrow!
 
Top