---
title: "Making a Robust Vessel"
url: "https://maker.wiznet.io/louis_m/projects/Making-a-Robust-Vessel/"
markdown_url: "https://maker.wiznet.io/louis_m/projects/Making-a-Robust-Vessel/md"
type: "UCC: User Created Content"
author: "Louis"
author_url: "https://maker.wiznet.io/louis_m/"
original_author: "louis_m"
original_url: "https://www.hackster.io/keesp/day-5-making-a-robust-vessel-3a7cde"
published: "2022-03-02"
language: "en"
likes: 0
views: 186
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Making a Robust Vessel

> Making a Robust Vessel

Original author: louis_m (source: https://www.hackster.io/keesp/day-5-making-a-robust-vessel-3a7cde)

## Article

It's almost weekend in our ongoing project to?[create a semi-autonomous vessel](https://create.arduino.cc/projecthub/keesp/aquabots-autonomous-vessels-23109c), using and Arduino MEGA and some affordable shields and hardware supplements, and so we are going to take it easy today. No additions to the hardware...just a few software tricks!

In the past four days we built a controller for our model boat, which can read GPS signals, send the coordinates to the?[Aquabots Client](http://www.condast.com:8080/arnac/home), after which the vessel will get heading and thrust data to send it somewhere over the globe. However, it would be a bit presumptious to put your vessel in a major shipping lane right now, because this feedback loop is very - and I mean VERY- vulnerable! The GPS can loose its signal and the communications may be down, which leaves your vessel completely blind. In effect, all we have done so far is create a remote control unit and, let's be honest, a joystick is probably a much better option than what we've brewed here!

So on this last day before the weekend, we are going to make some preparations to give the vessel more autonomy. in order to do so, we are going to implement a sort of 'multi-tasking' framework, which will allow us to:

- Add more hardware that can work simultaneousy, like a compass or a 9-degrees board

- implement some load balancing functionality, especially regarding the network traffic

- Develop various levels of alarms to which the vessel can choose a safety strategy.

These functions improve the robustness of our design tremendously, and funnily enough, it doesn't require a lot of effort! All we need is one of Arduino's timer interrupts!

Basically the interrupt will give us a clock that allows us to differentiate between faster and slower processes. For instance, the GPS unit is updated every second or so, but we do not need such a fast pace to check if we are on the right track of a predefined route. Also log messages and NMEA code so not need to transmitted at such a high rate.

The above code highlights the main additions to the code we already made in the previous days. We try to maintain a modular structure, using some elements of object-oriented programming, which helps us to keep oversight and will make it easier to make improvements on the long run.

If you look at the code in the?[GitHub](https://github.com/condast/Aquabots-Client/tree/master/Arduino/Tutorial/Day5/Vessels)?directory, you will see that it also contains a logger module and an options module. These tasks typically do not need to be updated at a high interval level, and they are not very critical and so they provide a perfect test for the multi-tasking platform we developed here. The Logger unit provides a 'print' and 'println' command, which sends the log messages to the?[Aquabots Client](https://create.arduino.cc/projecthub/keesp/aquabots-autonomous-vessels-23109c)?and displays them in the 'log' tab, just like the regular Arduino console.

[Tomorrow](https://create.arduino.cc/projecthub/info/day-6-adding-a-compass-05f38b)?we will use the interrupt routine to add a compass module, so that the vessel becomes more responsive.

---

Source: https://maker.wiznet.io/louis_m/projects/Making-a-Robust-Vessel/
